[postgis-tickets] [SCM] PostGIS branch master updated. 3.1.0rc1-169-gc9a654c

git at osgeo.org git at osgeo.org
Thu Apr 29 21:32:13 PDT 2021


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  c9a654c4ee99352371308f58a449fa0d00471fb8 (commit)
       via  5d1579c988e2cec06938c92d2543588471bfb909 (commit)
       via  754e01cdd100b3ed2989188a49c60cf0e4c0fdc3 (commit)
       via  13569c18081b9aa77f3c6bf2d949ef6b79aea1c5 (commit)
      from  02b6fd4581524d5b8608cdde03cc474b2a2385ac (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 c9a654c4ee99352371308f58a449fa0d00471fb8
Author: Regina Obe <lr at pcorp.us>
Date:   Fri Apr 30 00:32:06 2021 -0400

    shp2pgsql option to disable ANALYZE. Closes #4628  Closes https://github.com/postgis/postgis/pull/610 for PostGIS 3.2.0

diff --git a/NEWS b/NEWS
index 54ca637..2f7d515 100644
--- a/NEWS
+++ b/NEWS
@@ -14,6 +14,7 @@ PostGIS 3.2.0
   - #3778, #4401, ST_Boundary now works for TIN and does not linearize curves (Aliaksandr Kalenik)
   - #4881, #4884, Store sign of edge_id for lineal TopoGeometry in relation table
            to retain direction (Sandro Santilli)
+  - #4628, Add an option to disable ANALYZE when loading shapefiles (Stefan Corneliu Petrea)
 
  * New features*
   - #4841, FindTopology to quickly get a topology record (Sandro Santilli)

commit 5d1579c988e2cec06938c92d2543588471bfb909
Author: Stefan Petrea <stefan.petrea at gmail.com>
Date:   Fri Apr 30 07:22:24 2021 +0300

    updated docs

diff --git a/doc/using_postgis_dataman.xml b/doc/using_postgis_dataman.xml
index be48bb9..52264ef 100644
--- a/doc/using_postgis_dataman.xml
+++ b/doc/using_postgis_dataman.xml
@@ -1677,6 +1677,16 @@ AVERYLONGCOLUMNNAME DBFFIELD2</programlisting>
         </para>
       </listitem>
     </varlistentry>
+    <varlistentry>
+      <term>-Z</term>
+      <listitem>
+        <para>
+          When used, this flag will prevent the generation of <code>ANALYZE</code> statements.
+          Without the -Z flag (default behaviour), the <code>ANALYZE</code> statements will
+          be generated.
+        </para>
+      </listitem>
+    </varlistentry>
   </variablelist>
 
   <para>

commit 754e01cdd100b3ed2989188a49c60cf0e4c0fdc3
Author: Stefan Petrea <stefan.petrea at gmail.com>
Date:   Fri Apr 30 06:21:41 2021 +0300

    updating test with -Z switch

diff --git a/regress/loader/PointWithSchema.opts b/regress/loader/PointWithSchema.opts
index eac9db9..f9e761f 100644
--- a/regress/loader/PointWithSchema.opts
+++ b/regress/loader/PointWithSchema.opts
@@ -1,2 +1,2 @@
 # Test loading a table with a schema.
--g the_geom {regdir}/loader/PointWithSchema pgreg.loadedshp
+-Z -g the_geom {regdir}/loader/PointWithSchema pgreg.loadedshp

commit 13569c18081b9aa77f3c6bf2d949ef6b79aea1c5
Author: Stefan Petrea <stefan.petrea at gmail.com>
Date:   Fri Apr 30 03:46:46 2021 +0300

    added -Z option to prevent tables from being  analyzed

diff --git a/loader/shp2pgsql-cli.c b/loader/shp2pgsql-cli.c
index efaae13..149ed55 100644
--- a/loader/shp2pgsql-cli.c
+++ b/loader/shp2pgsql-cli.c
@@ -68,6 +68,7 @@ usage()
 	printf(_( "  -X <tablespace> Specify the tablespace for the table's indexes.\n"
                   "      This applies to the primary key, and the spatial index if\n"
                   "      the -I flag is used.\n" ));
+	printf(_( "  -Z  Prevent tables from being analyzed.\n" ));
 	printf(_( "  -?  Display this help screen.\n" ));
 	printf( "\n" );
 	printf(_( "  An argument of `--' disables further option processing.\n" ));
@@ -102,7 +103,7 @@ main (int argc, char **argv)
 	set_loader_config_defaults(config);
 
 	/* Keep the flag list alphabetic so it's easy to see what's left. */
-	while ((c = pgis_getopt(argc, argv, "-acdeg:ikm:nps:t:wDGIN:ST:W:X:")) != EOF)
+	while ((c = pgis_getopt(argc, argv, "-acdeg:ikm:nps:t:wDGIN:ST:W:X:Z")) != EOF)
 	{
 		// can not do this inside the switch case
 		if ('-' == c)
@@ -125,6 +126,10 @@ main (int argc, char **argv)
 			config->geography = 1;
 			break;
 
+		case 'Z':
+			config->analyze = 0;
+			break;
+
 		case 'S':
 			config->simple_geometries = 1;
 			break;
diff --git a/loader/shp2pgsql-core.c b/loader/shp2pgsql-core.c
index b6963cd..f292f21 100644
--- a/loader/shp2pgsql-core.c
+++ b/loader/shp2pgsql-core.c
@@ -763,6 +763,7 @@ set_loader_config_defaults(SHPLOADERCONFIG *config)
 	config->quoteidentifiers = 0;
 	config->forceint4 = 0;
 	config->createindex = 0;
+	config->analyze = 1;
 	config->readshape = 1;
 	config->force_output = FORCE_OUTPUT_DISABLE;
 	config->encoding = strdup(ENCODING_DEFAULT);
@@ -1925,13 +1926,17 @@ ShpLoaderGetSQLFooter(SHPLOADERSTATE *state, char **strfooter)
 		stringbuffer_aprintf(sb, "COMMIT;\n");
 	}
 
-	/* Always ANALYZE the resulting table, for better stats */
-	stringbuffer_aprintf(sb, "ANALYZE ");
-	if (state->config->schema)
+
+	if(state->config->analyze)
 	{
-		stringbuffer_aprintf(sb, "\"%s\".", state->config->schema);
+		/* Always ANALYZE the resulting table, for better stats */
+		stringbuffer_aprintf(sb, "ANALYZE ");
+		if (state->config->schema)
+		{
+			stringbuffer_aprintf(sb, "\"%s\".", state->config->schema);
+		}
+		stringbuffer_aprintf(sb, "\"%s\";\n", state->config->table);
 	}
-	stringbuffer_aprintf(sb, "\"%s\";\n", state->config->table);
 
 	/* Copy the string buffer into a new string, destroying the string buffer */
 	ret = (char *)malloc(strlen((char *)stringbuffer_getstring(sb)) + 1);
diff --git a/loader/shp2pgsql-core.h b/loader/shp2pgsql-core.h
index d00a979..905f922 100644
--- a/loader/shp2pgsql-core.h
+++ b/loader/shp2pgsql-core.h
@@ -114,6 +114,9 @@ typedef struct shp_loader_config
 	/* 0 = no index, 1 = create index after load */
 	int createindex;
 
+    /* 0 = don't analyze tables , 1 = analyze tables */
+	int analyze;
+
 	/* 0 = load DBF file only, 1 = load everything */
 	int readshape;
 

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

Summary of changes:
 NEWS                                |  1 +
 doc/using_postgis_dataman.xml       | 10 ++++++++++
 loader/shp2pgsql-cli.c              |  7 ++++++-
 loader/shp2pgsql-core.c             | 15 ++++++++++-----
 loader/shp2pgsql-core.h             |  3 +++
 regress/loader/PointWithSchema.opts |  2 +-
 6 files changed, 31 insertions(+), 7 deletions(-)


hooks/post-receive
-- 
PostGIS


More information about the postgis-tickets mailing list