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

stable-3.2
Regina Obe 2021-11-20 20:41:04 -05:00
parent 677d2019a7
commit 540e03f0e0
8 changed files with 12 additions and 5 deletions

3
NEWS
View File

@ -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

View File

@ -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];
}

View File

@ -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

View File

@ -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

View File

@ -0,0 +1 @@
UTF-8

Binary file not shown.

Binary file not shown.

Binary file not shown.