[postgis-tickets] [SCM] PostGIS branch stable-3.1 updated. 3.1.4-17-g77a4e86e2

git at osgeo.org git at osgeo.org
Sat Nov 20 18:46:32 PST 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, stable-3.1 has been updated
       via  77a4e86e2a22432d6bd56b424d8a48517d91f317 (commit)
      from  eb224213579dabb685bf00ff14f532e3ce3d32e4 (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 77a4e86e2a22432d6bd56b424d8a48517d91f317
Author: Regina Obe <lr at pcorp.us>
Date:   Sat Nov 20 21:46:25 2021 -0500

    Support for CTEs in pgsql2shp. Closes #5018 for PostGIS 3.1.5. Also minor news cleanup

diff --git a/NEWS b/NEWS
index c74b6d020..455bd8b2a 100644
--- a/NEWS
+++ b/NEWS
@@ -3,9 +3,8 @@ PostGIS 3.1.5
 
 * Bug Fixes
   - #4994, Random missing INSERT in shp2pgsql (Sandro Santilli)
-  - loader: Respect LDFLAGS (Greg Troxel)
-
-
+  - #5016, loader (shp2pgsq): Respect LDFLAGS (Greg Troxel)
+  - #5018, pgsql2shp basic support for WITH CTE clause (Regina Obe)
 
 PostGIS 3.1.4
 2021/09/04
diff --git a/loader/pgsql2shp-cli.c b/loader/pgsql2shp-cli.c
index 6fa975fd5..06f8ce08a 100644
--- a/loader/pgsql2shp-cli.c
+++ b/loader/pgsql2shp-cli.c
@@ -136,9 +136,12 @@ main(int argc, char **argv)
 	   it's a user-defined query then set that instead */
 	if (pgis_optind < argc)
 	{
-		/* User-defined queries begin with SELECT */
-		if (!strncmp(argv[pgis_optind], "SELECT ", 7) ||
-			!strncmp(argv[pgis_optind], "select ", 7))
+		/* User-defined queries begin with SELECT or WITH */
+		if ( !strncmp(argv[pgis_optind], "SELECT ", 7) ||
+			!strncmp(argv[pgis_optind], "select ", 7) ||
+			!strncmp(argv[pgis_optind], "WITH ", 5) ||
+			!strncmp(argv[pgis_optind], "with ", 5)
+		)
 		{
 			config->usrquery = argv[pgis_optind];
 		}
diff --git a/regress/dumper/tests.mk b/regress/dumper/tests.mk
index cbc49dde3..18b4b71d1 100644
--- a/regress/dumper/tests.mk
+++ b/regress/dumper/tests.mk
@@ -15,4 +15,5 @@ TESTS += \
 	$(topsrcdir)/regress/dumper/literalsrid \
 	$(topsrcdir)/regress/dumper/realtable \
 	$(topsrcdir)/regress/dumper/nullsintable \
-	$(topsrcdir)/regress/dumper/null3d
+	$(topsrcdir)/regress/dumper/null3d \
+	$(topsrcdir)/regress/dumper/withclause
diff --git a/regress/dumper/withclause.dmp b/regress/dumper/withclause.dmp
new file mode 100644
index 000000000..46be474e3
--- /dev/null
+++ b/regress/dumper/withclause.dmp
@@ -0,0 +1 @@
+WITH m(address, some_very_long_name, color, geom) AS ( VALUES ('This is Test 1', 'TT1', 'red', ST_Point(0, 0)), ('This is Test 2', 'TT2', 'green', ST_Point(0, 100) ) ) SELECT * FROM m
diff --git a/regress/dumper/withclause_expected.cpg b/regress/dumper/withclause_expected.cpg
new file mode 100644
index 000000000..3ad133c04
--- /dev/null
+++ b/regress/dumper/withclause_expected.cpg
@@ -0,0 +1 @@
+UTF-8
\ No newline at end of file
diff --git a/regress/dumper/withclause_expected.dbf b/regress/dumper/withclause_expected.dbf
new file mode 100644
index 000000000..255c05b0d
Binary files /dev/null and b/regress/dumper/withclause_expected.dbf differ
diff --git a/regress/dumper/withclause_expected.shp b/regress/dumper/withclause_expected.shp
new file mode 100644
index 000000000..829055595
Binary files /dev/null and b/regress/dumper/withclause_expected.shp differ
diff --git a/regress/dumper/withclause_expected.shx b/regress/dumper/withclause_expected.shx
new file mode 100644
index 000000000..314770b3d
Binary files /dev/null and b/regress/dumper/withclause_expected.shx differ

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

Summary of changes:
 NEWS                                                      |   5 ++---
 loader/pgsql2shp-cli.c                                    |   9 ++++++---
 regress/dumper/tests.mk                                   |   3 ++-
 regress/dumper/withclause.dmp                             |   1 +
 regress/dumper/withclause_expected.cpg                    |   1 +
 regress/dumper/withclause_expected.dbf                    | Bin 0 -> 175 bytes
 .../{mfiledmp_expected.shp => withclause_expected.shp}    | Bin
 .../{mfiledmp_expected.shx => withclause_expected.shx}    | Bin
 8 files changed, 12 insertions(+), 7 deletions(-)
 create mode 100644 regress/dumper/withclause.dmp
 create mode 100644 regress/dumper/withclause_expected.cpg
 create mode 100644 regress/dumper/withclause_expected.dbf
 copy regress/dumper/{mfiledmp_expected.shp => withclause_expected.shp} (100%)
 copy regress/dumper/{mfiledmp_expected.shx => withclause_expected.shx} (100%)


hooks/post-receive
-- 
PostGIS


More information about the postgis-tickets mailing list