[postgis-tickets] [SCM] PostGIS branch master updated. 3.3.0alpha1-73-g6bbcbef15

git at osgeo.org git at osgeo.org
Thu Jun 16 07:55:10 PDT 2022


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "PostGIS".

The branch, master has been updated
       via  6bbcbef15ea2453add883d25058b38b5774d0303 (commit)
      from  a3afe5ff4502b172d3edc20421fc6facb01ae814 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 6bbcbef15ea2453add883d25058b38b5774d0303
Author: Regina Obe <lr at pcorp.us>
Date:   Thu Jun 16 00:52:37 2022 -0400

    Replace -Z option as  optional argument to -Y option.
    Increase default of copy to 50 rows from 11.  References #5170

diff --git a/NEWS b/NEWS
index f4a2690c9..7f8716a29 100644
--- a/NEWS
+++ b/NEWS
@@ -3,8 +3,9 @@ PostGIS 3.3.0dev
 Changes since PostGIS 3.3.0alpha1
 * Enhancements *
   - #5158, pgtopo_import / pgtopo_export manpages (Sandro Santilli)
-  - #5170, add a -Z option to raster2pgsql to
-    control number of rows per copy statement (Regina Obe)
+  - #5170, add a optional max_rows_per_copy to -Y option to raster2pgsql to
+    control number of rows per copy statement.
+    Default to 50 when not specified (Regina Obe)
   - #4939, #5161, ST_LineMerge now has option to keep the directions of input linestrings,
     useful when processing road graphs. Requires GEOS 3.11. (Sergei Shoulbakov)
   - #5039, postgis_tiger_geocoder TIGER 2021 (Regina Obe)
diff --git a/doc/using_raster_dataman.xml b/doc/using_raster_dataman.xml
index 8f6e18ce9..a344468fd 100644
--- a/doc/using_raster_dataman.xml
+++ b/doc/using_raster_dataman.xml
@@ -284,18 +284,11 @@
                  </varlistentry>
 
                <varlistentry>
-                  <term>-Y</term>
+                  <term>-Y  <varname>max_rows_per_copy=50</varname></term>
                   <listitem>
                     <para>
-                      Use copy statements instead of insert statements.</para>
-                  </listitem>
-                </varlistentry>
-
-                <varlistentry>
-                  <term>-Z <varname>max_rows_per_copy</varname></term>
-                  <listitem>
-                    <para>
-                      Specify max number of rows per copy statement. Only relevant when combined with -Y.</para>
+                      Use copy statements instead of insert statements.  Optionally specify <varname>max_rows_per_copy</varname> statement.
+                      Defaults to 50 when not specified.</para>
                   </listitem>
                 </varlistentry>
 
diff --git a/raster/loader/raster2pgsql.c b/raster/loader/raster2pgsql.c
index 9f95a395e..3c3edd368 100644
--- a/raster/loader/raster2pgsql.c
+++ b/raster/loader/raster2pgsql.c
@@ -704,7 +704,7 @@ init_config(RTLOADERCFG *config) {
 	config->version = 0;
 	config->transaction = 1;
 	config->copy_statements = 0;
-	config->max_tiles_per_copy = 11;
+	config->max_tiles_per_copy = 50;
 }
 
 static void
@@ -2600,12 +2600,17 @@ main(int argc, char **argv) {
 		/* COPY statements */
 		else if (CSEQUAL(argv[argit], "-Y")) {
 			config->copy_statements = 1;
+			/* max tiles per copy */
+			if ( argit < argc - 1) {
+				optarg = argv[argit + 1];
+				if (atoi(optarg) > 0 ) {
+					config->max_tiles_per_copy = atoi(optarg);
+					++argit;
+				}
+			}
 		}
 
-		/* max tiles per copy */
-		else if (CSEQUAL(argv[argit], "-Z") && argit < argc - 1) {
-			config->max_tiles_per_copy = atoi(argv[++argit]);
-		}
+
 		/* GDAL formats */
 		else if (CSEQUAL(argv[argit], "-G")) {
 			uint32_t drv_count = 0;
diff --git a/raster/test/regress/loader/TiledAutoCopyn.opts b/raster/test/regress/loader/TiledAutoCopyn.opts
new file mode 100644
index 000000000..a3e30dafa
--- /dev/null
+++ b/raster/test/regress/loader/TiledAutoCopyn.opts
@@ -0,0 +1 @@
+-t auto -C -Y 20
diff --git a/raster/test/regress/loader/TiledAutoZCopy.select.expected b/raster/test/regress/loader/TiledAutoCopyn.select.expected
similarity index 100%
rename from raster/test/regress/loader/TiledAutoZCopy.select.expected
rename to raster/test/regress/loader/TiledAutoCopyn.select.expected
diff --git a/raster/test/regress/loader/TiledAutoZCopy.select.sql b/raster/test/regress/loader/TiledAutoCopyn.select.sql
similarity index 100%
rename from raster/test/regress/loader/TiledAutoZCopy.select.sql
rename to raster/test/regress/loader/TiledAutoCopyn.select.sql
diff --git a/raster/test/regress/loader/TiledAutoZCopy.tif.ref b/raster/test/regress/loader/TiledAutoCopyn.tif.ref
similarity index 100%
rename from raster/test/regress/loader/TiledAutoZCopy.tif.ref
rename to raster/test/regress/loader/TiledAutoCopyn.tif.ref
diff --git a/raster/test/regress/loader/TiledAutoZCopy.opts b/raster/test/regress/loader/TiledAutoZCopy.opts
deleted file mode 100644
index c0810c3e4..000000000
--- a/raster/test/regress/loader/TiledAutoZCopy.opts
+++ /dev/null
@@ -1 +0,0 @@
--t auto -C -Y -Z 20
diff --git a/raster/test/regress/loader/TiledAutoZCopy.sql b/raster/test/regress/loader/TiledAutoZCopy.sql
deleted file mode 100644
index 81d831770..000000000
--- a/raster/test/regress/loader/TiledAutoZCopy.sql
+++ /dev/null
@@ -1 +0,0 @@
-select count(*) from loadedrast;
diff --git a/raster/test/regress/tests.mk b/raster/test/regress/tests.mk
index 92676bb42..2c5d006bc 100644
--- a/raster/test/regress/tests.mk
+++ b/raster/test/regress/tests.mk
@@ -134,7 +134,7 @@ RASTER_TEST_LOADER = \
 	$(topsrcdir)/raster/test/regress/loader/Tiled8x8 \
 	$(topsrcdir)/raster/test/regress/loader/TiledAuto \
 	$(topsrcdir)/raster/test/regress/loader/TiledAutoSkipNoData \
-	$(topsrcdir)/raster/test/regress/loader/TiledAutoZCopy
+	$(topsrcdir)/raster/test/regress/loader/TiledAutoCopyn
 
 RASTER_TESTS := $(RASTER_TEST_FIRST) \
 	$(RASTER_TEST_METADATA) $(RASTER_TEST_IO) $(RASTER_TEST_BASIC_FUNC) \

-----------------------------------------------------------------------

Summary of changes:
 NEWS                                                      |  5 +++--
 doc/using_raster_dataman.xml                              | 13 +++----------
 raster/loader/raster2pgsql.c                              | 15 ++++++++++-----
 raster/test/regress/loader/TiledAutoCopyn.opts            |  1 +
 ...opy.select.expected => TiledAutoCopyn.select.expected} |  0
 ...iledAutoZCopy.select.sql => TiledAutoCopyn.select.sql} |  0
 .../{TiledAutoZCopy.tif.ref => TiledAutoCopyn.tif.ref}    |  0
 raster/test/regress/loader/TiledAutoZCopy.opts            |  1 -
 raster/test/regress/loader/TiledAutoZCopy.sql             |  1 -
 raster/test/regress/tests.mk                              |  2 +-
 10 files changed, 18 insertions(+), 20 deletions(-)
 create mode 100644 raster/test/regress/loader/TiledAutoCopyn.opts
 rename raster/test/regress/loader/{TiledAutoZCopy.select.expected => TiledAutoCopyn.select.expected} (100%)
 rename raster/test/regress/loader/{TiledAutoZCopy.select.sql => TiledAutoCopyn.select.sql} (100%)
 rename raster/test/regress/loader/{TiledAutoZCopy.tif.ref => TiledAutoCopyn.tif.ref} (100%)
 delete mode 100644 raster/test/regress/loader/TiledAutoZCopy.opts
 delete mode 100644 raster/test/regress/loader/TiledAutoZCopy.sql


hooks/post-receive
-- 
PostGIS


More information about the postgis-tickets mailing list