[SCM] PostGIS branch master updated. 3.6.0rc2-694-gb9fc9d0e4
git at osgeo.org
git at osgeo.org
Tue Jun 30 22:00:34 PDT 2026
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 b9fc9d0e46257f3d5843b289ab7e2b7a4d134f8c (commit)
via bbfd0865f4c84c10dd2f1edc6d0d1b0ac08f7bf0 (commit)
from 1b06d92d11c04f330e2a7f4954d3892746d47a11 (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 b9fc9d0e46257f3d5843b289ab7e2b7a4d134f8c
Merge: 1b06d92d1 bbfd0865f
Author: Darafei Praliaskouski <me at komzpa.net>
Date: Wed Jul 1 08:58:26 2026 +0400
Merge pull request https://github.com/postgis/postgis/pull/1018
loader: detect pgsql2shp query keywords case-insensitively
commit bbfd0865f4c84c10dd2f1edc6d0d1b0ac08f7bf0
Author: Darafei Praliaskouski <me at komzpa.net>
Date: Sat Jun 20 10:29:55 2026 +0400
loader: detect pgsql2shp query keywords case-insensitively
Closes #4616
diff --git a/NEWS b/NEWS
index a636077cb..9c6cd8f3b 100644
--- a/NEWS
+++ b/NEWS
@@ -96,6 +96,8 @@ To take advantage of all postgis_sfcgal extension features SFCGAL 2.3+ is needed
when padding is not requested (Darafei Praliaskouski)
- #2623, Generate a pgsql2shp GID field when exporting geometry-only
shapefiles (Darafei Praliaskouski)
+ - #4616, Detect pgsql2shp query keywords case-insensitively
+ (Darafei Praliaskouski)
- #2838, Emit valid X3D Coordinate nodes for 2D polygon output
(Darafei Praliaskouski)
- Fix WKB and TWKB parser resource exhaustion on malformed input
diff --git a/loader/pgsql2shp-cli.c b/loader/pgsql2shp-cli.c
index 4ce700521..075aa8d47 100644
--- a/loader/pgsql2shp-cli.c
+++ b/loader/pgsql2shp-cli.c
@@ -19,6 +19,9 @@
#include "pgsql2shp-core.h"
#include "../postgis_config.h"
+#include <ctype.h>
+#include <strings.h>
+
#define xstr(s) str(s)
#define str(s) #s
@@ -55,6 +58,16 @@ usage(int status)
exit(status);
}
+static int
+is_user_query_argument(const char *argument)
+{
+ while (isspace((unsigned char)*argument))
+ argument++;
+
+ return (!strncasecmp(argument, "SELECT", 6) && isspace((unsigned char)argument[6])) ||
+ (!strncasecmp(argument, "WITH", 4) && isspace((unsigned char)argument[4]));
+}
+
int
main(int argc, char **argv)
{
@@ -137,11 +150,7 @@ main(int argc, char **argv)
if (pgis_optind < argc)
{
/* 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)
- )
+ if (is_user_query_argument(argv[pgis_optind]))
{
config->usrquery = argv[pgis_optind];
}
diff --git a/regress/dumper/mixedcasequery.dmp b/regress/dumper/mixedcasequery.dmp
new file mode 100644
index 000000000..73eca7b5f
--- /dev/null
+++ b/regress/dumper/mixedcasequery.dmp
@@ -0,0 +1 @@
+Select * FROM (VALUES ('This is Test 1', 'TT1', 'red', ST_Point(0, 0)), ('This is Test 2', 'TT2', 'green', ST_Point(0, 100))) AS m (address, some_very_long_name, color, geom)
diff --git a/regress/dumper/mixedcasequery_expected.dbf b/regress/dumper/mixedcasequery_expected.dbf
new file mode 100644
index 000000000..255c05b0d
Binary files /dev/null and b/regress/dumper/mixedcasequery_expected.dbf differ
diff --git a/regress/dumper/mixedcasequery_expected.shp b/regress/dumper/mixedcasequery_expected.shp
new file mode 100644
index 000000000..829055595
Binary files /dev/null and b/regress/dumper/mixedcasequery_expected.shp differ
diff --git a/regress/dumper/mixedcasequery_expected.shx b/regress/dumper/mixedcasequery_expected.shx
new file mode 100644
index 000000000..314770b3d
Binary files /dev/null and b/regress/dumper/mixedcasequery_expected.shx differ
diff --git a/regress/dumper/tests.mk.in b/regress/dumper/tests.mk.in
index 7b852ffd7..05ebba220 100644
--- a/regress/dumper/tests.mk.in
+++ b/regress/dumper/tests.mk.in
@@ -21,6 +21,7 @@ TESTS += \
$(top_srcdir)/regress/dumper/nullsintable \
$(top_srcdir)/regress/dumper/null3d \
$(top_srcdir)/regress/dumper/numeric \
+ $(top_srcdir)/regress/dumper/mixedcasequery \
$(top_srcdir)/regress/dumper/withclause
ifeq ($(shell expr "$(POSTGIS_PGSQL_VERSION)" ">=" 150),1)
-----------------------------------------------------------------------
Summary of changes:
NEWS | 2 ++
loader/pgsql2shp-cli.c | 19 ++++++++++++++-----
regress/dumper/{mfiledmp.dmp => mixedcasequery.dmp} | 3 +--
...ause_expected.dbf => mixedcasequery_expected.dbf} | Bin
...edmp_expected.shp => mixedcasequery_expected.shp} | Bin
...edmp_expected.shx => mixedcasequery_expected.shx} | Bin
regress/dumper/tests.mk.in | 1 +
7 files changed, 18 insertions(+), 7 deletions(-)
copy regress/dumper/{mfiledmp.dmp => mixedcasequery.dmp} (52%)
copy regress/dumper/{withclause_expected.dbf => mixedcasequery_expected.dbf} (100%)
copy regress/dumper/{mfiledmp_expected.shp => mixedcasequery_expected.shp} (100%)
copy regress/dumper/{mfiledmp_expected.shx => mixedcasequery_expected.shx} (100%)
hooks/post-receive
--
PostGIS
More information about the postgis-tickets
mailing list