[postgis-tickets] [SCM] PostGIS branch master updated. 3.2.0beta1-25-g540e03f0e

git at osgeo.org git at osgeo.org
Sat Nov 20 17:41:09 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, master has been updated
       via  540e03f0e0f11856849ba88bd9e6529a166311c3 (commit)
      from  677d2019a7b7da0f4a6b63eac22dd607ffd72a83 (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 540e03f0e0f11856849ba88bd9e6529a166311c3
Author: Regina Obe <lr at pcorp.us>
Date:   Sat Nov 20 20:41:04 2021 -0500

    Support for CTEs in pgsql2shp. References #5018 for PostGIS 3.2.0. Also minor news cleanup

diff --git a/NEWS b/NEWS
index bc5cda4d1..13889e2cf 100644
--- a/NEWS
+++ b/NEWS
@@ -1,7 +1,8 @@
 PostGIS 3.2.0beta2
 2021/xx/xx
   * Breaking changes / fixes *
-  - loader: Respect LDFLAGS (Greg Troxel)
+  - #5016, loader (shp2pgsq): Respect LDFLAGS (Greg Troxel)
+  - #5018, pgsql2shp basic support for WITH CTE clause (Regina Obe)
 
 PostGIS 3.2.0
 2021/xx/xx
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                                                      |   3 ++-
 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(+), 5 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