From git at osgeo.org Tue Mar 3 17:51:15 2026 From: git at osgeo.org (git at osgeo.org) Date: Tue, 3 Mar 2026 17:51:15 -0800 (PST) Subject: [SCM] PostGIS branch master updated. 3.6.0rc2-349-g3490b7ff1 Message-ID: <20260304015115.95FD4169728@trac.osgeo.org> 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 3490b7ff1cb2ea50504425d13e9d9e144f598098 (commit) from c21b6cede2e4fdb96233f322d44d5bac256036c8 (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 3490b7ff1cb2ea50504425d13e9d9e144f598098 Author: Teramoto Ikuhiro Date: Wed Mar 4 00:26:02 2026 +0000 Translated PostGIS Manual using Weblate (Japanese) Currently translated at 99.7% (5879 of 5893 strings) Translation: postgis/PostGIS Manual Translate-URL: https://weblate.osgeo.org/projects/postgis/postgis-manual/ja/ diff --git a/doc/po/ja/postgis-manual.po b/doc/po/ja/postgis-manual.po index a1b0a4376..1f5486de5 100644 --- a/doc/po/ja/postgis-manual.po +++ b/doc/po/ja/postgis-manual.po @@ -10,7 +10,7 @@ msgstr "" "Project-Id-Version: postgis 3.5\n" "Report-Msgid-Bugs-To: https://bugs.kde.org\n" "POT-Creation-Date: 2025-11-13 16:23+0000\n" -"PO-Revision-Date: 2026-02-27 07:51+0000\n" +"PO-Revision-Date: 2026-03-04 01:51+0000\n" "Last-Translator: Teramoto Ikuhiro \n" "Language-Team: Japanese \n" @@ -21061,7 +21061,7 @@ msgstr "" "?????????? (??????)" #. Tag: para -#, fuzzy, no-c-format +#, no-c-format msgid "" "If a table oid is provided, this function tries to " "determine the srid, dimension, and geometry type of all geometry columns in " @@ -21071,9 +21071,9 @@ msgid "" msgstr "" "?????oid??????????????????" "???????????????SRID?????????????????????" -"???????????????? ?????????" -"geometry_columns?????????????????????????" -"??????????????????????" +"???????????????? ?????????geometry_columns?????" +"??????????????????????????????????????" +"????" #. Tag: para #, no-c-format @@ -21089,7 +21089,7 @@ msgstr "" "varname>????????????????????????" #. Tag: para -#, fuzzy, no-c-format +#, no-c-format msgid "" "The parameterless variant is a simple wrapper for the parameterized variant " "that first truncates and repopulates the geometry_columns table for every " @@ -21100,11 +21100,11 @@ msgid "" "returns the number of rows inserted into the geometry_columns table." msgstr "" -"???????????geometry_columns??????????" -"??????????????????????????????????????" -"??????????????????????????????????????" -"???????????????geometry_columns??????" -"???????????????????????geometry_columnsgeometry_columns?????" +"????????????????????????geometry_columns???????????????" #. Tag: para @@ -31634,15 +31634,15 @@ msgstr "" "???????)????????X?Y (?????)??????????" #. Tag: para -#, fuzzy, no-c-format +#, no-c-format msgid "" "Return record format: geom , val double precision, x " "integer, y integers." msgstr "" -"???????????????geom???????????val????" -"x????y???" +"?????????????geom (?)?val (??????????)" +"?x (???)?y (???)???" #. Tag: para #, no-c-format @@ -35592,14 +35592,14 @@ msgstr "" "args?????????" #. Tag: para -#, fuzzy, no-c-format +#, no-c-format msgid "" "The text[] argument to the userfunction is " "required, regardless of whether you choose to pass any arguments to your " "user function for processing or not." msgstr "" -"userfunction??text[]???????????" -"??????????????????????????????????" +"text[]????????? userfunction????" +"???????????????????????" #. Tag: para #, no-c-format @@ -35713,14 +35713,14 @@ msgstr "" "userargs?????????" #. Tag: para -#, fuzzy, no-c-format +#, no-c-format msgid "" "The text[] argument to the tworastuserfunc " "is required, regardless of whether you choose to pass any arguments to your " "user function for processing or not." msgstr "" -"tworastuserfunc??text[]??????????" -"???????????????????????????????????" +"text[]????????? tworastuserfunc??" +"?????????????????????????" #. Tag: para #, no-c-format @@ -48279,7 +48279,7 @@ msgstr "" "??????????????????????????" #. Tag: para -#, fuzzy, no-c-format +#, no-c-format msgid "" "If SET ENABLE_SEQSCAN TO OFF; helps your query to run " "faster, your Postgres is likely not tuned for your hardware. If you find the " @@ -48292,11 +48292,11 @@ msgid "" msgstr "" "SET ENABLE_SEQSCAN TO OFF;????????????????" "PostgreSQL???????????????????????????????" -"??????????????????????????????????" -"postgresql.conf????RANDOM_PAGE_COST??????" -"???????SET RANDOM_PAGE_COST TO 1.1;????" -"?RANDOM_PAGE_COST????????4.0???1.1 (SSD???)" -"???2.0 (???????????)????????????????????" +"??????????????????????????????????" +"RANDOM_PAGE_COST (postgresql.conf??????)????" +"????????????SET RANDOM_PAGE_COST TO 1.1;???" +"??RANDOM_PAGE_COST????????4.0???1.1 (SSD??" +"?)???2.0 (???????????)????????????????????" "?????????????????????????" #. Tag: para ----------------------------------------------------------------------- Summary of changes: doc/po/ja/postgis-manual.po | 54 ++++++++++++++++++++++----------------------- 1 file changed, 27 insertions(+), 27 deletions(-) hooks/post-receive -- PostGIS From git at osgeo.org Wed Mar 4 03:51:26 2026 From: git at osgeo.org (git at osgeo.org) Date: Wed, 4 Mar 2026 03:51:26 -0800 (PST) Subject: [SCM] PostGIS branch master updated. 3.6.0rc2-350-gf0af9121d Message-ID: <20260304115127.62BAE16DC3A@trac.osgeo.org> 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 f0af9121d32fc84d7fc4bcb4db79f26e7abfd74c (commit) from 3490b7ff1cb2ea50504425d13e9d9e144f598098 (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 f0af9121d32fc84d7fc4bcb4db79f26e7abfd74c Author: Teramoto Ikuhiro Date: Wed Mar 4 09:58:43 2026 +0000 Translated PostGIS Manual using Weblate (Japanese) Currently translated at 99.7% (5879 of 5893 strings) Translation: postgis/PostGIS Manual Translate-URL: https://weblate.osgeo.org/projects/postgis/postgis-manual/ja/ diff --git a/doc/po/ja/postgis-manual.po b/doc/po/ja/postgis-manual.po index 1f5486de5..c44a91f76 100644 --- a/doc/po/ja/postgis-manual.po +++ b/doc/po/ja/postgis-manual.po @@ -10,7 +10,7 @@ msgstr "" "Project-Id-Version: postgis 3.5\n" "Report-Msgid-Bugs-To: https://bugs.kde.org\n" "POT-Creation-Date: 2025-11-13 16:23+0000\n" -"PO-Revision-Date: 2026-03-04 01:51+0000\n" +"PO-Revision-Date: 2026-03-04 11:51+0000\n" "Last-Translator: Teramoto Ikuhiro \n" "Language-Team: Japanese \n" @@ -7597,9 +7597,9 @@ msgid "" msgstr "" "GML3????TopoGeometry?GML????????nsprefix_in?" "?????????????gml??????????????" -"?????nsprefix????????????? (??????15)?options (?" -"?????1)???????????????????????ST_AsGML?????" -"?????" +"?????nsprefix????????????? (??????15)?options " +"(??????1)?????????????????????????ST_AsGML??" +"????????" #. Tag: para #, no-c-format @@ -7614,9 +7614,9 @@ msgid "" "be created automatically by adding a unique constraint to the fields. " "Example:" msgstr "" -"visitedTable???????????????????????" -"??????????????????????????????????????" -"?? (xlink:xref)??????????? ???????" +"visitedTable??????????????????????" +"??????????????????????????????????????" +"????? (xlink:xref)??????????? ???????" "?'element_type'?'element_id'???????????????????????" "??????????????????????????????????????" "????? element_type?element_id??" @@ -7629,8 +7629,8 @@ msgid "" "The idprefix parameter, if given, will be prepended to " "Edge and Node tag identifiers." msgstr "" -"idprefix????????????????Edge??????" -"Node?????????????" +"idprefix??????????????????Edge?????" +"?Node?????????????" #. Tag: para #, no-c-format @@ -7638,7 +7638,7 @@ msgid "" "The gmlver parameter, if given, will be passed to the " "underlying ST_AsGML. Defaults to 3." msgstr "" -"gmlver???????????????????????" +"gmlver?????????????????????????" "ST_AsGML?????????????3???" #. Tag: para @@ -7684,9 +7684,9 @@ msgid "" "\"serial\" and an \"edge_id\" of type integer; the code will query the table " "for \"edge_id\" so it is recommended to add an index on that field." msgstr "" -"??????????????????\"serial\"??\"arc_id\"????????" -"\"edge_id\"????????????????????????\"edge_id\"???" -"?????????????????????????????????" +"??????????????????\"serial\"??\"arc_id\"???????" +"?\"edge_id\"????????????????????????\"edge_id\"??" +"???????????????????????????????????" #. Tag: para #, no-c-format @@ -10045,10 +10045,11 @@ msgid "" "integration and alignment with GEOS releases, alignment of PostGIS with " "PostgreSQL releases, loader/dumper, and Shapefile GUI loader." msgstr "" -"PostGIS???????????????????????????????????" -"?????????????????? (2??,?3???n???????????" -"????????)???????????GEOS??????GEOS?????????" -"PostgreSQL?????????????/????????????GUI????" +"PostGIS????????????????????????????????" +"????????????????????? (2??,?3???n????????" +"?????????????)???????????GEOS??????GEOS????" +"?????PostgreSQL?????????????/????????????GUI" +"????" #. Tag: term #, no-c-format @@ -10266,8 +10267,8 @@ msgid "" "The original developer/Co-founder of PostGIS. Dave wrote the server side " "objects, index bindings, and many of the server side analytical functions." msgstr "" -"PostGIS?????????/?????????????????????????" -"??????????????????????????" +"PostGIS?????????/?????????????????????????" +"???????????????????????????" #. Tag: term #, no-c-format @@ -11632,10 +11633,11 @@ msgid "" "PostGIS includes support for GiST-based R-Tree spatial indexes, and " "functions for analysis and processing of GIS objects." msgstr "" -"PostGIS????????RDB???PostgreSQL?????GIS (????????)??????????" -"?????????PostGIS??GiST????R???????????????GIS?" -"????????????????????????" +"PostGIS????????RDB???PostgreSQL?????GIS (????????)" +"???????????????????PostGIS??GiST????R???" +"?????????????GIS????????????????????????" +"?" #. Tag: para #, no-c-format @@ -11835,7 +11837,7 @@ msgstr "&list_3d_functions;" msgid "" "The functions given below are PostGIS functions that do not throw away the Z-" "Index." -msgstr "????????Z????????????PostGIS?????" +msgstr "????????Z?????????????PostGIS?????" #. Tag: title #, no-c-format @@ -12856,8 +12858,8 @@ msgid "" "Index is 1-based as for OGC specs since version 0.8.0. Previous versions " "implemented this as 0-based instead." msgstr "" -"OGC?????0.8.0?????????1???????????????????0" -"???????????" +"OGC?????0.8.0??????????1???????????????????" +"0???????????" #. Tag: para #, no-c-format @@ -13568,7 +13570,7 @@ msgstr "" #. Tag: para #, no-c-format msgid "Index is 1-based." -msgstr "??????1??????" +msgstr "???????1??????" #. Tag: para #, no-c-format @@ -16331,10 +16333,10 @@ msgid "" "narrower gaps will also be returned as invalid." msgstr "" "??????????????????????????????????????" -"?? (????????)??????????????????????????" -"?????????????????????????tolerance?????0????????????????????????????" -"??????????????????" +"?? (????????)???????????????????????????" +"????????????????????????tolerance???????0??????????????????????????" +"????????????????????" #. Tag: para #, no-c-format @@ -16552,7 +16554,8 @@ msgid "" "parameter to false." msgstr "" "?????????????? (???????????????)????????" -"???simplifyBoundary?????FALSE???????" +"???simplifyBoundary???????FALSE??????" +"?" #. Tag: para #, no-c-format @@ -18110,10 +18113,10 @@ msgid "" "useful in triggers when trying to maintain relationship of joints when one " "vertex moves." msgstr "" -"?????????N??????????????????????????0??" -"????????????????????????????-1?????????" -"??????????????????????????????????????" -"????????????????" +"?????????N???????????????????????????0?" +"?????????????????????????????-1????????" +"??????????????????????????????????????" +"?????????????????" #. Tag: para #, no-c-format @@ -19615,8 +19618,8 @@ msgid "" "Creates a geometry instance from a Well-Known Binary geometry representation " "(WKB) and optional SRID." msgstr "" -"Well-Knwon Binary??????? (WKB)????????SRID??????????" -"??????????" +"Well-Knwon Binary??????? (WKB)??????????SRID??" +"??????????????????" #. Tag: para #, no-c-format @@ -21104,8 +21107,8 @@ msgstr "" "?????????????????????????????????????" "??????????????????????????????????????" "????????????????geometry_columns?????" -"????????????????????????geometry_columns???????????????" +"??????????????????????????" +"geometry_columns???????????????" #. Tag: para #, no-c-format @@ -32306,8 +32309,8 @@ msgid "" "be separated by white space. Accepts inputs in GDAL or ESRI format. Default " "is GDAL." msgstr "" -"????6??????????????????????????GDAL???ESRI?" -"??????????????????GDAL???" +"????6????????????????????????????GDAL???" +"ESRI???????????????????GDAL???" #. Tag: para #, no-c-format @@ -32316,8 +32319,9 @@ msgid "" "in 'GDAL' or 'ESRI' format. Default is GDAL. If 6 coordinates are not " "provided will return null." msgstr "" -"????6??????????????'GDAL'???'ESRI'???????????" -"????????GDAL???6????????????????NULL??????" +"????6????????????????'GDAL'???'ESRI'?????????" +"??????????GDAL???6??????????????????NULL???" +"???" #. Tag: para #, no-c-format @@ -32418,8 +32422,8 @@ msgid "" "Sets the georeference X and Y skew (or rotation parameter). If only one is " "passed in, sets X and Y to the same value." msgstr "" -"????????? (??????)?X??Y??????????????????" -"??X??Y?????????????" +"????????? (????????)?X??Y????????????????" +"????X??Y?????????????" #. Tag: para #, no-c-format @@ -32429,10 +32433,10 @@ msgid "" "href=\"http://en.wikipedia.org/wiki/World_file\">World File for more " "details." msgstr "" -"????????? (??????)?X??Y??????????????????" -"??X??Y????????????????????World File (???WikiPedia)???" -"????" +"????????? (????????)?X??Y????????????????" +"????X??Y????????????????????World File (?" +"??WikiPedia)???????" #. Tag: para #, no-c-format @@ -32704,9 +32708,9 @@ msgid "" "spelling), Bilinear, Cubic, CubicSpline or Lanczos resampling algorithm. " "Default is NearestNeighbor." msgstr "" -"??? (??????)????????????????????????????" -"?????????????????????? ('NearestNeighbor' (????" -"?))?????? ('Bilinear')?3??? ('Cubic')?3???????? " +"??? (????????)???????????????????????" +"??????????????????????????? ('NearestNeighbor' (?" +"????))?????? ('Bilinear')?3??? ('Cubic')?3???????? " "('CubicSpline')???????? ('Lanczos')?????????????????" "???" @@ -32719,9 +32723,9 @@ msgid "" "default is NearestNeighbor which is the fastest but results in the worst " "interpolation." msgstr "" -"???? (??????)???????????????????????????" -"??????????????????????? ('NearestNeighbor' (????" -"?))?????? ('Bilinear')?3??? ('Cubic')?3???????? " +"???? (????????)???????????????????????" +"??????????????????????????? ('NearestNeighbor' (?" +"????))?????? ('Bilinear')?3??? ('Cubic')?3???????? " "('CubicSpline')???????? ('Lanczos')?????????????????" "???????????????????" @@ -32837,7 +32841,7 @@ msgid "" "Use if you need more control over the " "grid parameters." msgstr "" -"??????????????????????????????" #. Tag: para @@ -33895,10 +33899,10 @@ msgid "" msgstr "" "options JPEG????????GDAL????????????" "? (?create_options???????)?" -"JPEG????????? PROGRESSIVE?'ON'???'OFF'??" -"QUALITY?0??100???? (??????75)????????" -"?? GDAL Raster " -"format options???????" +"JPEG??????????? PROGRESSIVE?'ON'???'OFF'?" +"?QUALITY?0??100???? (??????75)???????" +"??? GDAL " +"Raster format options???????" #. Tag: title #, no-c-format @@ -33980,11 +33984,11 @@ msgid "" msgstr "" "options PNG????????GDAL????????????? " "(?create_options???????)?PNG?" -"????????ZLEVEL (???????????????????6)???" -"ARRAY['ZLEVEL=9']?????????????????????????????" -"???????????PNG????????????????GDAL Raster format options???????" +"??????????ZLEVEL (???????????????????6)???" +"ARRAY['ZLEVEL=9']??????????????????????????????" +"??????????PNG????????????????GDAL Raster format " +"options???????" #. Tag: para #, no-c-format @@ -39994,8 +39998,8 @@ msgid "" "This function call includes a bounding box comparison that makes use of any " "indexes that are available on the geometries." msgstr "" -"??????????????????????????????????????" -"??????????????????????" +"????????????????????????????????????" +"?????????????????????????" #. Tag: para #, no-c-format @@ -42159,8 +42163,8 @@ msgid "" "If using more than one transformation, it is useful to have a functional " "index on the commonly used transformations to take advantage of index usage." msgstr "" -"??????????????????????????????????????" -"?????????????????" +"??????????????????????????????????????" +"???????????????????" #. Tag: para #, no-c-format @@ -42187,9 +42191,9 @@ msgid "" "that leaves out null geometries which will both conserve space and make your " "index smaller and more efficient." msgstr "" -"??????????????????????????????????????" -"?????????????????????????????????????" -"NULL???????????????????????????" +"??????????????????????????????????????" +"??????????????????????????????????????" +"?NULL????????????????????????????" #. Tag: para #, no-c-format @@ -42763,7 +42767,7 @@ msgstr "" msgid "" "Enhanced: 2.0.0 additional parameters for specifying the origin of rotation " "were added." -msgstr "Enhanced: 2.0.0 ??????????????????????" +msgstr "Enhanced: 2.0.0 ????????????????????????" #. Tag: para #, no-c-format @@ -43052,13 +43056,13 @@ msgid "" "automatic conversion of a function argument to a type supported by the " "function." msgstr "" -"????????????????????????????????????????????????" -"?????????????PostgreSQL????????????????????" -"???????????????????????????????????????????????????????????" -"??????????????????????????" +"????????????????????????????????????????" +"?????????????????????PostgreSQL????????????" +"?????????????????????????????????????" +"?????????????????????" +"????????????????????????????????????" #. Tag: para #, no-c-format @@ -45325,8 +45329,8 @@ msgid "" "indexes, and spatial operators to use them. See and for details." msgstr "" -"???????????????????PostGIS????????????????" -"????????????????????????" #. Tag: title @@ -46753,7 +46757,7 @@ msgstr "" #. Tag: title #, no-c-format msgid "User-Defined Spatial Reference Systems" -msgstr "??????????" +msgstr "???????????" #. Tag: para #, no-c-format @@ -47192,10 +47196,10 @@ msgid "" "for one-off non-scripted loading or if you are new to PostGIS. It can also " "be configured as a plugin to PgAdminIII." msgstr "" -"???????????????????shp2pgsql-gui??" -"??????????????????????????????????????" -"?????????1????????????PostGIS?????????????" -"??????????PgAdminIII?????????????????" +"????????????????????shp2pgsql-gui?" +"????????????????????????????????????" +"????????????1????????????PostGIS??????????" +"?????????????PgAdminIII?????????????????" #. Tag: term #, no-c-format @@ -47612,7 +47616,7 @@ msgstr "????????????????????" #. Tag: para #, no-c-format msgid "The username to use when connecting to the database." -msgstr "??????????????????" +msgstr "???????????????????" #. Tag: para #, no-c-format @@ -49246,8 +49250,9 @@ msgid "" "will be created in the default schema of the database or user you are " "connecting with." msgstr "" -"??????????????????????????????????????" -"???????????????????????????????????" +"?????????????????????????????????" +"??????????????????????????????????????" +"???" #. Tag: para #, no-c-format @@ -49376,7 +49381,7 @@ msgid "" "index, separate with comma (,). If unspecified, all bands of raster will be " "extracted." msgstr "" -"?????????????????? (1???)?1?????????????" +"??????????????????? (1???)?1?????????????" "?????(,)?????????????????????????????" #. Tag: para @@ -49466,7 +49471,7 @@ msgstr "PostgreSQL?????????????" #. Tag: para #, no-c-format msgid "Create a GiST index on the raster column." -msgstr "???????GiST????????????" +msgstr "???????GiST?????????????" #. Tag: para #, no-c-format @@ -49492,8 +49497,8 @@ msgid "" "also used." msgstr "" "?????????????????????????-X????????????" -"??????? (??????)????????????????????????" -"???????" +"???????? (??????)???????????????????????" +"????????" #. Tag: para #, no-c-format @@ -49501,8 +49506,8 @@ msgid "" "Specify the tablespace for the table's new index. This applies to the " "primary key and the spatial index if the -I flag is used." msgstr "" -"??????????????????????????????????????-" -"I?????????????????????????????" +"??????????????????????????????????????" +"?-I??????????????????????????????" #. Tag: para #, no-c-format @@ -49602,8 +49607,8 @@ msgid "" "Once you are done populating your table initially, you'll want to create a " "spatial index on the raster column with something like:" msgstr "" -"??????????????????????????????????????" -"??????:" +"??????????????????????????????????????" +"???????:" #. Tag: para #, no-c-format @@ -49622,8 +49627,8 @@ msgid "" "those and replace with convex hull based index." msgstr "" "2.0???? PostGIS ????????????????????????????" -"??????????????????????????????????????" -"??????????????????????????" +"??????????????????????????????????" +"?????????????????????????????????" #. Tag: para #, no-c-format @@ -49989,8 +49994,8 @@ msgid "" "spatial_index A boolean that is true if raster column has " "a spatial index." msgstr "" -"spatial_index ??????????????????????" -"????" +"spatial_index ??????????????????????" +"?????" #. Tag: title #, no-c-format @@ -50230,11 +50235,11 @@ msgid "" "specified projection using , and then " "outputs the results as a png using ." msgstr "" -"?????????? ????WGS84?????????????????????" -"??????? ???????????????" -"?????????????????????" -"?????????PNG????????????" -"????????????????????" +"?????????? ????WGS84????????????????????" +"???????? ??????????????" +"?????????????????????" +"???????????PNG??????????" +"??????????????????????" #. Tag: para #, no-c-format ----------------------------------------------------------------------- Summary of changes: doc/po/ja/postgis-manual.po | 221 ++++++++++++++++++++++---------------------- 1 file changed, 113 insertions(+), 108 deletions(-) hooks/post-receive -- PostGIS From git at osgeo.org Wed Mar 4 12:02:01 2026 From: git at osgeo.org (git at osgeo.org) Date: Wed, 4 Mar 2026 12:02:01 -0800 (PST) Subject: [SCM] PostGIS branch master updated. 3.6.0rc2-351-gab39a258b Message-ID: <20260304200202.02A8C16F5DD@trac.osgeo.org> 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 ab39a258bf1f6ec872452b313564d34ea5805a4c (commit) from f0af9121d32fc84d7fc4bcb4db79f26e7abfd74c (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 ab39a258bf1f6ec872452b313564d34ea5805a4c Author: Darafei Praliaskouski Date: Wed Mar 4 23:57:21 2026 +0400 fuzzers: centralize OSS-Fuzz build flow in PostGIS Move OSS-Fuzz project logic into PostGIS-owned scripts so oss-fuzz keeps only thin wrappers. Highlights: - add fuzzers/build_oss_fuzz.sh as the single OSS-Fuzz entrypoint - add fuzzers/install_oss_fuzz_build_deps.sh for builder image apt dependencies - make build_google_oss_fuzzers.sh use portable link flags (pkg-config/geos-config) - fold runtime .so packaging/RPATH setup into build_google_oss_fuzzers.sh - prefer provided CXX over pg_config --cc for Wagyu/FlatGeobuf checks - rename fuzzers/README.TXT to README.md and refresh docs/issue links - document the change in NEWS diff --git a/NEWS b/NEWS index eac939a70..6ed876e0c 100644 --- a/NEWS +++ b/NEWS @@ -41,6 +41,10 @@ This version requires GEOS 3.10 or higher - #5593, Docs: render manual images with GraphicsMagick without temporary files, enabling parallel builds, keeping ImageMagick fallbacks working, and documenting the generator workflow for contributors (Darafei Praliaskouski) + - [fuzzers] Centralize OSS-Fuzz build/dependency logic in PostGIS scripts, + prefer requested CXX over pg_config --cc for internal C++ checks, and + make fuzzer linking/runtime dependency packaging portable + (Darafei Praliaskouski) - GH-848, CG_AlphaShape now returns a MultiPolygon (Jean Felder) PostGIS 3.6.0 @@ -3061,5 +3065,3 @@ PostGIS 0.1 - truely_inside() - rtree index support functions - gist index support functions - - diff --git a/configure.ac b/configure.ac index 6a01d656f..d5fb6cc1b 100644 --- a/configure.ac +++ b/configure.ac @@ -1774,7 +1774,7 @@ if test "x$HAVE_PROTOBUF" = "xyes"; then AC_SUBST([WAGYU_LIB]) dnl ============================================================ - dnl We force to use the same compiler as Postgresql + dnl Prefer user/toolchain CXX, falling back to PostgreSQL compiler when needed. dnl ============================================================ CXX_SAVE="$CXX" CC_SAVE="$CC" @@ -1784,7 +1784,13 @@ if test "x$HAVE_PROTOBUF" = "xyes"; then LDFLAGS_SAVE="$LDFLAGS" LIBS_SAVE="$LIBS" - WAGYU_CXX=`"$PG_CONFIG" --cc` + dnl Prefer the requested C++ toolchain when provided (for example by OSS-Fuzz), + dnl and only fall back to PostgreSQL's compiler when CXX is unset. + if test "x$CXX_SAVE" != "x"; then + WAGYU_CXX="$CXX_SAVE" + else + WAGYU_CXX=`"$PG_CONFIG" --cc` + fi CPPFLAGS="-x c++" CFLAGS="" LDFLAGS="" @@ -1847,7 +1853,7 @@ FLATGEOBUF_LIB=libflatgeobuf.la AC_SUBST([FLATGEOBUF_LIB]) dnl ============================================================ -dnl We force to use the same compiler as Postgresql +dnl Prefer user/toolchain CXX, falling back to PostgreSQL compiler when needed. dnl ============================================================ CXX_SAVE="$CXX" CC_SAVE="$CC" @@ -1857,7 +1863,11 @@ CPPFLAGS_SAVE="$CPPFLAGS" LDFLAGS_SAVE="$LDFLAGS" LIBS_SAVE="$LIBS" -FLATGEOBUF_CXX=`"$PG_CONFIG" --cc` +if test "x$CXX_SAVE" != "x"; then + FLATGEOBUF_CXX="$CXX_SAVE" +else + FLATGEOBUF_CXX=`"$PG_CONFIG" --cc` +fi CPPFLAGS="-x c++" CFLAGS="" LDFLAGS="" diff --git a/fuzzers/README.TXT b/fuzzers/README.TXT deleted file mode 100644 index df858ea2d..000000000 --- a/fuzzers/README.TXT +++ /dev/null @@ -1,38 +0,0 @@ -This directory contains fuzzer main functions and scripts for the -Google OSS Fuzz project: https://github.com/google/oss-fuzz/ - -The main build scripts are in: -https://github.com/google/oss-fuzz/tree/master/projects/postgis -and call scripts in this directory. - -The list of issues is in: -https://bugs.chromium.org/p/oss-fuzz/issues/list?q=postgis - -- Simulate the build of (dummy) fuzzers like OSS Fuzz does: - $ make dummyfuzzers - They are created in /tmp/*_fuzzer as well as with the - /tmp/*_fuzzer_seed_corpus.zip files - - Run one: - $ /tmp/wkt_import_fuzzer a_file_name - -- Run locally OSS Fuzz: - $ git clone --depth=1 https://github.com/google/oss-fuzz.git - $ cd oss-fuzz - $ python infra/helper.py build_image postgis - - Build fuzzers with the address sanitizer (could use undefined, etc...) - $ python infra/helper.py build_fuzzers --sanitizer address postgis - - Test a particular fuzzer (replace wkt_import_fuzzer by other fuzzers - like the ones generated in /tmp by "make dummyfuzzers") - $ python infra/helper.py run_fuzzer postgis wkt_import_fuzzer - - -How to deal with issues reported in https://bugs.chromium.org/p/oss-fuzz/issues/list?q=postgis ? - - 1. Leave a comment in (chromium database) bug entry to indicate that you work on it - 2. Work - 3. Commit a bug fix with log including "Credit to OSS-Fuzz" and a link to the bugs.chromium.org ticket - 4. Add in the bugs.chromium.org ticket a link to the Trac changeset implementing the fix. - 5. Check chromium closed the bug (after one or two days typically) diff --git a/fuzzers/README.md b/fuzzers/README.md new file mode 100644 index 000000000..0c167e4f3 --- /dev/null +++ b/fuzzers/README.md @@ -0,0 +1,64 @@ +# PostGIS Fuzzers + +This directory contains fuzzer entry points and helper scripts for the +[Google OSS-Fuzz project](https://github.com/google/oss-fuzz/). + +## OSS-Fuzz Build Entrypoint + +The main OSS-Fuzz build orchestration lives in: + +- `./fuzzers/build_oss_fuzz.sh` + +The wrapper in +[`oss-fuzz/projects/postgis`](https://github.com/google/oss-fuzz/tree/master/projects/postgis) +should call this script. + +## OSS-Fuzz Image Dependencies + +The package list for the OSS-Fuzz builder image lives in: + +- `./fuzzers/install_oss_fuzz_build_deps.sh` + +The `oss-fuzz` project `Dockerfile` should call this script during image build. + +## Issues + +- [PostGIS OSS-Fuzz issue list](https://issues.oss-fuzz.com/issues?q=postgis) + +## Local Workflow + +### Simulate Dummy Fuzzer Build + +```bash +make dummyfuzzers +``` + +Artifacts are created in `/tmp`: + +- `/tmp/*_fuzzer` +- `/tmp/*_fuzzer_seed_corpus.zip` +- Runtime shared libraries in `/tmp/lib` (when available) + +Run one fuzzer locally: + +```bash +/tmp/wkt_import_fuzzer a_file_name +``` + +### Run OSS-Fuzz Locally + +```bash +git clone --depth=1 https://github.com/google/oss-fuzz.git +cd oss-fuzz +python infra/helper.py build_image postgis +python infra/helper.py build_fuzzers --sanitizer address postgis +python infra/helper.py run_fuzzer postgis wkt_import_fuzzer +``` + +## Handling Reported OSS-Fuzz Issues + +1. Leave a comment in the bug entry to indicate that you are working on it. +2. Implement the fix. +3. Commit with a message including `Credit to OSS-Fuzz` and a link to the OSS-Fuzz ticket. +4. Add a link to the implementing changeset/commit in the OSS-Fuzz ticket. +5. Verify OSS-Fuzz closes the bug (usually within a day or two). diff --git a/fuzzers/build_google_oss_fuzzers.sh b/fuzzers/build_google_oss_fuzzers.sh index cca450323..4f1435c24 100755 --- a/fuzzers/build_google_oss_fuzzers.sh +++ b/fuzzers/build_google_oss_fuzzers.sh @@ -18,6 +18,11 @@ if [ "$CXX" == "" ]; then fi SRC_DIR=$(dirname $0)/.. +JSON_C_LIBS=$(pkg-config --libs json-c) +GEOS_LIBS=$(geos-config --clibs) +PROJ_XML2_LIBS=$(pkg-config --libs proj libxml-2.0) +POSTGIS_FUZZER_LIBS="$JSON_C_LIBS $GEOS_LIBS $PROJ_XML2_LIBS" +POSTGIS_PACKAGE_RUNTIME_LIBS="${POSTGIS_PACKAGE_RUNTIME_LIBS:-1}" build_fuzzer() { @@ -28,7 +33,37 @@ build_fuzzer() echo "Building fuzzer $fuzzerName" $CXX $CXXFLAGS -std=c++11 -I$SRC_DIR/liblwgeom \ $sourceFilename $* -o $OUT/$fuzzerName \ - -lFuzzingEngine -lstdc++ $SRC_DIR/liblwgeom/.libs/liblwgeom.a /usr/lib/x86_64-linux-gnu/libjson-c.a + -lFuzzingEngine -lstdc++ $SRC_DIR/liblwgeom/.libs/liblwgeom.a $POSTGIS_FUZZER_LIBS +} + +package_runtime_libs() +{ + mkdir -p "$OUT/lib" + + for fuzzer in "$OUT"/*_fuzzer; do + [ -f "$fuzzer" ] || continue + + if command -v patchelf >/dev/null 2>&1; then + patchelf --set-rpath '$ORIGIN/lib' "$fuzzer" + fi + + while read -r lib; do + [ -f "$lib" ] || continue + + base="$(basename "$lib")" + case "$base" in + libc.so.*|libm.so.*|libdl.so.*|libpthread.so.*|librt.so.*|libgcc_s.so.*|ld-linux*.so.*|linux-vdso.so.*|libresolv.so.*) + continue + ;; + esac + + cp -n "$lib" "$OUT/lib/" || true + done < <(ldd "$fuzzer" | awk '/=> \// {print $3}') + done + + if command -v patchelf >/dev/null 2>&1; then + patchelf --set-rpath '$ORIGIN' "$OUT"/lib/*.so* 2>/dev/null || true + fi } fuzzerFiles=$(dirname $0)/*.cpp @@ -38,3 +73,7 @@ for F in $fuzzerFiles; do done cp $(dirname $0)/*.dict $(dirname $0)/*.options $(dirname $0)/*.zip $OUT/ + +if [ "$POSTGIS_PACKAGE_RUNTIME_LIBS" != "0" ]; then + package_runtime_libs +fi diff --git a/fuzzers/build_oss_fuzz.sh b/fuzzers/build_oss_fuzz.sh new file mode 100755 index 000000000..5b65ddcda --- /dev/null +++ b/fuzzers/build_oss_fuzz.sh @@ -0,0 +1,45 @@ +#!/usr/bin/env bash + +set -e + +if [ "$CC" == "" ]; then + echo "CC env var not defined" + exit 1 +fi + +if [ "$CXX" == "" ]; then + echo "CXX env var not defined" + exit 1 +fi + +if [ "$OUT" == "" ]; then + echo "OUT env var not defined" + exit 1 +fi + +FUZZERS_DIR=$(cd "$(dirname "$0")" && pwd) +SRC_DIR=$(dirname "$FUZZERS_DIR") +mkdir -p "$OUT" + +if [ "$SRC" == "" ]; then + export SRC="$SRC_DIR" +fi + +export CXXFLAGS="$CXXFLAGS -std=c++11" +POSTGIS_OSS_FUZZ_CONFIGURE_FLAGS=( + --enable-static + --without-raster + --without-protobuf + --enable-debug +) + +cd "$SRC_DIR" +./autogen.sh +./configure CC="$CC" CXX="$CXX" "${POSTGIS_OSS_FUZZ_CONFIGURE_FLAGS[@]}" +cd liblwgeom +make clean -s +make -j"$(nproc)" -s +cd .. + +bash ./fuzzers/build_google_oss_fuzzers.sh +bash ./fuzzers/build_seed_corpus.sh diff --git a/fuzzers/install_oss_fuzz_build_deps.sh b/fuzzers/install_oss_fuzz_build_deps.sh new file mode 100755 index 000000000..992d20369 --- /dev/null +++ b/fuzzers/install_oss_fuzz_build_deps.sh @@ -0,0 +1,23 @@ +#!/usr/bin/env bash + +set -e + +if ! command -v apt-get >/dev/null 2>&1; then + echo "apt-get not found" + exit 1 +fi + +if [ "$(id -u)" -ne 0 ]; then + echo "This script must run as root inside the OSS-Fuzz builder image" + exit 1 +fi + +export DEBIAN_FRONTEND="${DEBIAN_FRONTEND:-noninteractive}" + +apt-get update +apt-get install -y --no-install-recommends \ + make autoconf automake libtool g++ postgresql-server-dev-all \ + libgeos-dev libproj-dev libxml2-dev pkg-config libjson-c-dev \ + libc++-dev libc++abi-dev patchelf + +rm -rf /var/lib/apt/lists/* ----------------------------------------------------------------------- Summary of changes: NEWS | 6 ++-- configure.ac | 18 +++++++--- fuzzers/README.TXT | 38 -------------------- fuzzers/README.md | 64 ++++++++++++++++++++++++++++++++++ fuzzers/build_google_oss_fuzzers.sh | 41 +++++++++++++++++++++- fuzzers/build_oss_fuzz.sh | 45 ++++++++++++++++++++++++ fuzzers/install_oss_fuzz_build_deps.sh | 23 ++++++++++++ 7 files changed, 190 insertions(+), 45 deletions(-) delete mode 100644 fuzzers/README.TXT create mode 100644 fuzzers/README.md create mode 100755 fuzzers/build_oss_fuzz.sh create mode 100755 fuzzers/install_oss_fuzz_build_deps.sh hooks/post-receive -- PostGIS From git at osgeo.org Wed Mar 4 17:51:22 2026 From: git at osgeo.org (git at osgeo.org) Date: Wed, 4 Mar 2026 17:51:22 -0800 (PST) Subject: [SCM] PostGIS branch master updated. 3.6.0rc2-352-g13cacae51 Message-ID: <20260305015123.1C6C818881B@trac.osgeo.org> 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 13cacae51bf7d39ecb714543bbde04d54c1366ac (commit) from ab39a258bf1f6ec872452b313564d34ea5805a4c (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 13cacae51bf7d39ecb714543bbde04d54c1366ac Author: Teramoto Ikuhiro Date: Thu Mar 5 00:04:19 2026 +0000 Translated PostGIS Manual using Weblate (Japanese) Currently translated at 99.8% (5886 of 5893 strings) Translation: postgis/PostGIS Manual Translate-URL: https://weblate.osgeo.org/projects/postgis/postgis-manual/ja/ diff --git a/doc/po/ja/postgis-manual.po b/doc/po/ja/postgis-manual.po index c44a91f76..b512408b0 100644 --- a/doc/po/ja/postgis-manual.po +++ b/doc/po/ja/postgis-manual.po @@ -10,7 +10,7 @@ msgstr "" "Project-Id-Version: postgis 3.5\n" "Report-Msgid-Bugs-To: https://bugs.kde.org\n" "POT-Creation-Date: 2025-11-13 16:23+0000\n" -"PO-Revision-Date: 2026-03-04 11:51+0000\n" +"PO-Revision-Date: 2026-03-05 01:51+0000\n" "Last-Translator: Teramoto Ikuhiro \n" "Language-Team: Japanese \n" @@ -1715,49 +1715,49 @@ msgid "(token number 0): Unparsed building identifiers and types." msgstr "(?????? 0): ??????????????????" #. Tag: para -#, fuzzy, no-c-format +#, no-c-format msgid "" "(token number 14): The BOX " "in BOX 3B" msgstr "" -"(?????? 14): BOX 3B?? BOX???????" +"(?????? 14): BOX???" +"????????????BOX 3B????????" #. Tag: para -#, fuzzy, no-c-format +#, no-c-format msgid "" "(token number 15): The 3B in " "BOX 3B" msgstr "" -"(?????? 15): BOX 3B??3B???????" +"(?????? 15): 3B????" +"???????????BOX 3B????????" #. Tag: para -#, fuzzy, no-c-format +#, no-c-format msgid "" "(token number 8): The RR in " "RR 7" msgstr "" -"(?????? 8): RR 7??" -"RR???????" +"(?????? 8): RR????" +"???????????RR 7????????" #. Tag: para -#, fuzzy, no-c-format +#, no-c-format msgid "" "(token number 16): The APT " "in APT 3B" msgstr "" -"(?????? 16): APT 3B??APT???????" +"(?????? 16): APT???" +"????????????APT 3B????????" #. Tag: para -#, fuzzy, no-c-format +#, no-c-format msgid "" "(token number 17): The 3B in " "APT 3B" msgstr "" -"(??????17): APT 3B??3B???????" +"(??????17): 3B????" +"???????????APT 3B????????" #. Tag: para #, no-c-format @@ -2037,7 +2037,7 @@ msgid "Variant 1: Takes an address as a single line." msgstr "1?????: ??????????????" #. Tag: para -#, fuzzy, no-c-format +#, no-c-format msgid "" "Variant 2: Takes an address as 2 parts. A micro " "consisting of standard first line of postal address e.g. house_num " @@ -2045,9 +2045,9 @@ msgid "" "address e.g city, state postal_code country." msgstr "" "2?????: ???????????????micro?" -"house_num street???????????????1?????" -"macro??city, state postal_code country???????" -"????????2?????" +"house_num street???????????????1?????macro?" +"?city, state postal_code country???????????????2" +"?????" #. Tag: para #, no-c-format @@ -9753,15 +9753,15 @@ msgstr "" "???????????????" #. Tag: para -#, fuzzy, no-c-format +#, no-c-format msgid "" "After the states you desire have been loaded, make sure to run the: " "SELECT install_missing_indexes(); as " "described in ." msgstr "" -"?????????????????" -"??????SELECT install_missing_indexes();??????????????" +"???????????????SELECT install_missing_indexes" +"();???????????????????????" #. Tag: para #, no-c-format ----------------------------------------------------------------------- Summary of changes: doc/po/ja/postgis-manual.po | 48 ++++++++++++++++++++++----------------------- 1 file changed, 24 insertions(+), 24 deletions(-) hooks/post-receive -- PostGIS From git at osgeo.org Thu Mar 5 01:38:16 2026 From: git at osgeo.org (git at osgeo.org) Date: Thu, 5 Mar 2026 01:38:16 -0800 (PST) Subject: [SCM] PostGIS branch master updated. 3.6.0rc2-353-g032bbd623 Message-ID: <20260305093816.3928618A20B@trac.osgeo.org> 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 032bbd6237c705c4c5a3bc53a5e366f62e6d88ab (commit) from 13cacae51bf7d39ecb714543bbde04d54c1366ac (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 032bbd6237c705c4c5a3bc53a5e366f62e6d88ab Author: Darafei Praliaskouski Date: Thu Mar 5 13:37:40 2026 +0400 CI: fix latest builds and improve regression failure logging diff --git a/.cirrus.yml b/.cirrus.yml index a7dcf094f..bb9728ac8 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -50,7 +50,29 @@ task: ccache -s test_script: - | - gmake ${MAKEJOBS} check RUNTESTFLAGS="-v --extension --dumprestore" || { service postgresql onestop; exit 1; } + show_regression_diffs() { + local tmpdir="${PGIS_REG_TMPDIR:-/tmp/pgis_reg}" + local found=0 + for f in "${tmpdir}"/*_diff; do + [ -f "${f}" ] || continue + if [ "${found}" -eq 0 ]; then + echo "---- BEGIN REGRESSION DIFFS (${tmpdir}) ----" + fi + found=1 + echo "---- ${f} ----" + cat "${f}" + done + if [ "${found}" -eq 0 ]; then + echo "No regression diff files found in ${tmpdir}" + else + echo "---- END REGRESSION DIFFS ----" + fi + } + gmake ${MAKEJOBS} check RUNTESTFLAGS="-v --extension --dumprestore" || { + show_regression_diffs + service postgresql onestop + exit 1 + } service postgresql onestop freebsd_instance: cpu: ${NCPU} @@ -85,6 +107,25 @@ task: test_script: - | + show_regression_diffs() { + local tmpdir="${PGIS_REG_TMPDIR:-/tmp/pgis_reg}" + local found=0 + for f in "${tmpdir}"/*_diff; do + [ -f "${f}" ] || continue + if [ "${found}" -eq 0 ]; then + echo "---- BEGIN REGRESSION DIFFS (${tmpdir}) ----" + fi + found=1 + echo "---- ${f} ----" + cat "${f}" + done + if [ "${found}" -eq 0 ]; then + echo "No regression diff files found in ${tmpdir}" + else + echo "---- END REGRESSION DIFFS ----" + fi + } + export PGCONFIG="${HOMEBREW_PREFIX}/opt/postgresql@${PG}/bin/pg_config" export CFLAGS="-I${HOMEBREW_PREFIX}/opt/gettext/include \ -I${HOMEBREW_PREFIX}/opt/postgresql@${PG}/include \ @@ -105,7 +146,11 @@ task: brew services start postgresql@${PG} make -j$(sysctl -n hw.logicalcpu) || { brew services stop postgresql@${PG}; exit 1; } - make -j$(sysctl -n hw.logicalcpu) check || { brew services stop postgresql@${PG}; exit 1; } + make -j$(sysctl -n hw.logicalcpu) check || { + show_regression_diffs + brew services stop postgresql@${PG} + exit 1 + } brew services stop postgresql@${PG} macos_cache: diff --git a/raster/rt_pg/rtpg_geometry.c b/raster/rt_pg/rtpg_geometry.c index a4059a8bc..5bfd62ad9 100644 --- a/raster/rt_pg/rtpg_geometry.c +++ b/raster/rt_pg/rtpg_geometry.c @@ -1572,9 +1572,8 @@ Datum RASTER_asRaster(PG_FUNCTION_ARGS) srs = NULL; /* determine number of bands */ - /* MIN macro is from GDAL's cpl_port.h */ - num_bands = MIN(pixtypes_len, values_len); - num_bands = MIN(num_bands, nodatavals_len); + num_bands = Min(pixtypes_len, values_len); + num_bands = Min(num_bands, nodatavals_len); POSTGIS_RT_DEBUGF(3, "RASTER_asRaster: pixtypes_len = %d", pixtypes_len); POSTGIS_RT_DEBUGF(3, "RASTER_asRaster: values_len = %d", values_len); POSTGIS_RT_DEBUGF(3, "RASTER_asRaster: nodatavals_len = %d", nodatavals_len); ----------------------------------------------------------------------- Summary of changes: .cirrus.yml | 49 ++++++++++++++++++++++++++++++++++++++++++-- raster/rt_pg/rtpg_geometry.c | 5 ++--- 2 files changed, 49 insertions(+), 5 deletions(-) hooks/post-receive -- PostGIS From git at osgeo.org Thu Mar 5 07:50:52 2026 From: git at osgeo.org (git at osgeo.org) Date: Thu, 5 Mar 2026 07:50:52 -0800 (PST) Subject: [SCM] PostGIS branch master updated. 3.6.0rc2-354-g163620225 Message-ID: <20260305155052.C83A018E187@trac.osgeo.org> 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 1636202258b8e3aa41784b57191400c7d4509f08 (commit) from 032bbd6237c705c4c5a3bc53a5e366f62e6d88ab (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 1636202258b8e3aa41784b57191400c7d4509f08 Author: Darafei Praliaskouski Date: Thu Mar 5 19:21:40 2026 +0400 CI: stabilize topology error locations and fix FreeBSD raster make race diff --git a/liblwgeom/topo/lwgeom_topo.c b/liblwgeom/topo/lwgeom_topo.c index ae60d2132..ba42f592c 100644 --- a/liblwgeom/topo/lwgeom_topo.c +++ b/liblwgeom/topo/lwgeom_topo.c @@ -37,17 +37,29 @@ #include +static bool +_lwt_describe_point(const LWPOINT *pt, char *buf, size_t bufsize) +{ + POINT2D p; + + if (!pt || !pt->point || !pt->point->npoints) + return false; + + getPoint2d_p(pt->point, 0, &p); + snprintf(buf, bufsize, " at POINT(%.15g %.15g)", p.x, p.y); + return true; +} + /* - * Report a human readable location along with topology errors so callers can - * narrow down robustness issues such as #5886/#5889 without further tracing. - * Using a point-on-surface keeps the message compact while remaining - * representative for any dimensionality of the offending intersection. + * Report a deterministic GEOS-derived location for topology errors. + * Normalize the intersection geometry so PointOnSurface is stable + * across operand-order and platform differences. */ static bool _lwt_describe_intersection_point(const GEOSGeometry *g1, const GEOSGeometry *g2, char *buf, size_t bufsize) { unsigned int n = 0; - POINT2D pt; + POINT2D p; GEOSGeometry *isect; GEOSGeometry *surface_pt; const GEOSCoordSequence *seq; @@ -56,6 +68,12 @@ _lwt_describe_intersection_point(const GEOSGeometry *g1, const GEOSGeometry *g2, if (!isect) return false; + if (GEOSNormalize(isect) != 0) + { + GEOSGeom_destroy(isect); + return false; + } + surface_pt = GEOSPointOnSurface(isect); GEOSGeom_destroy(isect); if (!surface_pt) @@ -74,26 +92,13 @@ _lwt_describe_intersection_point(const GEOSGeometry *g1, const GEOSGeometry *g2, return false; } - if (!GEOSCoordSeq_getX(seq, 0, &pt.x) || !GEOSCoordSeq_getY(seq, 0, &pt.y)) + if (!GEOSCoordSeq_getX(seq, 0, &p.x) || !GEOSCoordSeq_getY(seq, 0, &p.y)) { GEOSGeom_destroy(surface_pt); return false; } GEOSGeom_destroy(surface_pt); - snprintf(buf, bufsize, " at POINT(%.15g %.15g)", pt.x, pt.y); - return true; -} - -static bool -_lwt_describe_point(const LWPOINT *pt, char *buf, size_t bufsize) -{ - POINT2D p; - - if (!pt || !pt->point || !pt->point->npoints) - return false; - - getPoint2d_p(pt->point, 0, &p); snprintf(buf, bufsize, " at POINT(%.15g %.15g)", p.x, p.y); return true; } @@ -796,9 +801,10 @@ _lwt_CheckEdgeCrossing( LWT_TOPOLOGY* topo, match = GEOSRelatePatternMatch(relate, "1FFF*FFF2"); if ( match ) { char locinfo[128] = ""; - const char *locsuffix = match == 2 ? "" - : _lwt_describe_intersection_point(edgegg, eegg, locinfo, sizeof(locinfo)) ? locinfo - : ""; + const char *locsuffix = match == 2 ? "" + : _lwt_describe_intersection_point(edgegg, eegg, locinfo, sizeof(locinfo)) + ? locinfo + : ""; GEOSGeom_destroy(eegg); GEOSGeom_destroy(edgegg); _lwt_release_edges(edges, num_edges); @@ -817,9 +823,10 @@ _lwt_CheckEdgeCrossing( LWT_TOPOLOGY* topo, match = GEOSRelatePatternMatch(relate, "1********"); if ( match ) { char locinfo[128] = ""; - const char *locsuffix = match == 2 ? "" - : _lwt_describe_intersection_point(edgegg, eegg, locinfo, sizeof(locinfo)) ? locinfo - : ""; + const char *locsuffix = match == 2 ? "" + : _lwt_describe_intersection_point(edgegg, eegg, locinfo, sizeof(locinfo)) + ? locinfo + : ""; GEOSGeom_destroy(eegg); GEOSGeom_destroy(edgegg); _lwt_release_edges(edges, num_edges); @@ -838,9 +845,10 @@ _lwt_CheckEdgeCrossing( LWT_TOPOLOGY* topo, match = GEOSRelatePatternMatch(relate, "T********"); if ( match ) { char locinfo[128] = ""; - const char *locsuffix = match == 2 ? "" - : _lwt_describe_intersection_point(edgegg, eegg, locinfo, sizeof(locinfo)) ? locinfo - : ""; + const char *locsuffix = match == 2 ? "" + : _lwt_describe_intersection_point(edgegg, eegg, locinfo, sizeof(locinfo)) + ? locinfo + : ""; GEOSGeom_destroy(eegg); GEOSGeom_destroy(edgegg); _lwt_release_edges(edges, num_edges); @@ -860,9 +868,10 @@ _lwt_CheckEdgeCrossing( LWT_TOPOLOGY* topo, match = GEOSRelatePatternMatch(relate, "*T*******"); if ( match ) { char locinfo[128] = ""; - const char *locsuffix = match == 2 ? "" - : _lwt_describe_intersection_point(edgegg, eegg, locinfo, sizeof(locinfo)) ? locinfo - : ""; + const char *locsuffix = match == 2 ? "" + : _lwt_describe_intersection_point(edgegg, eegg, locinfo, sizeof(locinfo)) + ? locinfo + : ""; GEOSGeom_destroy(eegg); GEOSGeom_destroy(edgegg); _lwt_release_edges(edges, num_edges); @@ -883,9 +892,10 @@ _lwt_CheckEdgeCrossing( LWT_TOPOLOGY* topo, match = GEOSRelatePatternMatch(relate, "***T*****"); if ( match ) { char locinfo[128] = ""; - const char *locsuffix = match == 2 ? "" - : _lwt_describe_intersection_point(edgegg, eegg, locinfo, sizeof(locinfo)) ? locinfo - : ""; + const char *locsuffix = match == 2 ? "" + : _lwt_describe_intersection_point(edgegg, eegg, locinfo, sizeof(locinfo)) + ? locinfo + : ""; GEOSGeom_destroy(eegg); GEOSGeom_destroy(edgegg); _lwt_release_edges(edges, num_edges); diff --git a/topology/test/regress/st_addedgemodface_expected b/topology/test/regress/st_addedgemodface_expected index d55e6ce19..29aef17ce 100644 --- a/topology/test/regress/st_addedgemodface_expected +++ b/topology/test/regress/st_addedgemodface_expected @@ -8,7 +8,7 @@ ERROR: SQL/MM Spatial exception - curve not simple ERROR: Invalid edge (no two distinct vertices exist) ERROR: Invalid edge (no two distinct vertices exist) ERROR: SQL/MM Spatial exception - coincident edge 8 at POINT(35 22) -ERROR: SQL/MM Spatial exception - geometry crosses edge 5 at POINT(48.0714285714286 41.9285714285714) +ERROR: SQL/MM Spatial exception - geometry crosses edge 5 at POINT(57 33) ERROR: SQL/MM Spatial exception - geometry crosses edge 4 at POINT(45 32) ERROR: Spatial exception - geometry intersects edge 4 at POINT(36 38) L1 diff --git a/topology/test/regress/st_addedgenewfaces_expected b/topology/test/regress/st_addedgenewfaces_expected index bb2a7a572..df23f1044 100644 --- a/topology/test/regress/st_addedgenewfaces_expected +++ b/topology/test/regress/st_addedgenewfaces_expected @@ -8,7 +8,7 @@ ERROR: SQL/MM Spatial exception - curve not simple ERROR: Invalid edge (no two distinct vertices exist) ERROR: Invalid edge (no two distinct vertices exist) ERROR: SQL/MM Spatial exception - coincident edge 8 at POINT(35 22) -ERROR: SQL/MM Spatial exception - geometry crosses edge 5 at POINT(48.0714285714286 41.9285714285714) +ERROR: SQL/MM Spatial exception - geometry crosses edge 5 at POINT(57 33) ERROR: SQL/MM Spatial exception - geometry crosses edge 4 at POINT(45 32) ERROR: Spatial exception - geometry intersects edge 4 at POINT(36 38) L1 diff --git a/utils/Makefile.in b/utils/Makefile.in index 329bbd3b1..090bbedfd 100644 --- a/utils/Makefile.in +++ b/utils/Makefile.in @@ -68,7 +68,7 @@ $(top_builddir)/sfcgal/uninstall_sfcgal.sql: $(top_builddir)/raster/rt_pg/uninstall_rtpostgis.sql: $(MAKE) -C ../raster/rt_pg uninstall_rtpostgis.sql -$(top_builddir)/raster/rt_pg/rtpostgis_upgrade.sql: +$(top_builddir)/raster/rt_pg/rtpostgis_upgrade.sql: $(top_builddir)/raster/rt_pg/uninstall_rtpostgis.sql $(MAKE) -C ../raster/rt_pg rtpostgis_upgrade.sql $(top_builddir)/topology/topology_upgrade.sql: ----------------------------------------------------------------------- Summary of changes: liblwgeom/topo/lwgeom_topo.c | 78 +++++++++++++---------- topology/test/regress/st_addedgemodface_expected | 2 +- topology/test/regress/st_addedgenewfaces_expected | 2 +- utils/Makefile.in | 2 +- 4 files changed, 47 insertions(+), 37 deletions(-) hooks/post-receive -- PostGIS From git at osgeo.org Thu Mar 5 09:34:45 2026 From: git at osgeo.org (git at osgeo.org) Date: Thu, 5 Mar 2026 09:34:45 -0800 (PST) Subject: [SCM] PostGIS branch master updated. 3.6.0rc2-355-g04b9a7cb3 Message-ID: <20260305173445.EC76018E698@trac.osgeo.org> 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 04b9a7cb3a17edde9291944ad0d0e1ab1398d568 (commit) from 1636202258b8e3aa41784b57191400c7d4509f08 (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 04b9a7cb3a17edde9291944ad0d0e1ab1398d568 Author: Darafei Praliaskouski Date: Thu Mar 5 21:33:14 2026 +0400 Fix legacy symbol bindings for mingw clang CI diff --git a/postgis/legacy.sql.in b/postgis/legacy.sql.in index 9c90a154a..d67a7f00f 100644 --- a/postgis/legacy.sql.in +++ b/postgis/legacy.sql.in @@ -96,8 +96,8 @@ CREATE OR REPLACE FUNCTION SE_M(geometry) -- PostGIS equivalent function: locate_between_measures(geometry, float8, float8) CREATE OR REPLACE FUNCTION SE_LocateBetween(geometry, float8, float8) RETURNS geometry - AS 'MODULE_PATHNAME', 'LWGEOM_locate_between_m' - LANGUAGE 'c' IMMUTABLE STRICT; + AS $$ SELECT ST_LocateBetween($1, $2, $3, 0.0) $$ + LANGUAGE 'sql' IMMUTABLE STRICT; -- PostGIS equivalent function: locate_along_measure(geometry, float8) CREATE OR REPLACE FUNCTION SE_LocateAlong(geometry, float8) @@ -1248,8 +1248,8 @@ CREATE OR REPLACE FUNCTION LinestringFromWKB(bytea) -- Deprecation in 1.2.3 CREATE OR REPLACE FUNCTION locate_between_measures(geometry, float8, float8) RETURNS geometry - AS 'MODULE_PATHNAME', 'LWGEOM_locate_between_m' - LANGUAGE 'c' IMMUTABLE STRICT; + AS $$ SELECT ST_LocateBetween($1, $2, $3, 0.0) $$ + LANGUAGE 'sql' IMMUTABLE STRICT; -- Deprecation in 1.2.3 CREATE OR REPLACE FUNCTION M(geometry) diff --git a/postgis/lwgeom_geos.c b/postgis/lwgeom_geos.c index 989faabf7..9b1ef3e0f 100644 --- a/postgis/lwgeom_geos.c +++ b/postgis/lwgeom_geos.c @@ -741,17 +741,6 @@ Datum ST_Union(PG_FUNCTION_ARGS) PG_RETURN_POINTER(result); } -/* This is retained for backward ABI compatibility - * with PostGIS < 3.1.0 */ -PG_FUNCTION_INFO_V1(symdifference); -Datum symdifference(PG_FUNCTION_ARGS) -{ - PG_RETURN_DATUM(DirectFunctionCall2( - ST_SymDifference, - PG_GETARG_DATUM(0), PG_GETARG_DATUM(1) - )); -} - /** * @example symdifference {@link #symdifference} - SELECT ST_SymDifference( * 'POLYGON((0 0, 10 0, 10 10, 0 10, 0 0))', diff --git a/postgis/postgis_legacy.c b/postgis/postgis_legacy.c index 5a250c716..0856c5ba0 100644 --- a/postgis/postgis_legacy.c +++ b/postgis/postgis_legacy.c @@ -101,6 +101,7 @@ POSTGIS_DEPRECATE("3.1.0", postgis_sfcgal_noop) POSTGIS_DEPRECATE("3.1.0", LWGEOM_locate_between_m) POSTGIS_DEPRECATE("3.1.0", postgis_svn_version) +POSTGIS_DEPRECATE("3.1.0", symdifference) POSTGIS_DEPRECATE("3.3.0", pgis_geometry_union_finalfn) /**START: Removal of transactin lock feature **/ ----------------------------------------------------------------------- Summary of changes: postgis/legacy.sql.in | 8 ++++---- postgis/lwgeom_geos.c | 11 ----------- postgis/postgis_legacy.c | 1 + 3 files changed, 5 insertions(+), 15 deletions(-) hooks/post-receive -- PostGIS From git at osgeo.org Thu Mar 5 10:19:42 2026 From: git at osgeo.org (git at osgeo.org) Date: Thu, 5 Mar 2026 10:19:42 -0800 (PST) Subject: [SCM] PostGIS branch master updated. 3.6.0rc2-356-g8a31ce8c6 Message-ID: <20260305181943.147C518E92D@trac.osgeo.org> 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 8a31ce8c686766caacde19e8fa5977ed49a4068e (commit) from 04b9a7cb3a17edde9291944ad0d0e1ab1398d568 (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 8a31ce8c686766caacde19e8fa5977ed49a4068e Author: Darafei Praliaskouski Date: Thu Mar 5 22:18:25 2026 +0400 Fix mingw clang redeclaration errors in gserialized_estimate diff --git a/postgis/gserialized_estimate.c b/postgis/gserialized_estimate.c index 7f5e6d89c..15791f382 100644 --- a/postgis/gserialized_estimate.c +++ b/postgis/gserialized_estimate.c @@ -124,12 +124,9 @@ dimensionality cases. (2D geometry) &&& (3D column), etc. /************************************************************************/ - /* Prototypes */ -Datum gserialized_gist_joinsel(PG_FUNCTION_ARGS); Datum gserialized_gist_joinsel_2d(PG_FUNCTION_ARGS); Datum gserialized_gist_joinsel_nd(PG_FUNCTION_ARGS); -Datum gserialized_gist_sel(PG_FUNCTION_ARGS); Datum gserialized_gist_sel_2d(PG_FUNCTION_ARGS); Datum gserialized_gist_sel_nd(PG_FUNCTION_ARGS); Datum gserialized_analyze_nd(PG_FUNCTION_ARGS); @@ -1087,36 +1084,6 @@ estimate_join_selectivity(const ND_STATS *s1, const ND_STATS *s2) return selectivity; } -/** -* For (geometry &&& geometry) and (geography && geography) -* we call into the N-D mode. -*/ -PG_FUNCTION_INFO_V1(gserialized_gist_joinsel_nd); -Datum gserialized_gist_joinsel_nd(PG_FUNCTION_ARGS) -{ - PG_RETURN_DATUM(DirectFunctionCall5( - gserialized_gist_joinsel, - PG_GETARG_DATUM(0), PG_GETARG_DATUM(1), - PG_GETARG_DATUM(2), PG_GETARG_DATUM(3), - Int32GetDatum(0) /* ND mode */ - )); -} - -/** -* For (geometry && geometry) -* we call into the 2-D mode. -*/ -PG_FUNCTION_INFO_V1(gserialized_gist_joinsel_2d); -Datum gserialized_gist_joinsel_2d(PG_FUNCTION_ARGS) -{ - PG_RETURN_DATUM(DirectFunctionCall5( - gserialized_gist_joinsel, - PG_GETARG_DATUM(0), PG_GETARG_DATUM(1), - PG_GETARG_DATUM(2), PG_GETARG_DATUM(3), - Int32GetDatum(2) /* 2D mode */ - )); -} - double gserialized_joinsel_internal(PlannerInfo *root, List *args, JoinType jointype, int mode) { @@ -1201,6 +1168,40 @@ Datum gserialized_gist_joinsel(PG_FUNCTION_ARGS) PG_RETURN_FLOAT8(gserialized_joinsel_internal(root, args, jointype, mode)); } +/** + * For (geometry &&& geometry) and (geography && geography) + * we call into the N-D mode. + */ +PG_FUNCTION_INFO_V1(gserialized_gist_joinsel_nd); +Datum +gserialized_gist_joinsel_nd(PG_FUNCTION_ARGS) +{ + PG_RETURN_DATUM(DirectFunctionCall5(gserialized_gist_joinsel, + PG_GETARG_DATUM(0), + PG_GETARG_DATUM(1), + PG_GETARG_DATUM(2), + PG_GETARG_DATUM(3), + Int32GetDatum(0) /* ND mode */ + )); +} + +/** + * For (geometry && geometry) + * we call into the 2-D mode. + */ +PG_FUNCTION_INFO_V1(gserialized_gist_joinsel_2d); +Datum +gserialized_gist_joinsel_2d(PG_FUNCTION_ARGS) +{ + PG_RETURN_DATUM(DirectFunctionCall5(gserialized_gist_joinsel, + PG_GETARG_DATUM(0), + PG_GETARG_DATUM(1), + PG_GETARG_DATUM(2), + PG_GETARG_DATUM(3), + Int32GetDatum(2) /* 2D mode */ + )); +} + /** * The gserialized_analyze_nd sets this function as a * callback on the stats object when called by the ANALYZE @@ -2017,37 +2018,6 @@ Datum _postgis_gserialized_joinsel(PG_FUNCTION_ARGS) PG_RETURN_FLOAT8(selectivity); } -/** -* For (geometry && geometry) -* we call into the 2-D mode. -*/ -PG_FUNCTION_INFO_V1(gserialized_gist_sel_2d); -Datum gserialized_gist_sel_2d(PG_FUNCTION_ARGS) -{ - PG_RETURN_DATUM(DirectFunctionCall5( - gserialized_gist_sel, - PG_GETARG_DATUM(0), PG_GETARG_DATUM(1), - PG_GETARG_DATUM(2), PG_GETARG_DATUM(3), - Int32GetDatum(2) /* 2-D mode */ - )); -} - -/** -* For (geometry &&& geometry) and (geography && geography) -* we call into the N-D mode. -*/ -PG_FUNCTION_INFO_V1(gserialized_gist_sel_nd); -Datum gserialized_gist_sel_nd(PG_FUNCTION_ARGS) -{ - PG_RETURN_DATUM(DirectFunctionCall5( - gserialized_gist_sel, - PG_GETARG_DATUM(0), PG_GETARG_DATUM(1), - PG_GETARG_DATUM(2), PG_GETARG_DATUM(3), - Int32GetDatum(0) /* N-D mode */ - )); -} - - /** * This function should return an estimation of the number of * rows returned by a query involving an overlap check @@ -2132,6 +2102,40 @@ Datum gserialized_gist_sel(PG_FUNCTION_ARGS) PG_RETURN_FLOAT8(selectivity); } +/** + * For (geometry && geometry) + * we call into the 2-D mode. + */ +PG_FUNCTION_INFO_V1(gserialized_gist_sel_2d); +Datum +gserialized_gist_sel_2d(PG_FUNCTION_ARGS) +{ + PG_RETURN_DATUM(DirectFunctionCall5(gserialized_gist_sel, + PG_GETARG_DATUM(0), + PG_GETARG_DATUM(1), + PG_GETARG_DATUM(2), + PG_GETARG_DATUM(3), + Int32GetDatum(2) /* 2-D mode */ + )); +} + +/** + * For (geometry &&& geometry) and (geography && geography) + * we call into the N-D mode. + */ +PG_FUNCTION_INFO_V1(gserialized_gist_sel_nd); +Datum +gserialized_gist_sel_nd(PG_FUNCTION_ARGS) +{ + PG_RETURN_DATUM(DirectFunctionCall5(gserialized_gist_sel, + PG_GETARG_DATUM(0), + PG_GETARG_DATUM(1), + PG_GETARG_DATUM(2), + PG_GETARG_DATUM(3), + Int32GetDatum(0) /* N-D mode */ + )); +} + /************************************************************************/ ----------------------------------------------------------------------- Summary of changes: postgis/gserialized_estimate.c | 132 +++++++++++++++++++++-------------------- 1 file changed, 68 insertions(+), 64 deletions(-) hooks/post-receive -- PostGIS From git at osgeo.org Thu Mar 5 10:49:29 2026 From: git at osgeo.org (git at osgeo.org) Date: Thu, 5 Mar 2026 10:49:29 -0800 (PST) Subject: [SCM] PostGIS branch master updated. 3.6.0rc2-358-g7dfe8b69c Message-ID: <20260305184929.540F218F4B5@trac.osgeo.org> 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 7dfe8b69cde8c683251c9e104d71f3d42e3d5552 (commit) via bd152a4bccf1c134b11b0e60c1a50e071b911a6c (commit) from 8a31ce8c686766caacde19e8fa5977ed49a4068e (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 7dfe8b69cde8c683251c9e104d71f3d42e3d5552 Author: Darafei Praliaskouski Date: Thu Mar 5 22:49:08 2026 +0400 Stabilize Windows CI checks for spelling and CUnit diff --git a/.codespellrc b/.codespellrc index daf57c70c..016dfb022 100644 --- a/.codespellrc +++ b/.codespellrc @@ -1,3 +1,3 @@ [codespell] -skip = *.sql,*.po,spatial_ref_sys.sql,./deps,./extras/tiger_geocoder/tables/lookup_tables_2011.sql,./extras/tiger_geocoder/pagc_normalize/pagc_tables.sql,./extensions/address_standardizer,./configure*,./macros/*.m4,./autom4te.cache,./build-aux,./libtool,./extensions/postgis_tiger_geocoder/*.in,.git,build* +skip = *.po,spatial_ref_sys.sql,./deps,./extensions/address_standardizer,./configure*,./autom4te.cache,./build-aux,./libtool,.git,build* ignore-words = .codespell.ignore diff --git a/.github/workflows/msys.yml b/.github/workflows/msys.yml index 4b6321dcc..358775b51 100644 --- a/.github/workflows/msys.yml +++ b/.github/workflows/msys.yml @@ -40,6 +40,7 @@ jobs: gdal:p sfcgal:p json-c:p + cunit:p gettext:p libxml2:p postgresql:p diff --git a/extensions/address_standardizer/std_pg_hash.c b/extensions/address_standardizer/std_pg_hash.c index 63f490415..4717f4ded 100644 --- a/extensions/address_standardizer/std_pg_hash.c +++ b/extensions/address_standardizer/std_pg_hash.c @@ -369,8 +369,7 @@ AddToStdPortalCache(StdPortalCache *STDCache, char *lextab, char *gaztab, char * DBG("STDCache->NextSlot=%d", STDCache->NextSlot); } - -/* pubilc api */ +/* public api */ StdCache GetStdCache(FunctionCallInfo fcinfo) { return (StdCache) GetStdPortalCache(fcinfo); diff --git a/loader/cunit/Makefile.in b/loader/cunit/Makefile.in index ab9e8d791..e5ee4df2f 100644 --- a/loader/cunit/Makefile.in +++ b/loader/cunit/Makefile.in @@ -20,7 +20,8 @@ CFLAGS=@CFLAGS@ SHELL = @SHELL@ LIBTOOL = @LIBTOOL@ -CUNIT_LDFLAGS=@CUNIT_LDFLAGS@ @GEOS_LDFLAGS@ +CUNIT_LDFLAGS=@CUNIT_LDFLAGS@ +GEOS_LDFLAGS=@GEOS_LDFLAGS@ CUNIT_CPPFLAGS = \ -I$(srcdir)/.. \ -I$(top_builddir)/liblwgeom \ commit bd152a4bccf1c134b11b0e60c1a50e071b911a6c Author: Darafei Praliaskouski Date: Thu Mar 5 22:21:28 2026 +0400 Fix codespell typo in shp2pgsql header comment diff --git a/loader/shp2pgsql-core.h b/loader/shp2pgsql-core.h index 905f92253..748d4773a 100644 --- a/loader/shp2pgsql-core.h +++ b/loader/shp2pgsql-core.h @@ -192,7 +192,7 @@ typedef struct shp_loader_state /* Pointer to an array of PostgreSQL field types */ char **pgfieldtypes; - /* String containing colume name list in the form "col1, col2, col3 ... , colN" */ + /* String containing column name list in the form "col1, col2, col3 ... , colN" */ char *col_names; /* String containing the PostGIS geometry type, e.g. POINT, POLYGON etc. */ ----------------------------------------------------------------------- Summary of changes: .codespellrc | 2 +- .github/workflows/msys.yml | 1 + extensions/address_standardizer/std_pg_hash.c | 3 +-- loader/cunit/Makefile.in | 3 ++- loader/shp2pgsql-core.h | 2 +- 5 files changed, 6 insertions(+), 5 deletions(-) hooks/post-receive -- PostGIS From git at osgeo.org Thu Mar 5 11:39:04 2026 From: git at osgeo.org (git at osgeo.org) Date: Thu, 5 Mar 2026 11:39:04 -0800 (PST) Subject: [SCM] PostGIS branch master updated. 3.6.0rc2-359-geabe42d06 Message-ID: <20260305193904.C9A3318FBCD@trac.osgeo.org> 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 eabe42d06e572fedfd6684c1be542e41097e5bc2 (commit) from 7dfe8b69cde8c683251c9e104d71f3d42e3d5552 (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 eabe42d06e572fedfd6684c1be542e41097e5bc2 Author: Darafei Praliaskouski Date: Thu Mar 5 23:37:21 2026 +0400 msys: use Windows tmpdir and print regression diffs diff --git a/.github/workflows/msys.yml b/.github/workflows/msys.yml index 358775b51..4ae3f6abc 100644 --- a/.github/workflows/msys.yml +++ b/.github/workflows/msys.yml @@ -54,4 +54,14 @@ jobs: MSYSTEM= ./autogen.sh MSYSTEM= ./configure --with-pgconfig=/${{ matrix.sys }}/bin/pg_config --without-protobuf MSYSTEM= make - MSYSTEM= make check + MSYSTEM= PGIS_REG_TMPDIR=D:/a/_tmp/pgis_reg make check || { + status=$? + echo "::group::Regression diffs" + for f in /d/a/_tmp/pgis_reg/test_*_diff; do + [ -f "$f" ] || continue + echo "===== $f =====" + sed -n '1,400p' "$f" + done + echo "::endgroup::" + exit "$status" + } ----------------------------------------------------------------------- Summary of changes: .github/workflows/msys.yml | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) hooks/post-receive -- PostGIS From git at osgeo.org Fri Mar 6 01:08:41 2026 From: git at osgeo.org (git at osgeo.org) Date: Fri, 6 Mar 2026 01:08:41 -0800 (PST) Subject: [SCM] PostGIS branch master updated. 3.6.0rc2-360-g8b07652d0 Message-ID: <20260306090842.5D428191823@trac.osgeo.org> 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 8b07652d087b33fc347ee243b7af998fa58ab4a3 (commit) from eabe42d06e572fedfd6684c1be542e41097e5bc2 (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 8b07652d087b33fc347ee243b7af998fa58ab4a3 Author: Darafei Praliaskouski Date: Fri Mar 6 00:00:02 2026 +0400 regress: stabilize topology output across architectures Break tied topology edge, node, and edge-end selections deterministically so regressions no longer depend on platform-specific ordering. Refresh alphashape_components expected output to match current SFCGAL behavior. diff --git a/liblwgeom/topo/lwgeom_topo.c b/liblwgeom/topo/lwgeom_topo.c index ba42f592c..054c2b21c 100644 --- a/liblwgeom/topo/lwgeom_topo.c +++ b/liblwgeom/topo/lwgeom_topo.c @@ -5193,22 +5193,48 @@ _lwt_minTolerance( LWGEOM *g ) #define _LWT_MINTOLERANCE( topo, geom ) ( \ topo->precision ? topo->precision : _lwt_minTolerance(geom) ) -typedef struct scored_pointer_t { - void *ptr; - double score; -} scored_pointer; +typedef struct scored_node_t { + LWT_ISO_NODE *node; + double score; +} scored_node; static int -compare_scored_pointer(const void *si1, const void *si2) +compare_scored_node(const void *si1, const void *si2) { - double a = ((scored_pointer *)si1)->score; - double b = ((scored_pointer *)si2)->score; - if ( a < b ) - return -1; - else if ( a > b ) - return 1; - else - return 0; + const scored_node *a = si1; + const scored_node *b = si2; + if (a->score < b->score) + return -1; + else if (a->score > b->score) + return 1; + else if (a->node->node_id < b->node->node_id) + return -1; + else if (a->node->node_id > b->node->node_id) + return 1; + else + return 0; +} + +typedef struct scored_edge_t { + LWT_ISO_EDGE *edge; + double score; +} scored_edge; + +static int +compare_scored_edge(const void *si1, const void *si2) +{ + const scored_edge *a = si1; + const scored_edge *b = si2; + if (a->score < b->score) + return -1; + else if (a->score > b->score) + return 1; + else if (a->edge->edge_id < b->edge->edge_id) + return -1; + else if (a->edge->edge_id > b->edge->edge_id) + return 1; + else + return 0; } /* Return identifier of an equal edge, 0 if none or -1 on error @@ -6646,7 +6672,7 @@ static LWT_ELEMID _lwt_SplitAllEdgesToNewNode(LWT_TOPOLOGY* topo, LWT_ISO_EDGE *edges, uint64_t num, LWPOINT *point, double tol, int *moved) { uint64_t i, j; - scored_pointer *sorted = lwalloc(sizeof(scored_pointer)*num); + scored_edge *sorted = lwalloc(sizeof(scored_edge) * num); LWT_ISO_EDGE *edges2 = NULL; LWT_ISO_NODE node; node.node_id = 0; /* unneeded, but hushes a compiler warning */ @@ -6663,7 +6689,7 @@ _lwt_SplitAllEdgesToNewNode(LWT_TOPOLOGY* topo, LWT_ISO_EDGE *edges, uint64_t nu dist = lwgeom_mindistance2d(lwline_as_lwgeom(edges[i].geom), lwpoint_as_lwgeom(point)); LWDEBUGF(1, "Edge %" LWTFMT_ELEMID " distance: %.15g", e->edge_id, dist); if ( dist >= tol ) continue; - sorted[j].ptr = e; + sorted[j].edge = e; sorted[j++].score = dist; } if ( ! j ) @@ -6673,18 +6699,18 @@ _lwt_SplitAllEdgesToNewNode(LWT_TOPOLOGY* topo, LWT_ISO_EDGE *edges, uint64_t nu } num = j; - qsort(sorted, num, sizeof(scored_pointer), compare_scored_pointer); + qsort(sorted, num, sizeof(scored_edge), compare_scored_edge); edges2 = lwalloc(sizeof(LWT_ISO_EDGE)*num); for (j=0, i=0; igeom); + edges2[j++] = *sorted[i].edge; + // lwline_free(sorted[i].edge->geom); } } num = j; @@ -6890,7 +6916,7 @@ _lwt_AddPoint(LWT_TOPOLOGY* topo, LWPOINT* point, double tol, int LWT_ISO_NODE *nodes, *nodes2; LWT_ISO_EDGE *edges; LWGEOM *pt = lwpoint_as_lwgeom(point); - scored_pointer *sorted; + scored_node *sorted; int flds; LWT_ELEMID id = 0; @@ -6921,20 +6947,20 @@ _lwt_AddPoint(LWT_TOPOLOGY* topo, LWPOINT* point, double tol, int /* Order by distance if there are more than a single return */ if ( num > 1 ) {{ - sorted = lwalloc(sizeof(scored_pointer)*num); - for (i=0; inode_id, sorted[i].score); - } - qsort(sorted, num, sizeof(scored_pointer), compare_scored_pointer); - nodes2 = lwalloc(sizeof(LWT_ISO_NODE)*num); - for (i=0; inode_id, sorted[i].score); + } + qsort(sorted, num, sizeof(scored_node), compare_scored_node); + nodes2 = lwalloc(sizeof(LWT_ISO_NODE) * num); + for (i = 0; i < num; ++i) + { + nodes2[i] = *sorted[i].node; + } lwfree(sorted); lwfree(nodes); nodes = nodes2; diff --git a/liblwgeom/topo/lwt_edgeend_star.c b/liblwgeom/topo/lwt_edgeend_star.c index 600e7b6da..a9a0e7acb 100644 --- a/liblwgeom/topo/lwt_edgeend_star.c +++ b/liblwgeom/topo/lwt_edgeend_star.c @@ -135,6 +135,14 @@ lwt_edgeEnd_compare(const void *i1, const void *i2) ret = -1; else if ( ee1->azimuth > ee2->azimuth ) ret = 1; + else if (ee1->edge->edge_id < ee2->edge->edge_id) + ret = -1; + else if (ee1->edge->edge_id > ee2->edge->edge_id) + ret = 1; + else if (ee1->outgoing < ee2->outgoing) + ret = -1; + else if (ee1->outgoing > ee2->outgoing) + ret = 1; else ret = 0; diff --git a/regress/run_test.pl b/regress/run_test.pl index bf7386bbe..40fcce21e 100755 --- a/regress/run_test.pl +++ b/regress/run_test.pl @@ -524,7 +524,6 @@ print " GDAL: $gdalver\n" if $gdalver; # allow hook scripts to perform arbitrary reports via output of INFO strings system("grep INFO $REGRESS_LOG | sed 's/INFO://'"); - ################################################################## # Run the tests ################################################################## diff --git a/sfcgal/regress/alphashape_components_expected b/sfcgal/regress/alphashape_components_expected index a30a4ad59..022ef1221 100644 --- a/sfcgal/regress/alphashape_components_expected +++ b/sfcgal/regress/alphashape_components_expected @@ -1,2 +1,2 @@ -CG_Optimalalphashape_2components|MULTIPOLYGON(((8.3 11.8,6.2 12.1,4.1 11.9,2.6 11.2,1.1 10.1,0.3 8.2,0.1 6.1,0.4 4,1.2 2.3,2.5 1,4.2 0.3,6 0,8.1 0.1,10.1 0.2,9.2 2.4,7.8 2.2,6 2.3,3.6 6.2,7.6 9.8,9.1 9.9,10.2 11.1,8.3 11.8)),((55.6 12.1,55.8 15,54.3 15.2,52.9 10.6,52.7 7.3,52.8 4.1,46.9 2.8,43.3 7.1,43.1 10.4,43.1 15.3,41.9 15.6,40.5 15.2,40.2 12.3,40.4 9,39.8 6.2,40.1 3.1,40.3 0.4,42.1 0.3,44.2 0.2,49.8 -0.2,52.6 0.1,55.4 0.5,55.7 3.3,55.5 6,55.9 9.2,55.6 12.1))) -CG_OptimalAlphaShape_hole_2components|MULTIPOLYGON(((5.5 8.5,5 9,4.5 9.5,4 10,3 10,2 10,1 10,0.5 10,0.23 10,0.03 9.82,0 9,0 8,0 7,0 6,0 5,0 4,0 3,0 2,0 1,0 0,0.5 0,1 0,2 0,3 0,4 0,5 0,5.5 0.5,6 1,6 2,5.8 2.5,5.5 3,5 3.5,4.5 4,4 4.5,5 5,5.5 5.5,6 6,6 7,6 8,5.5 8.5),(0.5 2,0.5 3,1 4,2 4,3 4,4 4,4.5 3.5,5 3,5.1 2.5,5.5 2,5.5 1,5 0.5,4 0.5,3 0.5,2 0.5,1 0.5,0.5 1,0.5 2),(0.5 7,0.5 8,0.5 9,1 9.5,2 9.5,3 9.5,4 9.5,4.5 9,5 8.5,5.5 8,5.5 7,5.5 6.5,5.5 6,5 5.5,4 5.5,3 5.5,2 5.5,1 5.5,0.5 6,0.5 7)),((17.5 8.5,17 9,16.5 9.5,16 10,15 10,14 10,13 10,12.5 10,12 10,12 9,12 8,12 7,12 6,12 5,12 4,12 3,12 2,12 1,12 0,12.5 0,13 1,13 2,13 3,13 4,13 5,14 5,15 5,16 5,17 5,17.5 5.5,18 6,18 7,18 7.3,18 8,17.5 8.5),(12.5 7,12.5 8,12.5 9,13 9.5,14 9.5,15 9.5,16 9.5,16.5 9,17 8.5,17.5 8,17.5 7.4,17.5 7,17.5 6.5,17.5 6,17 5.5,16 5.5,15 5.5,14 5.5,13 5.5,12.5 6,12.5 7))) +CG_Optimalalphashape_2components|POLYGON((0.1 6.1,0.3 8.2,1.1 10.1,2.6 11.2,4.1 11.9,6.2 12.1,8.3 11.8,10.2 11.1,9.1 9.9,7.6 9.8,3.6 6.2,6 2.3,7.8 2.2,9.2 2.4,10.1 0.2,8.1 0.1,6 0,4.2 0.3,2.5 1,1.2 2.3,0.4 4,55.6 12.1,55.9 9.2,55.5 6,55.7 3.3,55.4 0.5,52.6 0.1,49.8 -0.2,44.2 0.2,42.1 0.3,40.3 0.4,40.1 3.1,39.8 6.2,40.4 9,40.2 12.3,40.5 15.2,41.9 15.6,43.1 15.3,43.1 10.4,43.3 7.1,46.9 2.8,52.8 4.1,52.7 7.3,52.9 10.6,54.3 15.2,55.8 15,0.1 6.1)) +CG_OptimalAlphaShape_hole_2components|POLYGON((0 0,0 1,0 2,0 3,0 4,0 5,0 6,0 7,0 8,0 9,0.03 9.82,0.23 10,0.5 10,1 10,2 10,3 10,4 10,4.5 9.5,5 9,5.5 8.5,6 8,6 7,6 6,5.5 5.5,5 5,4 4.5,4.5 4,5 3.5,5.5 3,5.8 2.5,6 2,6 1,5.5 0.5,5 0,4 0,3 0,2 0,1 0,0.5 0,12 0,12 1,12 2,12 3,12 4,12 5,12 6,12 7,12 8,12 9,12 10,12.5 10,13 10,14 10,15 10,16 10,16.5 9.5,17 9,17.5 8.5,18 8,18 7.3,18 7,18 6,17.5 5.5,17 5,16 5,15 5,14 5,13 5,13 4,13 3,13 2,13 1,12.5 0,0 0),(0.5 1,0.5 2,0.5 3,1 4,2 4,3 4,4 4,4.5 3.5,5 3,5.1 2.5,5.5 2,5.5 1,5 0.5,4 0.5,3 0.5,2 0.5,1 0.5,0.5 6,0.5 7,0.5 8,0.5 9,1 9.5,2 9.5,3 9.5,4 9.5,4.5 9,5 8.5,5.5 8,5.5 7,5.5 6.5,5.5 6,5 5.5,4 5.5,3 5.5,2 5.5,1 5.5,0.5 1),(12.5 6,12.5 7,12.5 8,12.5 9,13 9.5,14 9.5,15 9.5,16 9.5,16.5 9,17 8.5,17.5 8,17.5 7.4,17.5 7,17.5 6.5,17.5 6,17 5.5,16 5.5,15 5.5,14 5.5,13 5.5,12.5 6)) diff --git a/topology/postgis_topology.c b/topology/postgis_topology.c index f6bd71a5c..7707ece2b 100644 --- a/topology/postgis_topology.c +++ b/topology/postgis_topology.c @@ -3048,7 +3048,11 @@ cb_getClosestEdge( const LWT_BE_TOPOLOGY* topo, const LWPOINT* pt, uint64_t *num appendStringInfoString(sql, "SELECT "); addEdgeFields(sql, fields, 0); - appendStringInfo(sql, " FROM \"%s\".edge_data ORDER BY geom <-> $1 ASC LIMIT 1", topo->name); + appendStringInfo(sql, + " FROM \"%s\".edge_data" + " ORDER BY geom <-> $1 ASC, edge_id ASC" + " LIMIT 1", + topo->name); POSTGIS_DEBUGF(1, "cb_getClosestEdge query: %s", sql->data); ----------------------------------------------------------------------- Summary of changes: liblwgeom/topo/lwgeom_topo.c | 94 +++++++++++++++++---------- liblwgeom/topo/lwt_edgeend_star.c | 8 +++ regress/run_test.pl | 1 - sfcgal/regress/alphashape_components_expected | 4 +- topology/postgis_topology.c | 6 +- 5 files changed, 75 insertions(+), 38 deletions(-) hooks/post-receive -- PostGIS From git at osgeo.org Fri Mar 6 01:18:58 2026 From: git at osgeo.org (git at osgeo.org) Date: Fri, 6 Mar 2026 01:18:58 -0800 (PST) Subject: [SCM] PostGIS branch master updated. 3.6.0rc2-361-g99af6dc68 Message-ID: <20260306091859.076EC191B36@trac.osgeo.org> 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 99af6dc68c1085547e6cc8158178de20f982191c (commit) from 8b07652d087b33fc347ee243b7af998fa58ab4a3 (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 99af6dc68c1085547e6cc8158178de20f982191c Author: Darafei Praliaskouski Date: Fri Mar 6 13:16:51 2026 +0400 regress: stabilize parser locations in core SQL tests diff --git a/regress/core/bestsrid.sql b/regress/core/bestsrid.sql index 2437a4d02..4745e808f 100644 --- a/regress/core/bestsrid.sql +++ b/regress/core/bestsrid.sql @@ -26,6 +26,6 @@ select 'world', _ST_BestSRID(ST_Point(-160, -40), ST_Point(160, 40)); -- infinite coords SELECT _ST_BestSRID(ST_Point('-infinity', 'infinity')); -SELECT '#5347', ST_Intersection('0102000020E610000005000000000000000000F07F000000000000F07F000000000000F07F000000000000F07F000000000000F07F000000000000F07F000000000000F07F000000000000F07F000000000000F07F000000000000F07F'::geography, - '0101000020E6100000000000000000F07F000000000000F07F'::geography); - +-- Keep this statement on one line so parser notice locations stay stable +-- across LF and CRLF platforms. +SELECT '#5347', ST_Intersection('0102000020E610000005000000000000000000F07F000000000000F07F000000000000F07F000000000000F07F000000000000F07F000000000000F07F000000000000F07F000000000000F07F000000000000F07F000000000000F07F'::geography, '0101000020E6100000000000000000F07F000000000000F07F'::geography); diff --git a/regress/core/bestsrid_expected b/regress/core/bestsrid_expected index 3947d96ec..ecc32b2a9 100644 --- a/regress/core/bestsrid_expected +++ b/regress/core/bestsrid_expected @@ -128,5 +128,5 @@ world|999000 NOTICE: Coordinate values were coerced into range [-180 -90, 180 90] for GEOGRAPHY ERROR: Error in geography_bestsrid calling with infinite coordinate geographies NOTICE: Coordinate values were coerced into range [-180 -90, 180 90] for GEOGRAPHY at character 33 -NOTICE: Coordinate values were coerced into range [-180 -90, 180 90] for GEOGRAPHY at character 257 +NOTICE: Coordinate values were coerced into range [-180 -90, 180 90] for GEOGRAPHY at character 234 ERROR: Error in geography_bestsrid calling with infinite coordinate geographies diff --git a/regress/core/dumpsegments.sql b/regress/core/dumpsegments.sql index 8dd838912..566adb095 100644 --- a/regress/core/dumpsegments.sql +++ b/regress/core/dumpsegments.sql @@ -98,15 +98,13 @@ FROM st_dumpsegments( ))' ); +-- Keep this statement on one line so parser notice locations stay stable +-- across LF and CRLF platforms. -- Check dumping a degenerate (even number of points) circular string -SELECT 'dumpsegments15', path, st_astext(geom) -FROM st_dumpsegments( -'010800000006000000000000000000f03f000000000000f03f0000000000000040000000000000004000000000000008400000000000000840000000000000104000000000000010400000000000001440000000000000144000000000000018400000000000001840' -); +SELECT 'dumpsegments15', path, st_astext(geom) FROM st_dumpsegments('010800000006000000000000000000f03f000000000000f03f0000000000000040000000000000004000000000000008400000000000000840000000000000104000000000000010400000000000001440000000000000144000000000000018400000000000001840'); +-- Keep this statement on one line so parser notice locations stay stable +-- across LF and CRLF platforms. -- Check dumping a compound that contains a degenerate circular -- string -SELECT 'dumpsegments16', path, st_astext(geom) -FROM st_dumpsegments( -'010900000002000000010200000007000000000000000000f03f000000000000f03f00000000000000400000000000000040000000000000084000000000000008400000000000001040000000000000104000000000000014400000000000001440000000000000184000000000000018400000000000001c400000000000001c400108000000060000000000000000001c400000000000001c400000000000001840000000000000184000000000000014400000000000001440000000000000104000000000000010400000000000000840000000000000084000000000000000400000000000000040' -); +SELECT 'dumpsegments16', path, st_astext(geom) FROM st_dumpsegments('010900000002000000010200000007000000000000000000f03f000000000000f03f00000000000000400000000000000040000000000000084000000000000008400000000000001040000000000000104000000000000014400000000000001440000000000000184000000000000018400000000000001c400000000000001c400108000000060000000000000000001c400000000000001c400000000000001840000000000000184000000000000014400000000000001440000000000000104000000000000010400000000000000840000000000000084000000000000000400000000000000040'); diff --git a/regress/core/dumpsegments_expected b/regress/core/dumpsegments_expected index d08b9a948..6bc404677 100644 --- a/regress/core/dumpsegments_expected +++ b/regress/core/dumpsegments_expected @@ -70,10 +70,10 @@ dumpsegments14|{1,1,1,6}|LINESTRING(6 6,7 7) dumpsegments14|{1,1,2,1}|CIRCULARSTRING(7 7,6 6,5 5) dumpsegments14|{1,1,2,2}|CIRCULARSTRING(5 5,4 4,3 3) dumpsegments14|{1,1,2,3}|CIRCULARSTRING(3 3,2 2,1 1) -NOTICE: lwcircstring_construct: invalid point count 6 at character 70 +NOTICE: lwcircstring_construct: invalid point count 6 at character 69 dumpsegments15|{1}|CIRCULARSTRING(1 1,2 2,3 3) dumpsegments15|{2}|CIRCULARSTRING(3 3,4 4,5 5) -NOTICE: lwcircstring_construct: invalid point count 6 at character 70 +NOTICE: lwcircstring_construct: invalid point count 6 at character 69 dumpsegments16|{1,1}|LINESTRING(1 1,2 2) dumpsegments16|{1,2}|LINESTRING(2 2,3 3) dumpsegments16|{1,3}|LINESTRING(3 3,4 4) ----------------------------------------------------------------------- Summary of changes: regress/core/bestsrid.sql | 6 +++--- regress/core/bestsrid_expected | 2 +- regress/core/dumpsegments.sql | 14 ++++++-------- regress/core/dumpsegments_expected | 4 ++-- 4 files changed, 12 insertions(+), 14 deletions(-) hooks/post-receive -- PostGIS From git at osgeo.org Fri Mar 6 01:56:18 2026 From: git at osgeo.org (git at osgeo.org) Date: Fri, 6 Mar 2026 01:56:18 -0800 (PST) Subject: [SCM] PostGIS branch master updated. 3.6.0rc2-362-g532c6ade2 Message-ID: <20260306095618.65CE4192328@trac.osgeo.org> 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 532c6ade24ff41013541c56a995e401a4de14dbd (commit) from 99af6dc68c1085547e6cc8158178de20f982191c (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 532c6ade24ff41013541c56a995e401a4de14dbd Author: Darafei Praliaskouski Date: Fri Mar 6 13:54:16 2026 +0400 sfcgal/tests: normalize alpha shape component output diff --git a/sfcgal/regress/alphashape_components.sql b/sfcgal/regress/alphashape_components.sql index 38e896ffd..3dcfa350c 100644 --- a/sfcgal/regress/alphashape_components.sql +++ b/sfcgal/regress/alphashape_components.sql @@ -1,4 +1,6 @@ +-- Normalize POLYGON vs MULTIPOLYGON output so this SFCGAL 2.3+ regression +-- checks the stable shape result rather than a raw return-type difference. SELECT 'CG_Optimalalphashape_2components', - ST_AsText(CG_OptimalAlphaShape('MULTIPOINT((10.1 0.2),(8.1 0.1),(6.0 0.0),(4.2 0.3),(2.5 1.0),(1.2 2.3),(0.4 4.0),(0.1 6.1),(0.3 8.2),(1.1 10.1),(2.6 11.2),(4.1 11.9),(6.2 12.1),(8.3 11.8),(10.2 11.1),(9.1 9.9),(7.6 9.8),(6.1 9.9),(4.8 9.2),(3.8 8.0),(3.6 6.2),(3.7 4.1),(4.6 2.9),(6.0 2.3),(7.8 2.2),(9.2 2.4),(40.3 0.4),(40.1 3.1),(39.8 6.2),(40.4 9.0),(40.2 12.3),(40.5 15.2),(41.9 15.6),(43.1 15.3),(54.3 15.2),(55.8 15.0),(55.6 12.1),(55.9 9.2),(55.5 6.0),(55.7 3.3),(55.4 0.5),(52.6 0.1),(49.8 -0.2),(46.9 2.8),(44.2 0.2),(42.1 0.3),(43.0 3.8),(43.3 7.1),(43.1 10.4),(52.9 10.6),(52.7 7.3),(52.8 4.1))', allow_holes => false, nb_components => 2)); + ST_AsText(ST_Normalize(ST_Multi(CG_OptimalAlphaShape('MULTIPOINT((10.1 0.2),(8.1 0.1),(6.0 0.0),(4.2 0.3),(2.5 1.0),(1.2 2.3),(0.4 4.0),(0.1 6.1),(0.3 8.2),(1.1 10.1),(2.6 11.2),(4.1 11.9),(6.2 12.1),(8.3 11.8),(10.2 11.1),(9.1 9.9),(7.6 9.8),(6.1 9.9),(4.8 9.2),(3.8 8.0),(3.6 6.2),(3.7 4.1),(4.6 2.9),(6.0 2.3),(7.8 2.2),(9.2 2.4),(40.3 0.4),(40.1 3.1),(39.8 6.2),(40.4 9.0),(40.2 12.3),(40.5 15.2),(41.9 15.6),(43.1 15.3),(54.3 15.2),(55.8 15.0),(55.6 12.1),(55.9 9.2),(55.5 6.0),(55.7 3.3),(55.4 0.5),(52.6 0.1),(49.8 -0.2),(46.9 2.8),(44.2 0.2),(42.1 0.3),(43.0 3.8),(43.3 7.1),(43.1 10.4),(52.9 10.6),(52.7 7.3),(52.8 4.1))', allow_holes => false, nb_components => 2)))); SELECT 'CG_OptimalAlphaShape_hole_2components', - ST_AsText(CG_OptimalAlphaShape('MULTIPOINT((0 0),(0 1),(0 2),(0 3),(0 4),(0 5),(0 6),(0 7),(0 8),(0 9),(1 10),(2 10),(3 10),(4 10),(4.5 9.5),(5 9),(5.5 8.5),(6 8),(6 7),(6 6),(5.5 5.5),(5 5),(4 5),(3 5),(2 5),(1 5),(1 4),(2 4),(3 4),(4 4),(4.5 3.5),(5 3),(6 2),(6 1),(5.5 0.5),(5 0),(4 0),(3 0),(2 0),(1 0),(0.5 0),(0.5 1),(0.5 2),(0.5 3),(0.5 4),(0.5 5),(0.5 6),(0.5 7),(0.5 8),(0.5 9),(0.5 10),(1 9.5),(2 9.5),(3 9.5),(4 9.5),(4.5 9),(5 8.5),(5.5 8),(5.5 7),(5.5 6),(5.5 6.5),(5 5.5),(4 5.5),(3 5.5),(2 5.5),(1 5.5),(1.5 4.5),(2.5 4.5),(3.5 4.5),(4 4.5),(4.5 4),(5 3.5),(5.5 3),(5.5 2),(5.5 1),(5 0.5),(4 0.5),(3 0.5),(2 0.5),(1 0.5),(12 0),(12 1),(12 2),(12 3),(12 4),(12 5),(12 6),(12 7),(12 8),(12 9),(12 10),(13 10),(14 10),(15 10),(16 10),(16.5 9.5),(17 9),(17.5 8.5),(18 8),(18 7),(18 6),(17.5 5.5),(17 5),(16 5),(15 5),(14 5),(13 5),(12.5 0),(12.5 1),(12.5 2),(12.5 3),(12.5 4),(12.5 5),(12.5 6),(12.5 7),(12.5 8),(12.5 9),(12.5 10),(13 9.5),(14 9.5),(15 9.5),(16 9.5),(16.5 9),(17 8.5),(17.5 8),(17.5 7),(17.5 6),(17.5 6.5),(17 5.5),(16 5.5),(15 5.5),(14 5.5),(13 5.5),(13 1),(13 2),(13 3),(13 4),(17.5 7.4),(18 7.3),(5.1 2.5),(5.8 2.5),(0.03 9.82),(0.23 10))', allow_holes => true, nb_components => 2)); + ST_AsText(ST_Normalize(ST_Multi(CG_OptimalAlphaShape('MULTIPOINT((0 0),(0 1),(0 2),(0 3),(0 4),(0 5),(0 6),(0 7),(0 8),(0 9),(1 10),(2 10),(3 10),(4 10),(4.5 9.5),(5 9),(5.5 8.5),(6 8),(6 7),(6 6),(5.5 5.5),(5 5),(4 5),(3 5),(2 5),(1 5),(1 4),(2 4),(3 4),(4 4),(4.5 3.5),(5 3),(6 2),(6 1),(5.5 0.5),(5 0),(4 0),(3 0),(2 0),(1 0),(0.5 0),(0.5 1),(0.5 2),(0.5 3),(0.5 4),(0.5 5),(0.5 6),(0.5 7),(0.5 8),(0.5 9),(0.5 10),(1 9.5),(2 9.5),(3 9.5),(4 9.5),(4.5 9),(5 8.5),(5.5 8),(5.5 7),(5.5 6),(5.5 6.5),(5 5.5),(4 5.5),(3 5.5),(2 5.5),(1 5.5),(1.5 4.5),(2.5 4.5),(3.5 4.5),(4 4.5),(4.5 4),(5 3.5),(5.5 3),(5.5 2),(5.5 1),(5 0.5),(4 0.5),(3 0.5),(2 0.5),(1 0.5),(12 0),(12 1),(12 2),(12 3),(12 4),(12 5),(12 6),(12 7),(12 8),(12 9),(12 10),(13 10),(14 10),(15 10),(16 10),(16.5 9.5),(17 9),(17.5 8.5),(18 8),(18 7),(18 6),(17.5 5.5),(17 5),(16 5),(15 5),(14 5),(13 5),(12.5 0),(12.5 1),(12.5 2),(12.5 3),(12.5 4),(12.5 5),(12.5 6),(12.5 7),(12.5 8),(12.5 9),(12.5 10),(13 9.5),(14 9.5),(15 9.5) ,(16 9.5),(16.5 9),(17 8.5),(17.5 8),(17.5 7),(17.5 6),(17.5 6.5),(17 5.5),(16 5.5),(15 5.5),(14 5.5),(13 5.5),(13 1),(13 2),(13 3),(13 4),(17.5 7.4),(18 7.3),(5.1 2.5),(5.8 2.5),(0.03 9.82),(0.23 10))', allow_holes => true, nb_components => 2)))); diff --git a/sfcgal/regress/alphashape_components_expected b/sfcgal/regress/alphashape_components_expected index 022ef1221..00efc058f 100644 --- a/sfcgal/regress/alphashape_components_expected +++ b/sfcgal/regress/alphashape_components_expected @@ -1,2 +1,2 @@ -CG_Optimalalphashape_2components|POLYGON((0.1 6.1,0.3 8.2,1.1 10.1,2.6 11.2,4.1 11.9,6.2 12.1,8.3 11.8,10.2 11.1,9.1 9.9,7.6 9.8,3.6 6.2,6 2.3,7.8 2.2,9.2 2.4,10.1 0.2,8.1 0.1,6 0,4.2 0.3,2.5 1,1.2 2.3,0.4 4,55.6 12.1,55.9 9.2,55.5 6,55.7 3.3,55.4 0.5,52.6 0.1,49.8 -0.2,44.2 0.2,42.1 0.3,40.3 0.4,40.1 3.1,39.8 6.2,40.4 9,40.2 12.3,40.5 15.2,41.9 15.6,43.1 15.3,43.1 10.4,43.3 7.1,46.9 2.8,52.8 4.1,52.7 7.3,52.9 10.6,54.3 15.2,55.8 15,0.1 6.1)) -CG_OptimalAlphaShape_hole_2components|POLYGON((0 0,0 1,0 2,0 3,0 4,0 5,0 6,0 7,0 8,0 9,0.03 9.82,0.23 10,0.5 10,1 10,2 10,3 10,4 10,4.5 9.5,5 9,5.5 8.5,6 8,6 7,6 6,5.5 5.5,5 5,4 4.5,4.5 4,5 3.5,5.5 3,5.8 2.5,6 2,6 1,5.5 0.5,5 0,4 0,3 0,2 0,1 0,0.5 0,12 0,12 1,12 2,12 3,12 4,12 5,12 6,12 7,12 8,12 9,12 10,12.5 10,13 10,14 10,15 10,16 10,16.5 9.5,17 9,17.5 8.5,18 8,18 7.3,18 7,18 6,17.5 5.5,17 5,16 5,15 5,14 5,13 5,13 4,13 3,13 2,13 1,12.5 0,0 0),(0.5 1,0.5 2,0.5 3,1 4,2 4,3 4,4 4,4.5 3.5,5 3,5.1 2.5,5.5 2,5.5 1,5 0.5,4 0.5,3 0.5,2 0.5,1 0.5,0.5 6,0.5 7,0.5 8,0.5 9,1 9.5,2 9.5,3 9.5,4 9.5,4.5 9,5 8.5,5.5 8,5.5 7,5.5 6.5,5.5 6,5 5.5,4 5.5,3 5.5,2 5.5,1 5.5,0.5 1),(12.5 6,12.5 7,12.5 8,12.5 9,13 9.5,14 9.5,15 9.5,16 9.5,16.5 9,17 8.5,17.5 8,17.5 7.4,17.5 7,17.5 6.5,17.5 6,17 5.5,16 5.5,15 5.5,14 5.5,13 5.5,12.5 6)) +CG_Optimalalphashape_2components|MULTIPOLYGON(((39.8 6.2,40.4 9,40.2 12.3,40.5 15.2,41.9 15.6,43.1 15.3,43.1 10.4,43.3 7.1,46.9 2.8,52.8 4.1,52.7 7.3,52.9 10.6,54.3 15.2,55.8 15,55.6 12.1,55.9 9.2,55.5 6,55.7 3.3,55.4 0.5,52.6 0.1,49.8 -0.2,44.2 0.2,42.1 0.3,40.3 0.4,40.1 3.1,39.8 6.2)),((0.1 6.1,0.3 8.2,1.1 10.1,2.6 11.2,4.1 11.9,6.2 12.1,8.3 11.8,10.2 11.1,9.1 9.9,7.6 9.8,3.6 6.2,6 2.3,7.8 2.2,9.2 2.4,10.1 0.2,8.1 0.1,6 0,4.2 0.3,2.5 1,1.2 2.3,0.4 4,0.1 6.1))) +CG_OptimalAlphaShape_hole_2components|MULTIPOLYGON(((0 0,0 1,0 2,0 3,0 4,0 5,0 6,0 7,0 8,0 9,0.03 9.82,0.23 10,0.5 10,1 10,2 10,3 10,4 10,4.5 9.5,5 9,5.5 8.5,6 8,6 7,6 6,5.5 5.5,5 5,4 4.5,4.5 4,5 3.5,5.5 3,5.8 2.5,6 2,6 1,5.5 0.5,5 0,4 0,3 0,2 0,1 0,0.5 0,0 0),(0.5 6,1 5.5,2 5.5,3 5.5,4 5.5,5 5.5,5.5 6,5.5 6.5,5.5 7,5.5 8,5 8.5,4.5 9,4 9.5,3 9.5,2 9.5,1 9.5,0.5 9,0.5 8,0.5 7,0.5 6),(0.5 1,1 0.5,2 0.5,3 0.5,4 0.5,5 0.5,5.5 1,5.5 2,5.1 2.5,5 3,4.5 3.5,4 4,3 4,2 4,1 4,0.5 3,0.5 2,0.5 1)),((12 0,12 1,12 2,12 3,12 4,12 5,12 6,12 7,12 8,12 9,12 10,12.5 10,13 10,14 10,15 10,16 10,16.5 9.5,17 9,17.5 8.5,18 8,18 7.3,18 7,18 6,17.5 5.5,17 5,16 5,15 5,14 5,13 5,13 4,13 3,13 2,13 1,12.5 0,12 0),(12.5 6,13 5.5,14 5.5,15 5.5,16 5.5,17 5.5,17.5 6,17.5 6.5,17.5 7,17.5 7.4,17.5 8,17 8.5,16.5 9,16 9.5,15 9.5,14 9.5,13 9.5,12.5 9,12.5 8,12.5 7,12.5 6))) ----------------------------------------------------------------------- Summary of changes: sfcgal/regress/alphashape_components.sql | 6 ++++-- sfcgal/regress/alphashape_components_expected | 4 ++-- 2 files changed, 6 insertions(+), 4 deletions(-) hooks/post-receive -- PostGIS From git at osgeo.org Fri Mar 6 02:52:11 2026 From: git at osgeo.org (git at osgeo.org) Date: Fri, 6 Mar 2026 02:52:11 -0800 (PST) Subject: [SCM] PostGIS branch master updated. 3.6.0rc2-363-ge48c072d0 Message-ID: <20260306105212.3BD15191CC8@trac.osgeo.org> 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 e48c072d066590721b0c100818c2e484c7f0395d (commit) from 532c6ade24ff41013541c56a995e401a4de14dbd (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 e48c072d066590721b0c100818c2e484c7f0395d Author: Darafei Praliaskouski Date: Fri Mar 6 14:50:44 2026 +0400 ci/debbie: bump dist jobs to PostgreSQL 14 diff --git a/ci/debbie/postgis_make_dist.sh b/ci/debbie/postgis_make_dist.sh index 33d880dc1..f3d75311a 100644 --- a/ci/debbie/postgis_make_dist.sh +++ b/ci/debbie/postgis_make_dist.sh @@ -2,7 +2,7 @@ set -e ## begin variables passed in by jenkins -export PG_VER=13 +export PG_VER=14 # export PGPORT=8442 export OS_BUILD=64 # export POSTGIS_MAJOR_VERSION=2 diff --git a/ci/debbie/postgis_release_docs.sh b/ci/debbie/postgis_release_docs.sh index 82c67cca7..7807c7074 100644 --- a/ci/debbie/postgis_release_docs.sh +++ b/ci/debbie/postgis_release_docs.sh @@ -2,7 +2,7 @@ set -e -export PG_VER=13 +export PG_VER=14 # export PGPORT=8442 export OS_BUILD=64 #this is passed in via postgis_make_dist.sh via jenkins diff --git a/doc/developer.md b/doc/developer.md index 6b56c610b..eb3a69c47 100644 --- a/doc/developer.md +++ b/doc/developer.md @@ -374,7 +374,9 @@ while keeping the CI account unprivileged. * Edit doc/postgis.xml and change entity `min_postgres_version` to new minimum version +* Update any CI scripts that hard-code a PostgreSQL major for packaging or docs jobs, + notably `ci/debbie/postgis_make_dist.sh` and `ci/debbie/postgis_release_docs.sh` + * Add to NEWS Breaking Changes section, your removal of said versions - ----------------------------------------------------------------------- Summary of changes: ci/debbie/postgis_make_dist.sh | 2 +- ci/debbie/postgis_release_docs.sh | 2 +- doc/developer.md | 4 +++- 3 files changed, 5 insertions(+), 3 deletions(-) hooks/post-receive -- PostGIS From git at osgeo.org Fri Mar 6 04:47:50 2026 From: git at osgeo.org (git at osgeo.org) Date: Fri, 6 Mar 2026 04:47:50 -0800 (PST) Subject: [SCM] PostGIS branch master updated. 3.6.0rc2-364-g2cbc46f29 Message-ID: <20260306124750.5CEC01962AD@trac.osgeo.org> 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 2cbc46f2915e694ec329407503574004c16311b9 (commit) from e48c072d066590721b0c100818c2e484c7f0395d (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 2cbc46f2915e694ec329407503574004c16311b9 Author: Darafei Praliaskouski Date: Fri Mar 6 16:46:56 2026 +0400 topology: avoid uninitialized edge id in edge split diff --git a/liblwgeom/topo/lwgeom_topo.c b/liblwgeom/topo/lwgeom_topo.c index 054c2b21c..07e7ba7cd 100644 --- a/liblwgeom/topo/lwgeom_topo.c +++ b/liblwgeom/topo/lwgeom_topo.c @@ -6138,7 +6138,10 @@ _lwt_SnapEdgeToExistingNode( newEdge.geom = lwgeom_as_lwline(splitC->geoms[1]); newEdge.end_node = edge->end_node; newEdge.start_node = node->node_id; - newEdge.next_right = -updatedEdge.edge_id; // to be assigned later, if needed + /* Seed the split pair with mutual linkage; nodeStar may replace these + * with the actual neighboring edges below. + */ + newEdge.next_right = -edge->edge_id; if ( edge->next_left == -edge->edge_id ) { newEdge.next_left = -newEdge.edge_id; } else { @@ -6151,7 +6154,7 @@ _lwt_SnapEdgeToExistingNode( updatedEdge.edge_id = edge->edge_id; updatedEdge.geom = lwgeom_as_lwline(splitC->geoms[0]); updatedEdge.end_node = node->node_id; - updatedEdge.next_left = newEdge.edge_id; // to be re-assigned later, if needed + updatedEdge.next_left = newEdge.edge_id; LWT_EDGEEND_STAR *nodeStar = lwt_edgeEndStar_init( node->node_id ); ----------------------------------------------------------------------- Summary of changes: liblwgeom/topo/lwgeom_topo.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) hooks/post-receive -- PostGIS From git at osgeo.org Fri Mar 6 08:15:30 2026 From: git at osgeo.org (git at osgeo.org) Date: Fri, 6 Mar 2026 08:15:30 -0800 (PST) Subject: [SCM] PostGIS branch master updated. 3.6.0rc2-366-g67d1d0640 Message-ID: <20260306161531.459C8197302@trac.osgeo.org> 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 67d1d0640e2e01d1fff997372bf357250fecc90d (commit) via 17f698631baf0c3b4c63ec474fed51d9518a0e1a (commit) from 2cbc46f2915e694ec329407503574004c16311b9 (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 67d1d0640e2e01d1fff997372bf357250fecc90d Author: Darafei Praliaskouski Date: Fri Mar 6 20:14:52 2026 +0400 doc: fix comment SQL escaping and spell checks diff --git a/.codespellrc b/.codespellrc index 016dfb022..964a27237 100644 --- a/.codespellrc +++ b/.codespellrc @@ -1,3 +1,4 @@ [codespell] -skip = *.po,spatial_ref_sys.sql,./deps,./extensions/address_standardizer,./configure*,./autom4te.cache,./build-aux,./libtool,.git,build* +# utils/check_spelling.sh builds a deterministic list of tracked files plus +# generated comment SQL. ignore-words = .codespell.ignore diff --git a/.github/workflows/codespell.yml b/.github/workflows/codespell.yml index 302aa40a1..617153b0b 100644 --- a/.github/workflows/codespell.yml +++ b/.github/workflows/codespell.yml @@ -21,9 +21,12 @@ jobs: - name: 'Install codespell' run: | + sudo apt-get update + sudo apt-get install -y --no-install-recommends libxml2-utils docbook-xml docbook-xsl docbook-xsl-ns xsltproc sudo pip install codespell - name: 'Build & Test' run: | codespell --version - codespell -I ".codespell.ignore" + make -C doc comments + ./utils/check_spelling.sh diff --git a/GNUmakefile.in b/GNUmakefile.in index 1e0c2fb92..e468eed66 100644 --- a/GNUmakefile.in +++ b/GNUmakefile.in @@ -307,7 +307,7 @@ endif check-spell: ifneq (@CODESPELL@,) - cd $(top_srcdir) && @CODESPELL@ + cd $(top_srcdir) && ./utils/check_spelling.sh @CODESPELL@ else @echo "SKIP: spell checking disabled" endif diff --git a/doc/po/zh_Hans/postgis-manual.po b/doc/po/zh_Hans/postgis-manual.po index d319ec99a..f571d2fcc 100644 --- a/doc/po/zh_Hans/postgis-manual.po +++ b/doc/po/zh_Hans/postgis-manual.po @@ -4346,7 +4346,7 @@ msgid "" "topogeometries created before the upgrade. This function fixes this " "corruption in affected tables." msgstr "" -"? PostGIS topology ?? <3.6.0 ??? >3.6.0+ ??topogeometry " +"? PostGIS topology ?? <3.6.0 ??? >3.6.0+ ??topogeometry " "?????????????????? topogeometry " "????????????????????????????" diff --git a/doc/xsl/postgis_comments.sql.xsl b/doc/xsl/postgis_comments.sql.xsl index 3e5333d2a..3e27ba993 100644 --- a/doc/xsl/postgis_comments.sql.xsl +++ b/doc/xsl/postgis_comments.sql.xsl @@ -22,6 +22,7 @@ ' + '' @@ -32,7 +33,7 @@ - + diff --git a/doc/xsl/raster_comments.sql.xsl b/doc/xsl/raster_comments.sql.xsl index d9dd68970..450904c7d 100644 --- a/doc/xsl/raster_comments.sql.xsl +++ b/doc/xsl/raster_comments.sql.xsl @@ -24,6 +24,7 @@ ' + '' @@ -34,7 +35,7 @@ - + @@ -61,7 +63,7 @@ COMMENT ON - + COMMENT ON TYPE IS 'postgis raster type: '; diff --git a/doc/xsl/sfcgal_comments.sql.xsl b/doc/xsl/sfcgal_comments.sql.xsl index 6eb857037..116da9a30 100644 --- a/doc/xsl/sfcgal_comments.sql.xsl +++ b/doc/xsl/sfcgal_comments.sql.xsl @@ -23,6 +23,7 @@ ' + '' @@ -33,7 +34,7 @@ - + @@ -33,7 +34,7 @@ - + @@ -33,7 +34,7 @@ - + diff --git a/utils/check_spelling.sh b/utils/check_spelling.sh new file mode 100755 index 000000000..5537675ed --- /dev/null +++ b/utils/check_spelling.sh @@ -0,0 +1,44 @@ +#!/bin/sh + +set -eu + +CODESPELL=${1:-codespell} + +ROOT=$(git rev-parse --show-toplevel 2>/dev/null || pwd) +cd "$ROOT" + +tmpfiles=$(mktemp) +trap 'rm -f "$tmpfiles"' EXIT HUP INT TERM + +# Keep the check deterministic by starting from tracked files and excluding +# vendor data, generated trees, and authoritative datasets that are not prose. +git ls-files -z -- . \ + ':(exclude)deps' \ + ':(exclude)extensions/address_standardizer' \ + ':(exclude)doc/html' \ + ':(exclude)doc/po' \ + ':(exclude)doc/postgis-out.xml' \ + ':(exclude)doc/postgis-nospecial.xml' \ + ':(exclude)aclocal.m4' \ + ':(exclude)configure' \ + ':(exclude)macros/libtool.m4' \ + ':(exclude)spatial_ref_sys.sql' \ + ':(exclude)extensions/postgis/sql/spatial_ref_sys.sql' \ + ':(glob,exclude)extensions/postgis/sql/postgis--*.sql' \ + ':(glob,exclude)**/*.po' \ + > "$tmpfiles" + +# The comment SQL files are generated from the docs and shipped in release +# artifacts, so include them when they exist. +for generated in doc/postgis_comments.sql \ + doc/raster_comments.sql \ + doc/sfcgal_comments.sql \ + doc/tiger_geocoder_comments.sql \ + doc/topology_comments.sql +do + if [ -f "$generated" ]; then + printf '%s\0' "$generated" >> "$tmpfiles" + fi +done + +xargs -0 "$CODESPELL" --config .codespellrc < "$tmpfiles" commit 17f698631baf0c3b4c63ec474fed51d9518a0e1a Author: Darafei Praliaskouski Date: Fri Mar 6 19:45:36 2026 +0400 geos: use fixed-width flags in signedness-sensitive paths diff --git a/liblwgeom/cunit/cu_geos_cluster.c b/liblwgeom/cunit/cu_geos_cluster.c index 78d8c35c9..20129f14b 100644 --- a/liblwgeom/cunit/cu_geos_cluster.c +++ b/liblwgeom/cunit/cu_geos_cluster.c @@ -22,7 +22,7 @@ static void assert_all_results_found(LWGEOM** results, size_t num_outputs, LWGEO { size_t i, j; - char found_equal = 0; + uint8_t found_equal = 0; for (i = 0; i < num_outputs; i++) { for (j = 0; j < num_expected_outputs; j++) @@ -271,7 +271,7 @@ static void do_dbscan_test(struct dbscan_test_info test) LWGEOM** geoms = WKTARRAY2LWGEOM(test.wkt_inputs, test.num_geoms); UNIONFIND* uf = UF_create(test.num_geoms); uint32_t* ids; - char* in_a_cluster; + uint8_t *in_a_cluster; uint32_t i; union_dbscan(geoms, test.num_geoms, uf, test.eps, test.min_points, &in_a_cluster); diff --git a/liblwgeom/cunit/cu_unionfind.c b/liblwgeom/cunit/cu_unionfind.c index 223129866..fb00dc5c1 100644 --- a/liblwgeom/cunit/cu_unionfind.c +++ b/liblwgeom/cunit/cu_unionfind.c @@ -66,7 +66,7 @@ static void test_unionfind_ordered_by_cluster(void) uint32_t* ids_by_cluster = UF_ordered_by_cluster(&uf); - char encountered_cluster[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; + uint8_t encountered_cluster[] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; uint32_t i; for (i = 0; i < uf.N; i++) @@ -147,7 +147,7 @@ static void test_unionfind_collapse_cluster_ids(void) lwfree(collapsed_ids); - char is_in_cluster[] = { 0, 1, 1, 1, 0, 1, 0, 0, 0, 0 }; + uint8_t is_in_cluster[] = {0, 1, 1, 1, 0, 1, 0, 0, 0, 0}; uint32_t expected_collapsed_ids2[] = { 8, 0, 0, 0, 7, 0, 8, 7, 8, 7 }; collapsed_ids = UF_get_collapsed_cluster_ids(uf, is_in_cluster); diff --git a/liblwgeom/lwgeom_geos.c b/liblwgeom/lwgeom_geos.c index e3fb18625..b42f1eb69 100644 --- a/liblwgeom/lwgeom_geos.c +++ b/liblwgeom/lwgeom_geos.c @@ -1776,7 +1776,7 @@ lwgeom_voronoi_diagram(const LWGEOM* g, const GBOX* env, double tolerance, int o { uint32_t num_points = lwgeom_count_vertices(g); LWGEOM* lwgeom_result; - char is_3d = LW_FALSE; + uint8_t is_3d = LW_FALSE; int32_t srid = lwgeom_get_srid(g); GEOSCoordSequence* coords; GEOSGeometry* geos_geom; diff --git a/liblwgeom/lwgeom_geos.h b/liblwgeom/lwgeom_geos.h index 2d80819fb..f444cb6e5 100644 --- a/liblwgeom/lwgeom_geos.h +++ b/liblwgeom/lwgeom_geos.h @@ -46,7 +46,12 @@ int cluster_intersecting(GEOSGeometry **geoms, uint32_t num_geoms, GEOSGeometry int union_intersecting_pairs(GEOSGeometry** geoms, uint32_t num_geoms, UNIONFIND* uf); int union_related_pairs(GEOSGeometry** geoms, uint32_t num_geoms, const char* im, UNIONFIND* uf); int cluster_within_distance(LWGEOM **geoms, uint32_t num_geoms, double tolerance, LWGEOM ***clusterGeoms, uint32_t *num_clusters); -int union_dbscan(LWGEOM **geoms, uint32_t num_geoms, UNIONFIND *uf, double eps, uint32_t min_points, char **is_in_cluster_ret); +int union_dbscan(LWGEOM **geoms, + uint32_t num_geoms, + UNIONFIND *uf, + double eps, + uint32_t min_points, + uint8_t **is_in_cluster_ret); POINTARRAY* ptarray_from_GEOSCoordSeq(const GEOSCoordSequence* cs, uint8_t want3d); diff --git a/liblwgeom/lwgeom_geos_cluster.c b/liblwgeom/lwgeom_geos_cluster.c index 318d3558e..64ca68f5f 100644 --- a/liblwgeom/lwgeom_geos_cluster.c +++ b/liblwgeom/lwgeom_geos_cluster.c @@ -48,9 +48,14 @@ struct STRTree uint32_t num_geoms; }; -static struct STRTree make_strtree(void** geoms, uint32_t num_geoms, char is_lwgeom); +static struct STRTree make_strtree(void **geoms, uint32_t num_geoms, uint8_t is_lwgeom); static void destroy_strtree(struct STRTree * tree); -static int combine_geometries(UNIONFIND* uf, void** geoms, uint32_t num_geoms, void*** clustersGeoms, uint32_t* num_clusters, char is_lwgeom); +static int combine_geometries(UNIONFIND *uf, + void **geoms, + uint32_t num_geoms, + void ***clustersGeoms, + uint32_t *num_clusters, + uint8_t is_lwgeom); /* Make a minimal GEOSGeometry* whose Envelope covers the same 2D extent as * the supplied GBOX. This is faster and uses less memory than building a @@ -77,7 +82,7 @@ geos_envelope_surrogate(const LWGEOM* g) /** Make a GEOSSTRtree that stores a pointer to a variable containing * the array index of the input geoms */ static struct STRTree -make_strtree(void** geoms, uint32_t num_geoms, char is_lwgeom) +make_strtree(void **geoms, uint32_t num_geoms, uint8_t is_lwgeom) { struct STRTree tree; tree.envelopes = 0; @@ -385,7 +390,7 @@ dbscan_update_context(GEOSSTRtree* tree, struct QueryContext* cxt, LWGEOM** geom * Applicable to DBSCAN with minpoints > 1. */ static void -union_if_available(UNIONFIND* uf, uint32_t p, uint32_t q, char* is_in_core, char* in_a_cluster) +union_if_available(UNIONFIND *uf, uint32_t p, uint32_t q, uint8_t *is_in_core, uint8_t *in_a_cluster) { if (in_a_cluster[q]) { @@ -411,7 +416,7 @@ union_if_available(UNIONFIND* uf, uint32_t p, uint32_t q, char* is_in_core, char * to avoid some distance computations altogether. */ static int -union_dbscan_minpoints_1(LWGEOM** geoms, uint32_t num_geoms, UNIONFIND* uf, double eps, char** in_a_cluster_ret) +union_dbscan_minpoints_1(LWGEOM **geoms, uint32_t num_geoms, UNIONFIND *uf, double eps, uint8_t **in_a_cluster_ret) { uint32_t p, i; struct STRTree tree; @@ -425,7 +430,7 @@ union_dbscan_minpoints_1(LWGEOM** geoms, uint32_t num_geoms, UNIONFIND* uf, doub if (in_a_cluster_ret) { - char* in_a_cluster = lwalloc(num_geoms * sizeof(char)); + uint8_t *in_a_cluster = lwalloc(num_geoms * sizeof(uint8_t)); for (i = 0; i < num_geoms; i++) in_a_cluster[i] = LW_TRUE; *in_a_cluster_ret = in_a_cluster; @@ -481,7 +486,12 @@ union_dbscan_minpoints_1(LWGEOM** geoms, uint32_t num_geoms, UNIONFIND* uf, doub } static int -union_dbscan_general(LWGEOM** geoms, uint32_t num_geoms, UNIONFIND* uf, double eps, uint32_t min_points, char** in_a_cluster_ret) +union_dbscan_general(LWGEOM **geoms, + uint32_t num_geoms, + UNIONFIND *uf, + double eps, + uint32_t min_points, + uint8_t **in_a_cluster_ret) { uint32_t p, i; struct STRTree tree; @@ -493,11 +503,11 @@ union_dbscan_general(LWGEOM** geoms, uint32_t num_geoms, UNIONFIND* uf, double e }; int success = LW_SUCCESS; uint32_t* neighbors; - char* in_a_cluster; - char* is_in_core; + uint8_t *in_a_cluster; + uint8_t *is_in_core; - in_a_cluster = lwalloc(num_geoms * sizeof(char)); - memset(in_a_cluster, 0, num_geoms * sizeof(char)); + in_a_cluster = lwalloc(num_geoms * sizeof(uint8_t)); + memset(in_a_cluster, 0, num_geoms * sizeof(uint8_t)); if (in_a_cluster_ret) *in_a_cluster_ret = in_a_cluster; @@ -517,8 +527,8 @@ union_dbscan_general(LWGEOM** geoms, uint32_t num_geoms, UNIONFIND* uf, double e return LW_FAILURE; } - is_in_core = lwalloc(num_geoms * sizeof(char)); - memset(is_in_core, 0, num_geoms * sizeof(char)); + is_in_core = lwalloc(num_geoms * sizeof(uint8_t)); + memset(is_in_core, 0, num_geoms * sizeof(uint8_t)); neighbors = lwalloc(min_points * sizeof(uint32_t)); for (p = 0; p < num_geoms; p++) @@ -619,7 +629,13 @@ union_dbscan_general(LWGEOM** geoms, uint32_t num_geoms, UNIONFIND* uf, double e return success; } -int union_dbscan(LWGEOM** geoms, uint32_t num_geoms, UNIONFIND* uf, double eps, uint32_t min_points, char** in_a_cluster_ret) +int +union_dbscan(LWGEOM **geoms, + uint32_t num_geoms, + UNIONFIND *uf, + double eps, + uint32_t min_points, + uint8_t **in_a_cluster_ret) { if (min_points <= 1) return union_dbscan_minpoints_1(geoms, num_geoms, uf, eps, in_a_cluster_ret); @@ -651,7 +667,12 @@ cluster_within_distance(LWGEOM** geoms, uint32_t num_geoms, double tolerance, LW * GeometryCollections. Supplied geometry array may be of either LWGEOM* or GEOSGeometry*; is_lwgeom is used to * identify which. Caller is responsible for freeing input geometry array but not the items contained within it. */ static int -combine_geometries(UNIONFIND* uf, void** geoms, uint32_t num_geoms, void*** clusterGeoms, uint32_t* num_clusters, char is_lwgeom) +combine_geometries(UNIONFIND *uf, + void **geoms, + uint32_t num_geoms, + void ***clusterGeoms, + uint32_t *num_clusters, + uint8_t is_lwgeom) { size_t i, j, k; diff --git a/liblwgeom/lwunionfind.c b/liblwgeom/lwunionfind.c index 854a9e807..9ca47a1c3 100644 --- a/liblwgeom/lwunionfind.c +++ b/liblwgeom/lwunionfind.c @@ -142,13 +142,13 @@ UF_ordered_by_cluster(UNIONFIND* uf) return ordered_ids; } -uint32_t* -UF_get_collapsed_cluster_ids(UNIONFIND* uf, const char* is_in_cluster) +uint32_t * +UF_get_collapsed_cluster_ids(UNIONFIND *uf, const uint8_t *is_in_cluster) { uint32_t* ordered_components = UF_ordered_by_cluster(uf); uint32_t* new_ids = lwalloc(uf->N * sizeof(uint32_t)); uint32_t last_old_id, current_new_id, i; - char encountered_cluster = LW_FALSE; + uint8_t encountered_cluster = LW_FALSE; current_new_id = 0; last_old_id = 0; for (i = 0; i < uf->N; i++) diff --git a/liblwgeom/lwunionfind.h b/liblwgeom/lwunionfind.h index 75e0ae788..8964a3671 100644 --- a/liblwgeom/lwunionfind.h +++ b/liblwgeom/lwunionfind.h @@ -57,5 +57,4 @@ uint32_t* UF_ordered_by_cluster(UNIONFIND* uf); * If is_in_cluster array is provided, it will be used to skip any indexes * that are not in a cluster. * */ -uint32_t* UF_get_collapsed_cluster_ids(UNIONFIND* uf, const char* is_in_cluster); - +uint32_t *UF_get_collapsed_cluster_ids(UNIONFIND *uf, const uint8_t *is_in_cluster); diff --git a/postgis/lwgeom_geos.c b/postgis/lwgeom_geos.c index 9b1ef3e0f..e93db0af7 100644 --- a/postgis/lwgeom_geos.c +++ b/postgis/lwgeom_geos.c @@ -1551,7 +1551,7 @@ Datum isvalid(PG_FUNCTION_ARGS) { GSERIALIZED *geom1; LWGEOM *lwgeom; - char result; + int8_t result; GEOSGeom g1; geom1 = PG_GETARG_GSERIALIZED_P(0); @@ -1628,7 +1628,7 @@ Datum isvaliddetail(PG_FUNCTION_ARGS) char *reason = NULL; GEOSGeometry *geos_location = NULL; LWGEOM *location = NULL; - char valid = 0; + int8_t valid = 0; HeapTupleHeader result; TupleDesc tupdesc; HeapTuple tuple; @@ -1706,7 +1706,7 @@ Datum issimple(PG_FUNCTION_ARGS) { GSERIALIZED *geom; LWGEOM *lwgeom_in; - int result; + int8_t result; POSTGIS_DEBUG(2, "issimple called"); @@ -1732,7 +1732,7 @@ Datum isring(PG_FUNCTION_ARGS) { GSERIALIZED *geom; GEOSGeometry *g1; - int result; + int8_t result; geom = PG_GETARG_GSERIALIZED_P(0); @@ -1762,7 +1762,7 @@ Datum isring(PG_FUNCTION_ARGS) } GSERIALIZED * -GEOS2POSTGIS(GEOSGeom geom, char want3d) +GEOS2POSTGIS(GEOSGeom geom, uint8_t want3d) { LWGEOM *lwgeom; GSERIALIZED *result; @@ -2662,7 +2662,7 @@ Datum LWGEOM_dfullywithin(PG_FUNCTION_ARGS) double radius = PG_GETARG_FLOAT8(2); GEOSGeometry *buffer1 = NULL; GEOSGeometry *geos1 = NULL, *geos2 = NULL; - char contained; + int8_t contained; if (radius < 0.0) { diff --git a/postgis/lwgeom_geos.h b/postgis/lwgeom_geos.h index 07707c459..1fdc58e83 100644 --- a/postgis/lwgeom_geos.h +++ b/postgis/lwgeom_geos.h @@ -34,7 +34,7 @@ ** Public prototypes for GEOS utility functions. */ -GSERIALIZED *GEOS2POSTGIS(GEOSGeom geom, char want3d); +GSERIALIZED *GEOS2POSTGIS(GEOSGeom geom, uint8_t want3d); GEOSGeometry *POSTGIS2GEOS(const GSERIALIZED *g); GEOSGeometry** ARRAY2GEOS(ArrayType* array, uint32_t nelems, int* is3d, int* srid); LWGEOM** ARRAY2LWGEOM(ArrayType* array, uint32_t nelems, int* is3d, int* srid); diff --git a/postgis/lwgeom_geos_predicates.c b/postgis/lwgeom_geos_predicates.c index 1219117f8..87d34a694 100644 --- a/postgis/lwgeom_geos_predicates.c +++ b/postgis/lwgeom_geos_predicates.c @@ -65,8 +65,8 @@ Datum ST_Equals(PG_FUNCTION_ARGS); /* * Utility to quickly check for polygonal geometries */ -static inline char -is_poly(const GSERIALIZED* g) +static inline uint8_t +is_poly(const GSERIALIZED *g) { int type = gserialized_get_type(g); return type == POLYGONTYPE || type == MULTIPOLYGONTYPE; @@ -75,8 +75,8 @@ is_poly(const GSERIALIZED* g) /* * Utility to quickly check for point geometries */ -static inline char -is_point(const GSERIALIZED* g) +static inline uint8_t +is_point(const GSERIALIZED *g) { int type = gserialized_get_type(g); return type == POINTTYPE || type == MULTIPOINTTYPE; @@ -95,7 +95,7 @@ Datum ST_Intersects(PG_FUNCTION_ARGS) SHARED_GSERIALIZED *shared_geom2 = ToastCacheGetGeometry(fcinfo, 1); const GSERIALIZED *geom1 = shared_gserialized_get(shared_geom1); const GSERIALIZED *geom2 = shared_gserialized_get(shared_geom2); - int result; + int8_t result; GBOX box1, box2; PrepGeomCache *prep_cache; @@ -174,7 +174,7 @@ Datum ST_Equals(PG_FUNCTION_ARGS) SHARED_GSERIALIZED *shared_geom2 = ToastCacheGetGeometry(fcinfo, 1); const GSERIALIZED *geom1 = shared_gserialized_get(shared_geom1); const GSERIALIZED *geom2 = shared_gserialized_get(shared_geom2); - char result; + int8_t result; GBOX box1, box2; GEOSGeometry *g1, *g2; @@ -233,7 +233,7 @@ Datum touches(PG_FUNCTION_ARGS) SHARED_GSERIALIZED *shared_geom2 = ToastCacheGetGeometry(fcinfo, 1); const GSERIALIZED *geom1 = shared_gserialized_get(shared_geom1); const GSERIALIZED *geom2 = shared_gserialized_get(shared_geom2); - char result; + int8_t result; GBOX box1, box2; PrepGeomCache *prep_cache; @@ -297,7 +297,7 @@ Datum disjoint(PG_FUNCTION_ARGS) SHARED_GSERIALIZED *shared_geom2 = ToastCacheGetGeometry(fcinfo, 1); const GSERIALIZED *geom1 = shared_gserialized_get(shared_geom1); const GSERIALIZED *geom2 = shared_gserialized_get(shared_geom2); - char result; + int8_t result; GBOX box1, box2; PrepGeomCache *prep_cache; @@ -365,7 +365,7 @@ Datum overlaps(PG_FUNCTION_ARGS) SHARED_GSERIALIZED *shared_geom2 = ToastCacheGetGeometry(fcinfo, 1); const GSERIALIZED *geom1 = shared_gserialized_get(shared_geom1); const GSERIALIZED *geom2 = shared_gserialized_get(shared_geom2); - char result; + int8_t result; GBOX box1, box2; PrepGeomCache *prep_cache; @@ -432,7 +432,7 @@ Datum crosses(PG_FUNCTION_ARGS) SHARED_GSERIALIZED *shared_geom2 = ToastCacheGetGeometry(fcinfo, 1); const GSERIALIZED *geom1 = shared_gserialized_get(shared_geom1); const GSERIALIZED *geom2 = shared_gserialized_get(shared_geom2); - int result; + int8_t result; GBOX box1, box2; PrepGeomCache *prep_cache; @@ -500,7 +500,7 @@ Datum contains(PG_FUNCTION_ARGS) SHARED_GSERIALIZED *shared_geom2 = ToastCacheGetGeometry(fcinfo, 1); const GSERIALIZED *geom1 = shared_gserialized_get(shared_geom1); const GSERIALIZED *geom2 = shared_gserialized_get(shared_geom2); - int result; + int8_t result; GEOSGeometry *g1, *g2; GBOX box1, box2; PrepGeomCache *prep_cache; @@ -581,7 +581,7 @@ Datum within(PG_FUNCTION_ARGS) SHARED_GSERIALIZED *shared_geom2 = ToastCacheGetGeometry(fcinfo, 1); const GSERIALIZED *geom1 = shared_gserialized_get(shared_geom1); const GSERIALIZED *geom2 = shared_gserialized_get(shared_geom2); - int result; + int8_t result; GEOSGeometry *g1, *g2; GBOX box1, box2; PrepGeomCache *prep_cache; @@ -661,7 +661,7 @@ Datum containsproperly(PG_FUNCTION_ARGS) SHARED_GSERIALIZED *shared_geom2 = ToastCacheGetGeometry(fcinfo, 1); const GSERIALIZED *geom1 = shared_gserialized_get(shared_geom1); const GSERIALIZED *geom2 = shared_gserialized_get(shared_geom2); - char result; + int8_t result; GBOX box1, box2; PrepGeomCache *prep_cache; @@ -726,7 +726,7 @@ Datum covers(PG_FUNCTION_ARGS) SHARED_GSERIALIZED *shared_geom2 = ToastCacheGetGeometry(fcinfo, 1); const GSERIALIZED *geom1 = shared_gserialized_get(shared_geom1); const GSERIALIZED *geom2 = shared_gserialized_get(shared_geom2); - int result; + int8_t result; GBOX box1, box2; PrepGeomCache *prep_cache; @@ -810,7 +810,7 @@ Datum coveredby(PG_FUNCTION_ARGS) SHARED_GSERIALIZED *shared_geom2 = ToastCacheGetGeometry(fcinfo, 1); const GSERIALIZED *geom1 = shared_gserialized_get(shared_geom1); const GSERIALIZED *geom2 = shared_gserialized_get(shared_geom2); - int result; + int8_t result; GBOX box1, box2; PrepGeomCache *prep_cache; @@ -909,7 +909,7 @@ Datum relate_pattern(PG_FUNCTION_ARGS) text *imPtr = DatumGetTextP(DirectFunctionCall2(text_left, PG_GETARG_DATUM(2), Int32GetDatum(9))); char *im = text_to_cstring(imPtr); - char result; + int8_t result; uint32_t i; #if POSTGIS_GEOS_VERSION >= 31300 PrepGeomCache *prep_cache; @@ -1045,7 +1045,7 @@ Datum LWGEOM_dwithin(PG_FUNCTION_ARGS) const GSERIALIZED *geom2 = shared_gserialized_get(shared_geom2); PrepGeomCache *prep_cache = NULL; const size_t small_threshold = 1024; - char is_dwithin = -1; + int8_t is_dwithin = -1; /* * Only enter the GEOS/PreparedGeometry code line if one of the @@ -1103,5 +1103,3 @@ Datum LWGEOM_dwithin(PG_FUNCTION_ARGS) PG_RETURN_BOOL(is_dwithin); } - - diff --git a/postgis/lwgeom_window.c b/postgis/lwgeom_window.c index 4e931af53..409b94503 100644 --- a/postgis/lwgeom_window.c +++ b/postgis/lwgeom_window.c @@ -49,14 +49,14 @@ typedef struct { typedef struct { uint32_t cluster_id; - char is_null; /* NULL may result from a NULL geometry input, or it may be used by - algorithms such as DBSCAN that do not assign all inputs to a - cluster. */ + uint8_t is_null; /* NULL may result from a NULL geometry input, or it may be used by + algorithms such as DBSCAN that do not assign all inputs to a + cluster. */ } cluster_entry; typedef struct { - char is_error; + uint8_t is_error; cluster_entry clusters[1]; } cluster_context; @@ -129,7 +129,7 @@ Datum ST_ClusterDBSCAN(PG_FUNCTION_ARGS) uint32_t i; uint32_t* result_ids; LWGEOM** geoms; - char* is_in_cluster = NULL; + uint8_t *is_in_cluster = NULL; UNIONFIND* uf; bool tolerance_is_null; bool minpoints_is_null; @@ -1035,5 +1035,3 @@ Datum ST_CoverageUnion(PG_FUNCTION_ARGS) PG_RETURN_POINTER(result); } - - ----------------------------------------------------------------------- Summary of changes: .codespellrc | 3 +- .github/workflows/codespell.yml | 5 +++- GNUmakefile.in | 2 +- doc/po/zh_Hans/postgis-manual.po | 2 +- doc/xsl/postgis_comments.sql.xsl | 3 +- doc/xsl/raster_comments.sql.xsl | 6 ++-- doc/xsl/sfcgal_comments.sql.xsl | 3 +- doc/xsl/tiger_geocoder_comments.sql.xsl | 3 +- doc/xsl/topology_comments.sql.xsl | 3 +- liblwgeom/cunit/cu_geos_cluster.c | 4 +-- liblwgeom/cunit/cu_unionfind.c | 4 +-- liblwgeom/lwgeom_geos.c | 2 +- liblwgeom/lwgeom_geos.h | 7 ++++- liblwgeom/lwgeom_geos_cluster.c | 51 +++++++++++++++++++++++---------- liblwgeom/lwunionfind.c | 6 ++-- liblwgeom/lwunionfind.h | 3 +- postgis/lwgeom_geos.c | 12 ++++---- postgis/lwgeom_geos.h | 2 +- postgis/lwgeom_geos_predicates.c | 36 +++++++++++------------ postgis/lwgeom_window.c | 12 ++++---- utils/check_spelling.sh | 44 ++++++++++++++++++++++++++++ 21 files changed, 144 insertions(+), 69 deletions(-) create mode 100755 utils/check_spelling.sh hooks/post-receive -- PostGIS From git at osgeo.org Fri Mar 6 09:45:58 2026 From: git at osgeo.org (git at osgeo.org) Date: Fri, 6 Mar 2026 09:45:58 -0800 (PST) Subject: [SCM] PostGIS branch master updated. 3.6.0rc2-369-gbe42c3370 Message-ID: <20260306174558.9EF9A197C49@trac.osgeo.org> 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 be42c33700f1f4bd34ae8ee181509cf1e89de680 (commit) via 51fc9568c2fe7507600a97393dedba1d43f2d102 (commit) via ee2614b25095b2c256a8f167601e68605587f93d (commit) from 67d1d0640e2e01d1fff997372bf357250fecc90d (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 be42c33700f1f4bd34ae8ee181509cf1e89de680 Author: Darafei Praliaskouski Date: Fri Mar 6 21:28:47 2026 +0400 ci: run codespell directly with repo config diff --git a/.codespellrc b/.codespellrc index 964a27237..b68fd7fbf 100644 --- a/.codespellrc +++ b/.codespellrc @@ -1,4 +1,50 @@ [codespell] -# utils/check_spelling.sh builds a deterministic list of tracked files plus -# generated comment SQL. ignore-words = .codespell.ignore +skip = + ./deps/**, + ./extensions/address_standardizer/**, + ./extensions/*/sql/**, + ./extensions/*/sql_bits/*.sql, + ./extensions/postgis_tiger_geocoder/sql_bits/*.sql.in, + ./doc/html/**, + ./doc/po/**, + ./doc/postgis-out.xml, + ./doc/postgis-nospecial.xml, + ./postgis/*.sql, + ./raster/rt_pg/*.sql, + aclocal.m4, + configure, + libtool, + ./macros/libtool.m4, + spatial_ref_sys.sql, + ./postgis/*for_extension.sql, + ./postgis/*for_extension.sql.in, + ./raster/rt_pg/*for_extension.sql, + ./raster/rt_pg/*for_extension.sql.in, + ./raster/rt_pg/*upgrade*.sql, + ./raster/rt_pg/*upgrade*.sql.in, + ./regress/*garden_result.txt, + ./autom4te.cache/**, + ./build-aux/**, + .deps/**, + .libs/**, + **/.deps/**, + **/.libs/**, + ./regress/00-regress-install/**, + *.po, + *.o, + *.lo, + *.la, + *.a, + *.so, + *.so.*, + *.dll, + *.dylib, + *.pyc, + *.tmp, + *.generated, + *.needlessly-hardcoded, + *.gcda, + *.gcno, + *.gcov, + *~ diff --git a/.github/workflows/codespell.yml b/.github/workflows/codespell.yml index 617153b0b..a575d9bdd 100644 --- a/.github/workflows/codespell.yml +++ b/.github/workflows/codespell.yml @@ -22,11 +22,17 @@ jobs: - name: 'Install codespell' run: | sudo apt-get update - sudo apt-get install -y --no-install-recommends libxml2-utils docbook-xml docbook-xsl docbook-xsl-ns xsltproc + sudo apt-get install -y --no-install-recommends \ + autoconf automake libtool pkg-config \ + postgresql-server-dev-all \ + libgeos-dev libproj-dev libxml2-dev \ + libxml2-utils docbook-xml docbook-xsl docbook-xsl-ns xsltproc sudo pip install codespell - name: 'Build & Test' run: | codespell --version + ./autogen.sh + ./configure --without-raster --without-topology --without-sfcgal --without-json --without-protobuf make -C doc comments - ./utils/check_spelling.sh + codespell --config .codespellrc . diff --git a/GNUmakefile.in b/GNUmakefile.in index e468eed66..2318fc9a7 100644 --- a/GNUmakefile.in +++ b/GNUmakefile.in @@ -307,7 +307,7 @@ endif check-spell: ifneq (@CODESPELL@,) - cd $(top_srcdir) && ./utils/check_spelling.sh @CODESPELL@ + cd $(top_srcdir) && @CODESPELL@ --config .codespellrc . else @echo "SKIP: spell checking disabled" endif diff --git a/utils/check_spelling.sh b/utils/check_spelling.sh deleted file mode 100755 index 5537675ed..000000000 --- a/utils/check_spelling.sh +++ /dev/null @@ -1,44 +0,0 @@ -#!/bin/sh - -set -eu - -CODESPELL=${1:-codespell} - -ROOT=$(git rev-parse --show-toplevel 2>/dev/null || pwd) -cd "$ROOT" - -tmpfiles=$(mktemp) -trap 'rm -f "$tmpfiles"' EXIT HUP INT TERM - -# Keep the check deterministic by starting from tracked files and excluding -# vendor data, generated trees, and authoritative datasets that are not prose. -git ls-files -z -- . \ - ':(exclude)deps' \ - ':(exclude)extensions/address_standardizer' \ - ':(exclude)doc/html' \ - ':(exclude)doc/po' \ - ':(exclude)doc/postgis-out.xml' \ - ':(exclude)doc/postgis-nospecial.xml' \ - ':(exclude)aclocal.m4' \ - ':(exclude)configure' \ - ':(exclude)macros/libtool.m4' \ - ':(exclude)spatial_ref_sys.sql' \ - ':(exclude)extensions/postgis/sql/spatial_ref_sys.sql' \ - ':(glob,exclude)extensions/postgis/sql/postgis--*.sql' \ - ':(glob,exclude)**/*.po' \ - > "$tmpfiles" - -# The comment SQL files are generated from the docs and shipped in release -# artifacts, so include them when they exist. -for generated in doc/postgis_comments.sql \ - doc/raster_comments.sql \ - doc/sfcgal_comments.sql \ - doc/tiger_geocoder_comments.sql \ - doc/topology_comments.sql -do - if [ -f "$generated" ]; then - printf '%s\0' "$generated" >> "$tmpfiles" - fi -done - -xargs -0 "$CODESPELL" --config .codespellrc < "$tmpfiles" commit 51fc9568c2fe7507600a97393dedba1d43f2d102 Author: Darafei Praliaskouski Date: Fri Mar 6 20:58:20 2026 +0400 sfcgal/tests: restore 2-component alpha shape expectations diff --git a/sfcgal/regress/alphashape_components.sql b/sfcgal/regress/alphashape_components.sql index 3dcfa350c..38e896ffd 100644 --- a/sfcgal/regress/alphashape_components.sql +++ b/sfcgal/regress/alphashape_components.sql @@ -1,6 +1,4 @@ --- Normalize POLYGON vs MULTIPOLYGON output so this SFCGAL 2.3+ regression --- checks the stable shape result rather than a raw return-type difference. SELECT 'CG_Optimalalphashape_2components', - ST_AsText(ST_Normalize(ST_Multi(CG_OptimalAlphaShape('MULTIPOINT((10.1 0.2),(8.1 0.1),(6.0 0.0),(4.2 0.3),(2.5 1.0),(1.2 2.3),(0.4 4.0),(0.1 6.1),(0.3 8.2),(1.1 10.1),(2.6 11.2),(4.1 11.9),(6.2 12.1),(8.3 11.8),(10.2 11.1),(9.1 9.9),(7.6 9.8),(6.1 9.9),(4.8 9.2),(3.8 8.0),(3.6 6.2),(3.7 4.1),(4.6 2.9),(6.0 2.3),(7.8 2.2),(9.2 2.4),(40.3 0.4),(40.1 3.1),(39.8 6.2),(40.4 9.0),(40.2 12.3),(40.5 15.2),(41.9 15.6),(43.1 15.3),(54.3 15.2),(55.8 15.0),(55.6 12.1),(55.9 9.2),(55.5 6.0),(55.7 3.3),(55.4 0.5),(52.6 0.1),(49.8 -0.2),(46.9 2.8),(44.2 0.2),(42.1 0.3),(43.0 3.8),(43.3 7.1),(43.1 10.4),(52.9 10.6),(52.7 7.3),(52.8 4.1))', allow_holes => false, nb_components => 2)))); + ST_AsText(CG_OptimalAlphaShape('MULTIPOINT((10.1 0.2),(8.1 0.1),(6.0 0.0),(4.2 0.3),(2.5 1.0),(1.2 2.3),(0.4 4.0),(0.1 6.1),(0.3 8.2),(1.1 10.1),(2.6 11.2),(4.1 11.9),(6.2 12.1),(8.3 11.8),(10.2 11.1),(9.1 9.9),(7.6 9.8),(6.1 9.9),(4.8 9.2),(3.8 8.0),(3.6 6.2),(3.7 4.1),(4.6 2.9),(6.0 2.3),(7.8 2.2),(9.2 2.4),(40.3 0.4),(40.1 3.1),(39.8 6.2),(40.4 9.0),(40.2 12.3),(40.5 15.2),(41.9 15.6),(43.1 15.3),(54.3 15.2),(55.8 15.0),(55.6 12.1),(55.9 9.2),(55.5 6.0),(55.7 3.3),(55.4 0.5),(52.6 0.1),(49.8 -0.2),(46.9 2.8),(44.2 0.2),(42.1 0.3),(43.0 3.8),(43.3 7.1),(43.1 10.4),(52.9 10.6),(52.7 7.3),(52.8 4.1))', allow_holes => false, nb_components => 2)); SELECT 'CG_OptimalAlphaShape_hole_2components', - ST_AsText(ST_Normalize(ST_Multi(CG_OptimalAlphaShape('MULTIPOINT((0 0),(0 1),(0 2),(0 3),(0 4),(0 5),(0 6),(0 7),(0 8),(0 9),(1 10),(2 10),(3 10),(4 10),(4.5 9.5),(5 9),(5.5 8.5),(6 8),(6 7),(6 6),(5.5 5.5),(5 5),(4 5),(3 5),(2 5),(1 5),(1 4),(2 4),(3 4),(4 4),(4.5 3.5),(5 3),(6 2),(6 1),(5.5 0.5),(5 0),(4 0),(3 0),(2 0),(1 0),(0.5 0),(0.5 1),(0.5 2),(0.5 3),(0.5 4),(0.5 5),(0.5 6),(0.5 7),(0.5 8),(0.5 9),(0.5 10),(1 9.5),(2 9.5),(3 9.5),(4 9.5),(4.5 9),(5 8.5),(5.5 8),(5.5 7),(5.5 6),(5.5 6.5),(5 5.5),(4 5.5),(3 5.5),(2 5.5),(1 5.5),(1.5 4.5),(2.5 4.5),(3.5 4.5),(4 4.5),(4.5 4),(5 3.5),(5.5 3),(5.5 2),(5.5 1),(5 0.5),(4 0.5),(3 0.5),(2 0.5),(1 0.5),(12 0),(12 1),(12 2),(12 3),(12 4),(12 5),(12 6),(12 7),(12 8),(12 9),(12 10),(13 10),(14 10),(15 10),(16 10),(16.5 9.5),(17 9),(17.5 8.5),(18 8),(18 7),(18 6),(17.5 5.5),(17 5),(16 5),(15 5),(14 5),(13 5),(12.5 0),(12.5 1),(12.5 2),(12.5 3),(12.5 4),(12.5 5),(12.5 6),(12.5 7),(12.5 8),(12.5 9),(12.5 10),(13 9.5),(14 9.5),(15 9.5) ,(16 9.5),(16.5 9),(17 8.5),(17.5 8),(17.5 7),(17.5 6),(17.5 6.5),(17 5.5),(16 5.5),(15 5.5),(14 5.5),(13 5.5),(13 1),(13 2),(13 3),(13 4),(17.5 7.4),(18 7.3),(5.1 2.5),(5.8 2.5),(0.03 9.82),(0.23 10))', allow_holes => true, nb_components => 2)))); + ST_AsText(CG_OptimalAlphaShape('MULTIPOINT((0 0),(0 1),(0 2),(0 3),(0 4),(0 5),(0 6),(0 7),(0 8),(0 9),(1 10),(2 10),(3 10),(4 10),(4.5 9.5),(5 9),(5.5 8.5),(6 8),(6 7),(6 6),(5.5 5.5),(5 5),(4 5),(3 5),(2 5),(1 5),(1 4),(2 4),(3 4),(4 4),(4.5 3.5),(5 3),(6 2),(6 1),(5.5 0.5),(5 0),(4 0),(3 0),(2 0),(1 0),(0.5 0),(0.5 1),(0.5 2),(0.5 3),(0.5 4),(0.5 5),(0.5 6),(0.5 7),(0.5 8),(0.5 9),(0.5 10),(1 9.5),(2 9.5),(3 9.5),(4 9.5),(4.5 9),(5 8.5),(5.5 8),(5.5 7),(5.5 6),(5.5 6.5),(5 5.5),(4 5.5),(3 5.5),(2 5.5),(1 5.5),(1.5 4.5),(2.5 4.5),(3.5 4.5),(4 4.5),(4.5 4),(5 3.5),(5.5 3),(5.5 2),(5.5 1),(5 0.5),(4 0.5),(3 0.5),(2 0.5),(1 0.5),(12 0),(12 1),(12 2),(12 3),(12 4),(12 5),(12 6),(12 7),(12 8),(12 9),(12 10),(13 10),(14 10),(15 10),(16 10),(16.5 9.5),(17 9),(17.5 8.5),(18 8),(18 7),(18 6),(17.5 5.5),(17 5),(16 5),(15 5),(14 5),(13 5),(12.5 0),(12.5 1),(12.5 2),(12.5 3),(12.5 4),(12.5 5),(12.5 6),(12.5 7),(12.5 8),(12.5 9),(12.5 10),(13 9.5),(14 9.5),(15 9.5),(16 9.5),(16.5 9),(17 8.5),(17.5 8),(17.5 7),(17.5 6),(17.5 6.5),(17 5.5),(16 5.5),(15 5.5),(14 5.5),(13 5.5),(13 1),(13 2),(13 3),(13 4),(17.5 7.4),(18 7.3),(5.1 2.5),(5.8 2.5),(0.03 9.82),(0.23 10))', allow_holes => true, nb_components => 2)); diff --git a/sfcgal/regress/alphashape_components_expected b/sfcgal/regress/alphashape_components_expected index 00efc058f..a30a4ad59 100644 --- a/sfcgal/regress/alphashape_components_expected +++ b/sfcgal/regress/alphashape_components_expected @@ -1,2 +1,2 @@ -CG_Optimalalphashape_2components|MULTIPOLYGON(((39.8 6.2,40.4 9,40.2 12.3,40.5 15.2,41.9 15.6,43.1 15.3,43.1 10.4,43.3 7.1,46.9 2.8,52.8 4.1,52.7 7.3,52.9 10.6,54.3 15.2,55.8 15,55.6 12.1,55.9 9.2,55.5 6,55.7 3.3,55.4 0.5,52.6 0.1,49.8 -0.2,44.2 0.2,42.1 0.3,40.3 0.4,40.1 3.1,39.8 6.2)),((0.1 6.1,0.3 8.2,1.1 10.1,2.6 11.2,4.1 11.9,6.2 12.1,8.3 11.8,10.2 11.1,9.1 9.9,7.6 9.8,3.6 6.2,6 2.3,7.8 2.2,9.2 2.4,10.1 0.2,8.1 0.1,6 0,4.2 0.3,2.5 1,1.2 2.3,0.4 4,0.1 6.1))) -CG_OptimalAlphaShape_hole_2components|MULTIPOLYGON(((0 0,0 1,0 2,0 3,0 4,0 5,0 6,0 7,0 8,0 9,0.03 9.82,0.23 10,0.5 10,1 10,2 10,3 10,4 10,4.5 9.5,5 9,5.5 8.5,6 8,6 7,6 6,5.5 5.5,5 5,4 4.5,4.5 4,5 3.5,5.5 3,5.8 2.5,6 2,6 1,5.5 0.5,5 0,4 0,3 0,2 0,1 0,0.5 0,0 0),(0.5 6,1 5.5,2 5.5,3 5.5,4 5.5,5 5.5,5.5 6,5.5 6.5,5.5 7,5.5 8,5 8.5,4.5 9,4 9.5,3 9.5,2 9.5,1 9.5,0.5 9,0.5 8,0.5 7,0.5 6),(0.5 1,1 0.5,2 0.5,3 0.5,4 0.5,5 0.5,5.5 1,5.5 2,5.1 2.5,5 3,4.5 3.5,4 4,3 4,2 4,1 4,0.5 3,0.5 2,0.5 1)),((12 0,12 1,12 2,12 3,12 4,12 5,12 6,12 7,12 8,12 9,12 10,12.5 10,13 10,14 10,15 10,16 10,16.5 9.5,17 9,17.5 8.5,18 8,18 7.3,18 7,18 6,17.5 5.5,17 5,16 5,15 5,14 5,13 5,13 4,13 3,13 2,13 1,12.5 0,12 0),(12.5 6,13 5.5,14 5.5,15 5.5,16 5.5,17 5.5,17.5 6,17.5 6.5,17.5 7,17.5 7.4,17.5 8,17 8.5,16.5 9,16 9.5,15 9.5,14 9.5,13 9.5,12.5 9,12.5 8,12.5 7,12.5 6))) +CG_Optimalalphashape_2components|MULTIPOLYGON(((8.3 11.8,6.2 12.1,4.1 11.9,2.6 11.2,1.1 10.1,0.3 8.2,0.1 6.1,0.4 4,1.2 2.3,2.5 1,4.2 0.3,6 0,8.1 0.1,10.1 0.2,9.2 2.4,7.8 2.2,6 2.3,3.6 6.2,7.6 9.8,9.1 9.9,10.2 11.1,8.3 11.8)),((55.6 12.1,55.8 15,54.3 15.2,52.9 10.6,52.7 7.3,52.8 4.1,46.9 2.8,43.3 7.1,43.1 10.4,43.1 15.3,41.9 15.6,40.5 15.2,40.2 12.3,40.4 9,39.8 6.2,40.1 3.1,40.3 0.4,42.1 0.3,44.2 0.2,49.8 -0.2,52.6 0.1,55.4 0.5,55.7 3.3,55.5 6,55.9 9.2,55.6 12.1))) +CG_OptimalAlphaShape_hole_2components|MULTIPOLYGON(((5.5 8.5,5 9,4.5 9.5,4 10,3 10,2 10,1 10,0.5 10,0.23 10,0.03 9.82,0 9,0 8,0 7,0 6,0 5,0 4,0 3,0 2,0 1,0 0,0.5 0,1 0,2 0,3 0,4 0,5 0,5.5 0.5,6 1,6 2,5.8 2.5,5.5 3,5 3.5,4.5 4,4 4.5,5 5,5.5 5.5,6 6,6 7,6 8,5.5 8.5),(0.5 2,0.5 3,1 4,2 4,3 4,4 4,4.5 3.5,5 3,5.1 2.5,5.5 2,5.5 1,5 0.5,4 0.5,3 0.5,2 0.5,1 0.5,0.5 1,0.5 2),(0.5 7,0.5 8,0.5 9,1 9.5,2 9.5,3 9.5,4 9.5,4.5 9,5 8.5,5.5 8,5.5 7,5.5 6.5,5.5 6,5 5.5,4 5.5,3 5.5,2 5.5,1 5.5,0.5 6,0.5 7)),((17.5 8.5,17 9,16.5 9.5,16 10,15 10,14 10,13 10,12.5 10,12 10,12 9,12 8,12 7,12 6,12 5,12 4,12 3,12 2,12 1,12 0,12.5 0,13 1,13 2,13 3,13 4,13 5,14 5,15 5,16 5,17 5,17.5 5.5,18 6,18 7,18 7.3,18 8,17.5 8.5),(12.5 7,12.5 8,12.5 9,13 9.5,14 9.5,15 9.5,16 9.5,16.5 9,17 8.5,17.5 8,17.5 7.4,17.5 7,17.5 6.5,17.5 6,17 5.5,16 5.5,15 5.5,14 5.5,13 5.5,12.5 6,12.5 7))) commit ee2614b25095b2c256a8f167601e68605587f93d Author: Darafei Praliaskouski Date: Fri Mar 6 20:41:35 2026 +0400 doc/uk: fix localized XML markup diff --git a/doc/po/uk/postgis-manual.po b/doc/po/uk/postgis-manual.po index 62e629932..9cb094ad0 100644 --- a/doc/po/uk/postgis-manual.po +++ b/doc/po/uk/postgis-manual.po @@ -4750,7 +4750,7 @@ msgid "" "topogeometries created before the upgrade. This function fixes this " "corruption in affected tables." msgstr "" -"??? ????????? ????????? PostGIS <3.6.0 ?? ?????? >3.6.0+ ???? ??????? " +"??? ????????? ????????? PostGIS <3.6.0 ?? ?????? >3.6.0+ ???? ??????? " "?????????? ??????? topogeometry. ?? ?????????? ??????????? ?????????????, " "????????? ?? ?????????. ?? ??????? ????????? ?? ??????????? ? ???????? " "????????." @@ -8653,7 +8653,7 @@ msgid "" msgstr "" "??? ????????? ?????????, ?? ???????????????? ? ????????????, ????????? " "???????? GraphicsMagick (gm convert). GraphicsMagick " -"???????? ?? ??????? " +"???????? ?? ??????? " "http://www.graphicsmagick.org/ ." #. Tag: title @@ -44475,8 +44475,8 @@ msgid "" "postgresql.org/docs/current/rowtypes.html\">composite data type " "containing the fields:" msgstr "" -"geometry_dump ? ?? ???????? ??? ?????, ?? " +"geometry_dump ? ?? ???????? ??? ?????, ?? " "??????? ???? ????:" #. Tag: para ----------------------------------------------------------------------- Summary of changes: .codespellrc | 50 +++++++++++++++++++++++++-- .github/workflows/codespell.yml | 10 ++++-- GNUmakefile.in | 2 +- doc/po/uk/postgis-manual.po | 8 ++--- sfcgal/regress/alphashape_components.sql | 6 ++-- sfcgal/regress/alphashape_components_expected | 4 +-- utils/check_spelling.sh | 44 ----------------------- 7 files changed, 65 insertions(+), 59 deletions(-) delete mode 100755 utils/check_spelling.sh hooks/post-receive -- PostGIS From git at osgeo.org Fri Mar 6 10:41:36 2026 From: git at osgeo.org (git at osgeo.org) Date: Fri, 6 Mar 2026 10:41:36 -0800 (PST) Subject: [SCM] PostGIS branch master updated. 3.6.0rc2-370-g9346e2beb Message-ID: <20260306184136.3F2EE188537@trac.osgeo.org> 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 9346e2beb44b2b6c873f48dc62e5a2699ef48d44 (commit) from be42c33700f1f4bd34ae8ee181509cf1e89de680 (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 9346e2beb44b2b6c873f48dc62e5a2699ef48d44 Author: Darafei Praliaskouski Date: Fri Mar 6 21:52:02 2026 +0400 ci: drop PostgreSQL dev package from codespell job diff --git a/.github/workflows/codespell.yml b/.github/workflows/codespell.yml index a575d9bdd..2549dbc79 100644 --- a/.github/workflows/codespell.yml +++ b/.github/workflows/codespell.yml @@ -23,11 +23,10 @@ jobs: run: | sudo apt-get update sudo apt-get install -y --no-install-recommends \ + codespell \ autoconf automake libtool pkg-config \ - postgresql-server-dev-all \ libgeos-dev libproj-dev libxml2-dev \ libxml2-utils docbook-xml docbook-xsl docbook-xsl-ns xsltproc - sudo pip install codespell - name: 'Build & Test' run: | ----------------------------------------------------------------------- Summary of changes: .github/workflows/codespell.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) hooks/post-receive -- PostGIS From git at osgeo.org Fri Mar 6 11:01:15 2026 From: git at osgeo.org (git at osgeo.org) Date: Fri, 6 Mar 2026 11:01:15 -0800 (PST) Subject: [SCM] PostGIS branch master updated. 3.6.0rc2-371-g15349103e Message-ID: <20260306190115.D7F4D1886BD@trac.osgeo.org> 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 15349103ef89627d9be54a67bd81eabed3ca1072 (commit) from 9346e2beb44b2b6c873f48dc62e5a2699ef48d44 (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 15349103ef89627d9be54a67bd81eabed3ca1072 Author: Darafei Praliaskouski Date: Fri Mar 6 22:59:46 2026 +0400 ci: note why codespell still uses pip diff --git a/.github/workflows/codespell.yml b/.github/workflows/codespell.yml index 2549dbc79..efb5f0bf5 100644 --- a/.github/workflows/codespell.yml +++ b/.github/workflows/codespell.yml @@ -23,10 +23,12 @@ jobs: run: | sudo apt-get update sudo apt-get install -y --no-install-recommends \ - codespell \ autoconf automake libtool pkg-config \ libgeos-dev libproj-dev libxml2-dev \ libxml2-utils docbook-xml docbook-xsl docbook-xsl-ns xsltproc + # Ubuntu's packaged codespell is too old for the skip globs in .codespellrc, + # which makes the job scan generated/vendor trees and fail noisily. + sudo pip install codespell - name: 'Build & Test' run: | ----------------------------------------------------------------------- Summary of changes: .github/workflows/codespell.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) hooks/post-receive -- PostGIS From trac at osgeo.org Fri Mar 6 12:58:44 2026 From: trac at osgeo.org (PostGIS) Date: Fri, 06 Mar 2026 20:58:44 -0000 Subject: [PostGIS] #6055: Specify search_path carefully during extension install Message-ID: <049.b6be645ea57dbb71051ae75581b93595@osgeo.org> #6055: Specify search_path carefully during extension install ---------------------+--------------------------- Reporter: pramsey | Owner: pramsey Type: defect | Status: new Priority: high | Milestone: PostGIS 3.6.2 Component: postgis | Version: 3.2.x Keywords: | ---------------------+--------------------------- In order to keep the permissions situation clean during extension install. -- Ticket URL: PostGIS The PostGIS Trac is used for bug, enhancement & task tracking, a user and developer wiki, and a view into the subversion code repository of PostGIS project. From git at osgeo.org Fri Mar 6 13:11:45 2026 From: git at osgeo.org (git at osgeo.org) Date: Fri, 6 Mar 2026 13:11:45 -0800 (PST) Subject: [SCM] PostGIS branch stable-3.3 updated. 3.3.9-4-g9562c2020 Message-ID: <20260306211145.B9BFF197DFD@trac.osgeo.org> 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.3 has been updated via 9562c2020b0ecac01cec2d7877666425b41e81a8 (commit) from 1ff46f6490e1ffb1506d9f6bf84188b9179282e7 (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 9562c2020b0ecac01cec2d7877666425b41e81a8 Author: Paul Ramsey Date: Fri Mar 6 13:11:11 2026 -0800 Remove rare extension priv escalation case, where account with extension create privs can escalate to superuser by piggy backing on an extension creation event. From Sven Klemm (Tiger Data) and Allistair Ishmael Hakim (allistair.sh) References #6055 diff --git a/NEWS b/NEWS index ff1eb5bf2..95563125a 100644 --- a/NEWS +++ b/NEWS @@ -4,7 +4,10 @@ PostGIS 3.3.10 * Bug Fixes and Enhancements * - #5998, [tiger_geododer] Do not create tiger_data as part - of postgis_tiger_geocoder extension, create/update (Regina Obe) + of postgis_tiger_geocoder extension, create/update (Regina Obe) + - #6055, Remove rare extension priv escalation case. + Reported by Sven Klemm (Tiger Data) and Allistair Ishmael Hakim (allistair.sh) + PostGIS 3.3.9 2026-02-09 diff --git a/libpgcommon/sql/AddToSearchPath.sql.inc b/libpgcommon/sql/AddToSearchPath.sql.inc index a5e02279e..ff313406c 100644 --- a/libpgcommon/sql/AddToSearchPath.sql.inc +++ b/libpgcommon/sql/AddToSearchPath.sql.inc @@ -16,10 +16,10 @@ DECLARE BEGIN WITH settings AS ( SELECT unnest(setconfig) config - FROM pg_db_role_setting + FROM pg_catalog.pg_db_role_setting WHERE setdatabase = ( SELECT oid - FROM pg_database + FROM pg_catalog.pg_database WHERE datname = current_database() ) and setrole = 0 ) @@ -30,10 +30,10 @@ BEGIN RAISE NOTICE 'cur_search_path from pg_db_role_setting is %', var_cur_search_path; -- only run this test if person creating the extension is a super user - IF var_cur_search_path IS NULL AND (SELECT rolsuper FROM pg_roles where rolname = CURRENT_USER) THEN + IF var_cur_search_path IS NULL AND (SELECT rolsuper FROM pg_catalog.pg_roles where rolname = CURRENT_USER) THEN SELECT setting INTO var_cur_search_path - FROM pg_file_settings + FROM pg_catalog.pg_file_settings WHERE name = 'search_path' AND applied; RAISE NOTICE 'cur_search_path from pg_file_settings is %', var_cur_search_path; @@ -42,7 +42,7 @@ BEGIN IF var_cur_search_path IS NULL THEN SELECT boot_val INTO var_cur_search_path - FROM pg_settings + FROM pg_catalog.pg_settings WHERE name = 'search_path'; RAISE NOTICE 'cur_search_path from pg_settings is %', var_cur_search_path; @@ -63,7 +63,8 @@ BEGIN RETURN var_result; END $BODY$ -SET search_path = pg_catalog -- make safe +-- explicitly move pg_temp after pg_catalog in search path +SET search_path = pg_catalog, pg_temp LANGUAGE 'plpgsql' VOLATILE STRICT ; ----------------------------------------------------------------------- Summary of changes: NEWS | 5 ++++- libpgcommon/sql/AddToSearchPath.sql.inc | 13 +++++++------ 2 files changed, 11 insertions(+), 7 deletions(-) hooks/post-receive -- PostGIS From trac at osgeo.org Fri Mar 6 13:11:56 2026 From: trac at osgeo.org (PostGIS) Date: Fri, 06 Mar 2026 21:11:56 -0000 Subject: [PostGIS] #6055: Specify search_path carefully during extension install In-Reply-To: <049.b6be645ea57dbb71051ae75581b93595@osgeo.org> References: <049.b6be645ea57dbb71051ae75581b93595@osgeo.org> Message-ID: <064.2cfae4dc0297d1034d37f0188d237d9c@osgeo.org> #6055: Specify search_path carefully during extension install ----------------------+--------------------------- Reporter: pramsey | Owner: pramsey Type: defect | Status: new Priority: high | Milestone: PostGIS 3.6.2 Component: postgis | Version: 3.2.x Resolution: | Keywords: ----------------------+--------------------------- Comment (by Paul Ramsey ): In [changeset:"9562c2020b0ecac01cec2d7877666425b41e81a8/git" 9562c20/git]: {{{#!CommitTicketReference repository="git" revision="9562c2020b0ecac01cec2d7877666425b41e81a8" Remove rare extension priv escalation case, where account with extension create privs can escalate to superuser by piggy backing on an extension creation event. From Sven Klemm (Tiger Data) and Allistair Ishmael Hakim (allistair.sh) References #6055 }}} -- Ticket URL: PostGIS The PostGIS Trac is used for bug, enhancement & task tracking, a user and developer wiki, and a view into the subversion code repository of PostGIS project. From git at osgeo.org Fri Mar 6 13:13:18 2026 From: git at osgeo.org (git at osgeo.org) Date: Fri, 6 Mar 2026 13:13:18 -0800 (PST) Subject: [SCM] PostGIS branch stable-3.5 updated. 3.5.5-2-gd1b44c115 Message-ID: <20260306211318.7B168189495@trac.osgeo.org> 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.5 has been updated via d1b44c115e202fbec8fb6238f821f38b7efc6ef0 (commit) from 9e5f4cbde747366e62bcd93a9ac30601e310fa6f (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 d1b44c115e202fbec8fb6238f821f38b7efc6ef0 Author: Paul Ramsey Date: Fri Mar 6 13:13:06 2026 -0800 Remove rare extension priv escalation case, where account with extension create privs can escalate to superuser by piggy backing on an extension creation event. From Sven Klemm (Tiger Data) and Allistair Ishmael Hakim (allistair.sh) References #6055 diff --git a/NEWS b/NEWS index 3dead9499..a66c75e0d 100644 --- a/NEWS +++ b/NEWS @@ -6,6 +6,10 @@ PostgreSQL 12-18 required. GEOS 3.8+ required. Proj 6.1+ required. * Bug fixes * + - #6055, Remove rare extension priv escalation case. + Reported by Sven Klemm (Tiger Data) and Allistair Ishmael Hakim (allistair.sh) + + PostGIS 3.5.5 2026/02/09 diff --git a/libpgcommon/sql/AddToSearchPath.sql.inc b/libpgcommon/sql/AddToSearchPath.sql.inc index a5e02279e..ff313406c 100644 --- a/libpgcommon/sql/AddToSearchPath.sql.inc +++ b/libpgcommon/sql/AddToSearchPath.sql.inc @@ -16,10 +16,10 @@ DECLARE BEGIN WITH settings AS ( SELECT unnest(setconfig) config - FROM pg_db_role_setting + FROM pg_catalog.pg_db_role_setting WHERE setdatabase = ( SELECT oid - FROM pg_database + FROM pg_catalog.pg_database WHERE datname = current_database() ) and setrole = 0 ) @@ -30,10 +30,10 @@ BEGIN RAISE NOTICE 'cur_search_path from pg_db_role_setting is %', var_cur_search_path; -- only run this test if person creating the extension is a super user - IF var_cur_search_path IS NULL AND (SELECT rolsuper FROM pg_roles where rolname = CURRENT_USER) THEN + IF var_cur_search_path IS NULL AND (SELECT rolsuper FROM pg_catalog.pg_roles where rolname = CURRENT_USER) THEN SELECT setting INTO var_cur_search_path - FROM pg_file_settings + FROM pg_catalog.pg_file_settings WHERE name = 'search_path' AND applied; RAISE NOTICE 'cur_search_path from pg_file_settings is %', var_cur_search_path; @@ -42,7 +42,7 @@ BEGIN IF var_cur_search_path IS NULL THEN SELECT boot_val INTO var_cur_search_path - FROM pg_settings + FROM pg_catalog.pg_settings WHERE name = 'search_path'; RAISE NOTICE 'cur_search_path from pg_settings is %', var_cur_search_path; @@ -63,7 +63,8 @@ BEGIN RETURN var_result; END $BODY$ -SET search_path = pg_catalog -- make safe +-- explicitly move pg_temp after pg_catalog in search path +SET search_path = pg_catalog, pg_temp LANGUAGE 'plpgsql' VOLATILE STRICT ; ----------------------------------------------------------------------- Summary of changes: NEWS | 4 ++++ libpgcommon/sql/AddToSearchPath.sql.inc | 13 +++++++------ 2 files changed, 11 insertions(+), 6 deletions(-) hooks/post-receive -- PostGIS From trac at osgeo.org Fri Mar 6 13:13:19 2026 From: trac at osgeo.org (PostGIS) Date: Fri, 06 Mar 2026 21:13:19 -0000 Subject: [PostGIS] #6055: Specify search_path carefully during extension install In-Reply-To: <049.b6be645ea57dbb71051ae75581b93595@osgeo.org> References: <049.b6be645ea57dbb71051ae75581b93595@osgeo.org> Message-ID: <064.6eb26462d610fdf96baa7f583f214187@osgeo.org> #6055: Specify search_path carefully during extension install ----------------------+--------------------------- Reporter: pramsey | Owner: pramsey Type: defect | Status: new Priority: high | Milestone: PostGIS 3.6.2 Component: postgis | Version: 3.2.x Resolution: | Keywords: ----------------------+--------------------------- Comment (by Paul Ramsey ): In [changeset:"d1b44c115e202fbec8fb6238f821f38b7efc6ef0/git" d1b44c1/git]: {{{#!CommitTicketReference repository="git" revision="d1b44c115e202fbec8fb6238f821f38b7efc6ef0" Remove rare extension priv escalation case, where account with extension create privs can escalate to superuser by piggy backing on an extension creation event. From Sven Klemm (Tiger Data) and Allistair Ishmael Hakim (allistair.sh) References #6055 }}} -- Ticket URL: PostGIS The PostGIS Trac is used for bug, enhancement & task tracking, a user and developer wiki, and a view into the subversion code repository of PostGIS project. From git at osgeo.org Fri Mar 6 13:14:17 2026 From: git at osgeo.org (git at osgeo.org) Date: Fri, 6 Mar 2026 13:14:17 -0800 (PST) Subject: [SCM] PostGIS branch stable-3.6 updated. 3.6.2-2-g20e9ab657 Message-ID: <20260306211417.ABAE9189422@trac.osgeo.org> 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.6 has been updated via 20e9ab6572a45f5264b033fc1414646a7c0d5190 (commit) from 815ee4faea67d929dc80cbb1f52c81085f31064d (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 20e9ab6572a45f5264b033fc1414646a7c0d5190 Author: Paul Ramsey Date: Fri Mar 6 13:14:06 2026 -0800 Remove rare extension priv escalation case, where account with extension create privs can escalate to superuser by piggy backing on an extension creation event. From Sven Klemm (Tiger Data) and Allistair Ishmael Hakim (allistair.sh) References #6055 diff --git a/NEWS b/NEWS index 362a04829..701e08eeb 100644 --- a/NEWS +++ b/NEWS @@ -15,6 +15,9 @@ topogeometry corruption: * Fixes * +- #6055, Remove rare extension priv escalation case. + Reported by Sven Klemm (Tiger Data) and Allistair Ishmael Hakim (allistair.sh) + PostGIS 3.6.2 2026/02/09 diff --git a/libpgcommon/sql/AddToSearchPath.sql.inc b/libpgcommon/sql/AddToSearchPath.sql.inc index a5e02279e..ff313406c 100644 --- a/libpgcommon/sql/AddToSearchPath.sql.inc +++ b/libpgcommon/sql/AddToSearchPath.sql.inc @@ -16,10 +16,10 @@ DECLARE BEGIN WITH settings AS ( SELECT unnest(setconfig) config - FROM pg_db_role_setting + FROM pg_catalog.pg_db_role_setting WHERE setdatabase = ( SELECT oid - FROM pg_database + FROM pg_catalog.pg_database WHERE datname = current_database() ) and setrole = 0 ) @@ -30,10 +30,10 @@ BEGIN RAISE NOTICE 'cur_search_path from pg_db_role_setting is %', var_cur_search_path; -- only run this test if person creating the extension is a super user - IF var_cur_search_path IS NULL AND (SELECT rolsuper FROM pg_roles where rolname = CURRENT_USER) THEN + IF var_cur_search_path IS NULL AND (SELECT rolsuper FROM pg_catalog.pg_roles where rolname = CURRENT_USER) THEN SELECT setting INTO var_cur_search_path - FROM pg_file_settings + FROM pg_catalog.pg_file_settings WHERE name = 'search_path' AND applied; RAISE NOTICE 'cur_search_path from pg_file_settings is %', var_cur_search_path; @@ -42,7 +42,7 @@ BEGIN IF var_cur_search_path IS NULL THEN SELECT boot_val INTO var_cur_search_path - FROM pg_settings + FROM pg_catalog.pg_settings WHERE name = 'search_path'; RAISE NOTICE 'cur_search_path from pg_settings is %', var_cur_search_path; @@ -63,7 +63,8 @@ BEGIN RETURN var_result; END $BODY$ -SET search_path = pg_catalog -- make safe +-- explicitly move pg_temp after pg_catalog in search path +SET search_path = pg_catalog, pg_temp LANGUAGE 'plpgsql' VOLATILE STRICT ; ----------------------------------------------------------------------- Summary of changes: NEWS | 3 +++ libpgcommon/sql/AddToSearchPath.sql.inc | 13 +++++++------ 2 files changed, 10 insertions(+), 6 deletions(-) hooks/post-receive -- PostGIS From trac at osgeo.org Fri Mar 6 13:14:19 2026 From: trac at osgeo.org (PostGIS) Date: Fri, 06 Mar 2026 21:14:19 -0000 Subject: [PostGIS] #6055: Specify search_path carefully during extension install In-Reply-To: <049.b6be645ea57dbb71051ae75581b93595@osgeo.org> References: <049.b6be645ea57dbb71051ae75581b93595@osgeo.org> Message-ID: <064.4769702f4ef135aac9817c4c33268446@osgeo.org> #6055: Specify search_path carefully during extension install ----------------------+--------------------------- Reporter: pramsey | Owner: pramsey Type: defect | Status: new Priority: high | Milestone: PostGIS 3.6.2 Component: postgis | Version: 3.2.x Resolution: | Keywords: ----------------------+--------------------------- Comment (by Paul Ramsey ): In [changeset:"20e9ab6572a45f5264b033fc1414646a7c0d5190/git" 20e9ab65/git]: {{{#!CommitTicketReference repository="git" revision="20e9ab6572a45f5264b033fc1414646a7c0d5190" Remove rare extension priv escalation case, where account with extension create privs can escalate to superuser by piggy backing on an extension creation event. From Sven Klemm (Tiger Data) and Allistair Ishmael Hakim (allistair.sh) References #6055 }}} -- Ticket URL: PostGIS The PostGIS Trac is used for bug, enhancement & task tracking, a user and developer wiki, and a view into the subversion code repository of PostGIS project. From git at osgeo.org Fri Mar 6 13:15:11 2026 From: git at osgeo.org (git at osgeo.org) Date: Fri, 6 Mar 2026 13:15:11 -0800 (PST) Subject: [SCM] PostGIS branch master updated. 3.6.0rc2-372-g88ad88be1 Message-ID: <20260306211511.EC5921890F7@trac.osgeo.org> 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 88ad88be10d113781a2a8f4e67820a3cdb40638b (commit) from 15349103ef89627d9be54a67bd81eabed3ca1072 (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 88ad88be10d113781a2a8f4e67820a3cdb40638b Author: Paul Ramsey Date: Fri Mar 6 11:28:09 2026 -0800 Remove rare extension priv escalation case, where account with extension create privs can escalate to superuser by piggy backing on an extension creation event. From Sven Klemm (Tiger Data) and Allistair Ishmael Hakim (allistair.sh) diff --git a/libpgcommon/sql/AddToSearchPath.sql.inc b/libpgcommon/sql/AddToSearchPath.sql.inc index a5e02279e..ff313406c 100644 --- a/libpgcommon/sql/AddToSearchPath.sql.inc +++ b/libpgcommon/sql/AddToSearchPath.sql.inc @@ -16,10 +16,10 @@ DECLARE BEGIN WITH settings AS ( SELECT unnest(setconfig) config - FROM pg_db_role_setting + FROM pg_catalog.pg_db_role_setting WHERE setdatabase = ( SELECT oid - FROM pg_database + FROM pg_catalog.pg_database WHERE datname = current_database() ) and setrole = 0 ) @@ -30,10 +30,10 @@ BEGIN RAISE NOTICE 'cur_search_path from pg_db_role_setting is %', var_cur_search_path; -- only run this test if person creating the extension is a super user - IF var_cur_search_path IS NULL AND (SELECT rolsuper FROM pg_roles where rolname = CURRENT_USER) THEN + IF var_cur_search_path IS NULL AND (SELECT rolsuper FROM pg_catalog.pg_roles where rolname = CURRENT_USER) THEN SELECT setting INTO var_cur_search_path - FROM pg_file_settings + FROM pg_catalog.pg_file_settings WHERE name = 'search_path' AND applied; RAISE NOTICE 'cur_search_path from pg_file_settings is %', var_cur_search_path; @@ -42,7 +42,7 @@ BEGIN IF var_cur_search_path IS NULL THEN SELECT boot_val INTO var_cur_search_path - FROM pg_settings + FROM pg_catalog.pg_settings WHERE name = 'search_path'; RAISE NOTICE 'cur_search_path from pg_settings is %', var_cur_search_path; @@ -63,7 +63,8 @@ BEGIN RETURN var_result; END $BODY$ -SET search_path = pg_catalog -- make safe +-- explicitly move pg_temp after pg_catalog in search path +SET search_path = pg_catalog, pg_temp LANGUAGE 'plpgsql' VOLATILE STRICT ; ----------------------------------------------------------------------- Summary of changes: libpgcommon/sql/AddToSearchPath.sql.inc | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) hooks/post-receive -- PostGIS From trac at osgeo.org Fri Mar 6 13:15:30 2026 From: trac at osgeo.org (PostGIS) Date: Fri, 06 Mar 2026 21:15:30 -0000 Subject: [PostGIS] #6055: Specify search_path carefully during extension install In-Reply-To: <049.b6be645ea57dbb71051ae75581b93595@osgeo.org> References: <049.b6be645ea57dbb71051ae75581b93595@osgeo.org> Message-ID: <064.ec3b6705cd66b5ceaf05b306a3ea3db5@osgeo.org> #6055: Specify search_path carefully during extension install ----------------------+--------------------------- Reporter: pramsey | Owner: pramsey Type: defect | Status: closed Priority: high | Milestone: PostGIS 3.6.2 Component: postgis | Version: 3.2.x Resolution: fixed | Keywords: ----------------------+--------------------------- Changes (by pramsey): * resolution: => fixed * status: new => closed -- Ticket URL: PostGIS The PostGIS Trac is used for bug, enhancement & task tracking, a user and developer wiki, and a view into the subversion code repository of PostGIS project. From git at osgeo.org Sat Mar 7 03:01:57 2026 From: git at osgeo.org (git at osgeo.org) Date: Sat, 7 Mar 2026 03:01:57 -0800 (PST) Subject: [SCM] PostGIS branch master updated. 3.6.0rc2-373-g14152529d Message-ID: <20260307110157.9E1CC18C124@trac.osgeo.org> 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 14152529d3f3008be89dbc76505521e819ae78d5 (commit) from 88ad88be10d113781a2a8f4e67820a3cdb40638b (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 14152529d3f3008be89dbc76505521e819ae78d5 Author: Darafei Praliaskouski Date: Sat Mar 7 15:00:33 2026 +0400 Fix 32-bit topology and coverage crashes Two CI failures on i386 came from hard-coded Datum and stack struct assumptions that only break on 32-bit builds. In coverage_window_calculation(), the simplifyBoundary argument is declared as boolean in SQL, but the C code decoded it with DatumGetFloat8(). On 32-bit PostgreSQL float8 is pass-by-reference, so reading a bool Datum that way can dereference garbage and crash the backend while running coverage.sql. Decode the argument with DatumGetBool() instead. In the topology SPI backend, several callbacks unconditionally decoded topology primitive IDs with DatumGetInt64() and one face callback always built an INT8[] argument. Topology schemas still default to INT4 IDs unless usesLargeIDs is enabled, so those assumptions are wrong on 32-bit and caused addnode.sql to segfault or raise unsupported byval length errors. Load usesLargeIDs from topology.topology, decode tuple values using their actual column type, and build the face ID array with the matching integer width. Also zero-initialize temporary LWT_ISO_EDGE stack structs on edge split paths so callback update/select filters do not carry uninitialized fields into backend operations. diff --git a/liblwgeom/topo/lwgeom_topo.c b/liblwgeom/topo/lwgeom_topo.c index 07e7ba7cd..d92737705 100644 --- a/liblwgeom/topo/lwgeom_topo.c +++ b/liblwgeom/topo/lwgeom_topo.c @@ -1188,8 +1188,8 @@ lwt_ModEdgeSplit( LWT_TOPOLOGY* topo, LWT_ELEMID edge, LWCOLLECTION *split_col; const LWGEOM *oldedge_geom; const LWGEOM *newedge_geom; - LWT_ISO_EDGE newedge1; - LWT_ISO_EDGE seledge, updedge, excedge; + LWT_ISO_EDGE newedge1 = {0}; + LWT_ISO_EDGE seledge = {0}, updedge = {0}, excedge = {0}; int ret; split_col = _lwt_EdgeSplit( topo, edge, pt, skipISOChecks, &oldedge ); @@ -1345,8 +1345,8 @@ lwt_NewEdgesSplit( LWT_TOPOLOGY* topo, LWT_ELEMID edge, LWCOLLECTION *split_col; const LWGEOM *oldedge_geom; const LWGEOM *newedge_geom; - LWT_ISO_EDGE newedges[2]; - LWT_ISO_EDGE seledge, updedge; + LWT_ISO_EDGE newedges[2] = {{0}}; + LWT_ISO_EDGE seledge = {0}, updedge = {0}; int ret; split_col = _lwt_EdgeSplit( topo, edge, pt, skipISOChecks, &oldedge ); @@ -5611,10 +5611,9 @@ _lwt_SnapEdgeToExistingNode( replacedBy[n] = existingEdgeId; } - - LWT_ISO_EDGE updatedEdge; + LWT_ISO_EDGE updatedEdge = {0}; int updateFlags; - LWT_ISO_EDGE selEdge; + LWT_ISO_EDGE selEdge = {0}; if ( ( replacedBy[0] != 0 && replacedBy[1] == 0 ) || ( replacedBy[1] != 0 && replacedBy[0] == 0 ) ) @@ -6129,7 +6128,7 @@ _lwt_SnapEdgeToExistingNode( /* Neither sides of the snapped edge collapsed to an existing edge */ /* New edge is the outgoing one, by design */ - LWT_ISO_EDGE newEdge; + LWT_ISO_EDGE newEdge = {0}; newEdge.edge_id = lwt_be_getNextEdgeId( topo ); if ( newEdge.edge_id == -1 ) { PGTOPO_BE_ERROR(); diff --git a/postgis/lwgeom_window.c b/postgis/lwgeom_window.c index 409b94503..920f2716d 100644 --- a/postgis/lwgeom_window.c +++ b/postgis/lwgeom_window.c @@ -784,7 +784,9 @@ coverage_window_calculation(PG_FUNCTION_ARGS, int mode) if (!isnull) tolerance = DatumGetFloat8(d); d = WinGetFuncArgCurrent(winobj, 2, &isnull); - if (!isnull) simplifyBoundary = DatumGetFloat8(d); + /* The third SQL argument is boolean, which matters on 32-bit builds. */ + if (!isnull) + simplifyBoundary = DatumGetBool(d); /* GEOSCoverageSimplifyVW is "preserveBoundary" so we invert simplifyBoundary */ output = GEOSCoverageSimplifyVW(input, tolerance, !simplifyBoundary); diff --git a/topology/postgis_topology.c b/topology/postgis_topology.c index 7707ece2b..b815cb901 100644 --- a/topology/postgis_topology.c +++ b/topology/postgis_topology.c @@ -92,6 +92,7 @@ struct LWT_BE_TOPOLOGY_T int32_t srid; double precision; int hasZ; + bool usesLargeIDs; Oid geometryOID; }; @@ -180,8 +181,8 @@ cb_loadTopologyByName(const LWT_BE_DATA* be, const char *name) argtypes[0] = CSTRINGOID; sql = - "SELECT id,srid,precision,null::geometry " - "FROM topology.topology WHERE name = $1::varchar"; + "SELECT id,srid,precision,null::geometry,useslargeids " + "FROM topology.topology WHERE name = $1::varchar"; if ( ! plan ) /* prepare on first call */ { plan = SPI_prepare(sql, 1, argtypes); @@ -226,6 +227,7 @@ cb_loadTopologyByName(const LWT_BE_DATA* be, const char *name) topo->be_data = (LWT_BE_DATA *)be; /* const cast.. */ topo->name = pstrdup(name); topo->hasZ = 0; + topo->usesLargeIDs = false; dat = SPI_getbinval(SPI_tuptable->vals[0], SPI_tuptable->tupdesc, 1, &isnull); if ( isnull ) @@ -262,6 +264,12 @@ cb_loadTopologyByName(const LWT_BE_DATA* be, const char *name) topo->precision = DatumGetFloat8(dat); } + dat = SPI_getbinval(SPI_tuptable->vals[0], SPI_tuptable->tupdesc, 5, &isnull); + if (!isnull) + { + topo->usesLargeIDs = DatumGetBool(dat); + } + /* we're dynamically querying geometry type here */ topo->geometryOID = TupleDescAttr(SPI_tuptable->tupdesc, 3)->atttypid; @@ -666,6 +674,31 @@ addFaceValues(StringInfo str, LWT_ISO_FACE *face, int32_t srid) } } +static int64 +tuple_get_int64(TupleDesc desc, int col, Datum dat) +{ + Oid typid = TupleDescAttr(desc, col - 1)->atttypid; + + /* + * Topology still defaults to INT4 primitive IDs unless usesLargeIDs is + * requested, so SPI tuple readers must honor the actual column type here. + */ + switch (typid) + { + case INT2OID: + return DatumGetInt16(dat); + case INT4OID: + return DatumGetInt32(dat); + case INT8OID: + return DatumGetInt64(dat); + case OIDOID: + return DatumGetObjectId(dat); + default: + lwpgerror("Unexpected integer type %u for column %d", typid, col); + return -1; + } +} + static void fillEdgeFields(LWT_ISO_EDGE* edge, HeapTuple row, TupleDesc rowdesc, int fields) { @@ -689,11 +722,13 @@ fillEdgeFields(LWT_ISO_EDGE* edge, HeapTuple row, TupleDesc rowdesc, int fields) } else { - val = DatumGetInt64(dat); - POSTGIS_DEBUGF(2, "fillEdgeFields: colno%d (edge_id)" - " has int64 val of %" LWTFMT_ELEMID, - colno, val); - edge->edge_id = val; + val = tuple_get_int64(rowdesc, colno, dat); + POSTGIS_DEBUGF(2, + "fillEdgeFields: colno%d (edge_id)" + " has int64 val of %" LWTFMT_ELEMID, + colno, + val); + edge->edge_id = val; } } @@ -707,10 +742,13 @@ fillEdgeFields(LWT_ISO_EDGE* edge, HeapTuple row, TupleDesc rowdesc, int fields) } else { - val = DatumGetInt64(dat); - POSTGIS_DEBUGF(2, "fillEdgeFields: colno%d (start_node)" - " has int64 val of %" LWTFMT_ELEMID, colno, val); - edge->start_node = val; + val = tuple_get_int64(rowdesc, colno, dat); + POSTGIS_DEBUGF(2, + "fillEdgeFields: colno%d (start_node)" + " has int64 val of %" LWTFMT_ELEMID, + colno, + val); + edge->start_node = val; } } if ( fields & LWT_COL_EDGE_END_NODE ) @@ -723,10 +761,13 @@ fillEdgeFields(LWT_ISO_EDGE* edge, HeapTuple row, TupleDesc rowdesc, int fields) } else { - val = DatumGetInt64(dat); - POSTGIS_DEBUGF(2, "fillEdgeFields: colno%d (end_node)" - " has int64 val of %" LWTFMT_ELEMID, colno, val); - edge->end_node = val; + val = tuple_get_int64(rowdesc, colno, dat); + POSTGIS_DEBUGF(2, + "fillEdgeFields: colno%d (end_node)" + " has int64 val of %" LWTFMT_ELEMID, + colno, + val); + edge->end_node = val; } } if ( fields & LWT_COL_EDGE_FACE_LEFT ) @@ -739,10 +780,13 @@ fillEdgeFields(LWT_ISO_EDGE* edge, HeapTuple row, TupleDesc rowdesc, int fields) } else { - val = DatumGetInt64(dat); - POSTGIS_DEBUGF(2, "fillEdgeFields: colno%d (face_left)" - " has int64 val of %" LWTFMT_ELEMID, colno, val); - edge->face_left = val; + val = tuple_get_int64(rowdesc, colno, dat); + POSTGIS_DEBUGF(2, + "fillEdgeFields: colno%d (face_left)" + " has int64 val of %" LWTFMT_ELEMID, + colno, + val); + edge->face_left = val; } } if ( fields & LWT_COL_EDGE_FACE_RIGHT ) @@ -755,10 +799,13 @@ fillEdgeFields(LWT_ISO_EDGE* edge, HeapTuple row, TupleDesc rowdesc, int fields) } else { - val = DatumGetInt64(dat); - POSTGIS_DEBUGF(2, "fillEdgeFields: colno%d (face_right)" - " has int64 val of %" LWTFMT_ELEMID, colno, val); - edge->face_right = val; + val = tuple_get_int64(rowdesc, colno, dat); + POSTGIS_DEBUGF(2, + "fillEdgeFields: colno%d (face_right)" + " has int64 val of %" LWTFMT_ELEMID, + colno, + val); + edge->face_right = val; } } if ( fields & LWT_COL_EDGE_NEXT_LEFT ) @@ -771,10 +818,13 @@ fillEdgeFields(LWT_ISO_EDGE* edge, HeapTuple row, TupleDesc rowdesc, int fields) } else { - val = DatumGetInt64(dat); - POSTGIS_DEBUGF(2, "fillEdgeFields: colno%d (next_left)" - " has int64 val of %" LWTFMT_ELEMID, colno, val); - edge->next_left = val; + val = tuple_get_int64(rowdesc, colno, dat); + POSTGIS_DEBUGF(2, + "fillEdgeFields: colno%d (next_left)" + " has int64 val of %" LWTFMT_ELEMID, + colno, + val); + edge->next_left = val; } } if ( fields & LWT_COL_EDGE_NEXT_RIGHT ) @@ -787,10 +837,13 @@ fillEdgeFields(LWT_ISO_EDGE* edge, HeapTuple row, TupleDesc rowdesc, int fields) } else { - val = DatumGetInt64(dat); - POSTGIS_DEBUGF(2, "fillEdgeFields: colno%d (next_right)" - " has int64 val of %" LWTFMT_ELEMID, colno, val); - edge->next_right = val; + val = tuple_get_int64(rowdesc, colno, dat); + POSTGIS_DEBUGF(2, + "fillEdgeFields: colno%d (next_right)" + " has int64 val of %" LWTFMT_ELEMID, + colno, + val); + edge->next_right = val; } } if ( fields & LWT_COL_EDGE_GEOM ) @@ -830,13 +883,14 @@ fillNodeFields(LWT_ISO_NODE* node, HeapTuple row, TupleDesc rowdesc, int fields) if ( fields & LWT_COL_NODE_NODE_ID ) { dat = SPI_getbinval(row, rowdesc, ++colno, &isnull); - node->node_id = DatumGetInt64(dat); + node->node_id = tuple_get_int64(rowdesc, colno, dat); } if ( fields & LWT_COL_NODE_CONTAINING_FACE ) { dat = SPI_getbinval(row, rowdesc, ++colno, &isnull); if ( isnull ) node->containing_face = -1; - else node->containing_face = DatumGetInt64(dat); + else + node->containing_face = tuple_get_int64(rowdesc, colno, dat); } if ( fields & LWT_COL_NODE_GEOM ) { @@ -870,7 +924,7 @@ fillFaceFields(LWT_ISO_FACE* face, HeapTuple row, TupleDesc rowdesc, int fields) if ( fields & LWT_COL_FACE_FACE_ID ) { dat = SPI_getbinval(row, rowdesc, ++colno, &isnull); - face->face_id = DatumGetInt64(dat); + face->face_id = tuple_get_int64(rowdesc, colno, dat); } if ( fields & LWT_COL_FACE_MBR ) { @@ -923,7 +977,7 @@ getNotNullInt64( HeapTuple row, TupleDesc desc, int col, int64 *val ) bool isnull; Datum dat = SPI_getbinval( row, desc, col, &isnull ); if ( isnull ) return 0; - *val = DatumGetInt64(dat); + *val = tuple_get_int64(desc, col, dat); return 1; } @@ -1058,12 +1112,24 @@ cb_getEdgeByFace(const LWT_BE_TOPOLOGY *topo, const LWT_ELEMID *ids, uint64_t *n Datum *datum_ids; Datum values[2]; Oid argtypes[2]; + Oid idtype; + Oid idarraytype; int nargs = 1; GSERIALIZED *gser = NULL; + int16 typlen; + bool typbyval; + char typalign; + /* Match the callback argument type to the topology schema's chosen ID width. */ + idtype = topo->usesLargeIDs ? INT8OID : INT4OID; + idarraytype = topo->usesLargeIDs ? INT8ARRAYOID : INT4ARRAYOID; + get_typlenbyvalalign(idtype, &typlen, &typbyval, &typalign); datum_ids = palloc(sizeof(Datum)*(*numelems)); - for (i=0; i<*numelems; ++i) datum_ids[i] = Int64GetDatum(ids[i]); - array_ids = construct_array(datum_ids, *numelems, INT8OID, 8, true, 's'); + for (i = 0; i < *numelems; ++i) + { + datum_ids[i] = topo->usesLargeIDs ? Int64GetDatum(ids[i]) : Int32GetDatum(ids[i]); + } + array_ids = construct_array(datum_ids, *numelems, idtype, typlen, typbyval, typalign); initStringInfo(sql); appendStringInfoString(sql, "SELECT "); @@ -1074,7 +1140,7 @@ cb_getEdgeByFace(const LWT_BE_TOPOLOGY *topo, const LWT_ELEMID *ids, uint64_t *n topo->name); values[0] = PointerGetDatum(array_ids); - argtypes[0] = INT8ARRAYOID; + argtypes[0] = idarraytype; if ( box ) { @@ -1256,7 +1322,7 @@ cb_getRingEdges(const LWT_BE_TOPOLOGY *topo, LWT_ELEMID edge, uint64_t *numelems *numelems = UINT64_MAX; return NULL; } - val = DatumGetInt64(dat); + val = tuple_get_int64(rowdesc, 1, dat); edges[i] = val; POSTGIS_DEBUGF(1, "Component " UINT64_FORMAT " in ring of edge %" LWTFMT_ELEMID " is edge %d", i, edge, val); @@ -1278,7 +1344,7 @@ cb_getRingEdges(const LWT_BE_TOPOLOGY *topo, LWT_ELEMID edge, uint64_t *numelems *numelems = UINT64_MAX; return NULL; } - nextedge = DatumGetInt64(dat); + nextedge = tuple_get_int64(rowdesc, sidecol, dat); POSTGIS_DEBUGF(1, "Last component in ring of edge %" LWTFMT_ELEMID " (%d) has next_%s_edge %d", edge, val, sidetext, nextedge); ----------------------------------------------------------------------- Summary of changes: liblwgeom/topo/lwgeom_topo.c | 15 ++--- postgis/lwgeom_window.c | 4 +- topology/postgis_topology.c | 148 +++++++++++++++++++++++++++++++------------ 3 files changed, 117 insertions(+), 50 deletions(-) hooks/post-receive -- PostGIS From git at osgeo.org Sat Mar 7 03:22:58 2026 From: git at osgeo.org (git at osgeo.org) Date: Sat, 7 Mar 2026 03:22:58 -0800 (PST) Subject: [SCM] PostGIS branch master updated. 3.6.0rc2-374-g1eb2fa4da Message-ID: <20260307112259.2C40918CB09@trac.osgeo.org> 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 1eb2fa4daa61a459bb7ae3375279aa7394f25183 (commit) from 14152529d3f3008be89dbc76505521e819ae78d5 (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 1eb2fa4daa61a459bb7ae3375279aa7394f25183 Author: Darafei Praliaskouski Date: Sat Mar 7 15:22:30 2026 +0400 fuzzers: install yacc tools for oss-fuzz builds PostGIS's OSS-Fuzz build now delegates dependency setup to fuzzers/install_oss_fuzz_build_deps.sh, but the script did not install bison/flex. That leaves the builder without yacc/lex tooling and causes the fuzz build to fail while regenerating lwin_wkt_parse.c with 'No yacc found, cannot build parser'. Add bison and flex to the OSS-Fuzz dependency installer so the upstream fuzz build has the parser generators it needs. diff --git a/fuzzers/install_oss_fuzz_build_deps.sh b/fuzzers/install_oss_fuzz_build_deps.sh index 992d20369..dd3475745 100755 --- a/fuzzers/install_oss_fuzz_build_deps.sh +++ b/fuzzers/install_oss_fuzz_build_deps.sh @@ -16,7 +16,7 @@ export DEBIAN_FRONTEND="${DEBIAN_FRONTEND:-noninteractive}" apt-get update apt-get install -y --no-install-recommends \ - make autoconf automake libtool g++ postgresql-server-dev-all \ + make autoconf automake libtool bison flex g++ postgresql-server-dev-all \ libgeos-dev libproj-dev libxml2-dev pkg-config libjson-c-dev \ libc++-dev libc++abi-dev patchelf ----------------------------------------------------------------------- Summary of changes: fuzzers/install_oss_fuzz_build_deps.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) hooks/post-receive -- PostGIS From git at osgeo.org Sun Mar 8 15:48:30 2026 From: git at osgeo.org (git at osgeo.org) Date: Sun, 8 Mar 2026 15:48:30 -0700 (PDT) Subject: [SCM] PostGIS branch master updated. 3.6.0rc2-378-g7af31bf2c Message-ID: <20260308224830.CAE451A9093@trac.osgeo.org> 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 7af31bf2cb1968d7f9f3a275e9723702788b8615 (commit) from 9025206e69f7e8865b26d61ff771eee8d236d614 (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 7af31bf2cb1968d7f9f3a275e9723702788b8615 Author: Darafei Praliaskouski Date: Mon Mar 9 02:46:35 2026 +0400 #5973: Respect pg_config bindir for utility installs Closes #5973 diff --git a/NEWS b/NEWS index 6ed876e0c..df835634c 100644 --- a/NEWS +++ b/NEWS @@ -32,6 +32,9 @@ This version requires GEOS 3.10 or higher * Bug Fixes * + - #5973, Install PostGIS utilities under `pg_config --bindir` by default + and document `pg_config`-derived install paths more accurately + (Darafei Praliaskouski) - #5948, [topology] Prevent MakeTopologyPrecise from erasing edges when grid size exceeds their extent (Darafei Praliaskouski) - #5959, Prevent histogram target overflow when analysing massive tables (Darafei Praliaskouski) diff --git a/README.postgis b/README.postgis index 21faf6dbf..ed38b126f 100644 --- a/README.postgis +++ b/README.postgis @@ -247,11 +247,9 @@ Installation paths will typically be derived by ``pg_config``: - Lib in ``pg_config --pkglibdir`` - Binaries (loader/dumper) in ``pg_config --bindir`` - - Important support files in ``[prefix]/share/contrib`` - - Manual pages in ``[prefix]/man`` - - Documentation in in ``[prefix]/share/doc`` - -Where `[prefix]` above is extracted from ``pg_config --configure``. + - Important support files in ``pg_config --sharedir``/contrib + - Manual pages in ``pg_config --mandir`` + - Documentation in ``pg_config --docdir`` You can change them using ``./configure`` switches. See CONFIGURATION section. diff --git a/configure.ac b/configure.ac index d5fb6cc1b..ce0e97a11 100644 --- a/configure.ac +++ b/configure.ac @@ -622,6 +622,15 @@ if test "x$SUPPORT_POSTGRESQL" = "xyes"; then dnl { AC_SUBST([PGSQL_BINDIR]) + dnl Keep explicit --bindir, --exec-prefix, and --prefix overrides, but + dnl default utilities to the PostgreSQL bindir when the autoconf install + dnl directories were left entirely untouched. + if test "x$bindir" = 'x${exec_prefix}/bin' \ + && test "x$exec_prefix" = xNONE \ + && test "x$prefix" = xNONE; then + bindir="$PGSQL_BINDIR" + fi + dnl Extract the share directory PGSQL_SHAREDIR=`"$PG_CONFIG" --sharedir` @@ -670,6 +679,7 @@ if test "$prefix" != "NONE" -a "x$PG_CONFIG" != "xno"; then AC_MSG_RESULT([ ignore the --prefix. For your info, using the values determined from ]) AC_MSG_RESULT([ $PG_CONFIG we will be installing: ]) AC_MSG_RESULT([ * postgis shared library in $PGSQL_LIBDIR ]) + AC_MSG_RESULT([ * postgis utilities in $bindir ]) AC_MSG_RESULT([ * postgis SQL files in $PGSQL_SHAREDIR/contrib/postgis-$POSTGIS_MAJOR_VERSION.$POSTGIS_MINOR_VERSION ]) AC_MSG_RESULT([------------------------------------------------------------------------]) fi @@ -2023,6 +2033,8 @@ fi if test "x$SUPPORT_POSTGRESQL" = "xyes"; then AC_MSG_RESULT([ PostgreSQL config: ${PG_CONFIG}]) AC_MSG_RESULT([ PostgreSQL version: ${PGSQL_FULL_VERSION}]) + AC_MSG_RESULT([ PostgreSQL bindir: ${PGSQL_BINDIR}]) + AC_MSG_RESULT([ PostGIS utilities: ${bindir}]) else AC_MSG_RESULT([ PostgreSQL support: DISABLED]) fi ----------------------------------------------------------------------- Summary of changes: NEWS | 3 +++ README.postgis | 8 +++----- configure.ac | 12 ++++++++++++ 3 files changed, 18 insertions(+), 5 deletions(-) hooks/post-receive -- PostGIS From trac at osgeo.org Sun Mar 8 15:48:32 2026 From: trac at osgeo.org (PostGIS) Date: Sun, 08 Mar 2026 22:48:32 -0000 Subject: [PostGIS] #5973: pg_config --bindir not being used as documented. In-Reply-To: <048.9c781bb140f3678f90149a87308440db@osgeo.org> References: <048.9c781bb140f3678f90149a87308440db@osgeo.org> Message-ID: <063.89c8a71c6771505339a5963937fb11eb@osgeo.org> #5973: pg_config --bindir not being used as documented. -----------------------------+--------------------------- Reporter: David Johnston | Owner: robe Type: defect | Status: closed Priority: low | Milestone: PostGIS 3.5.5 Component: documentation | Version: master Resolution: fixed | Keywords: -----------------------------+--------------------------- Changes (by Darafei Praliaskouski ): * resolution: => fixed * status: new => closed Comment: In [changeset:"7af31bf2cb1968d7f9f3a275e9723702788b8615/git" 7af31bf/git]: {{{#!CommitTicketReference repository="git" revision="7af31bf2cb1968d7f9f3a275e9723702788b8615" #5973: Respect pg_config bindir for utility installs Closes #5973 }}} -- Ticket URL: PostGIS The PostGIS Trac is used for bug, enhancement & task tracking, a user and developer wiki, and a view into the subversion code repository of PostGIS project. From git at osgeo.org Sun Mar 8 16:25:55 2026 From: git at osgeo.org (git at osgeo.org) Date: Sun, 8 Mar 2026 16:25:55 -0700 (PDT) Subject: [SCM] PostGIS branch master updated. 3.6.0rc2-379-ga586d720e Message-ID: <20260308232556.13D041A98AF@trac.osgeo.org> 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 a586d720eb01112b22052865feca01a6d4b6eb9e (commit) from 7af31bf2cb1968d7f9f3a275e9723702788b8615 (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 a586d720eb01112b22052865feca01a6d4b6eb9e Author: Darafei Praliaskouski Date: Mon Mar 9 03:24:04 2026 +0400 Fix #6048 ST_Clip sparse band selection crash Closes #6048 diff --git a/NEWS b/NEWS index df835634c..4bbdc0e1d 100644 --- a/NEWS +++ b/NEWS @@ -39,6 +39,8 @@ This version requires GEOS 3.10 or higher grid size exceeds their extent (Darafei Praliaskouski) - #5959, Prevent histogram target overflow when analysing massive tables (Darafei Praliaskouski) - #4828, geometry_columns handles NOT VALID SRID checks without errors (Darafei Praliaskouski) + - #6048, [raster] ST_Clip no longer crashes when clipping sparse band + selections (Darafei Praliaskouski) - #5645, Docs: keep code operators ("=>") intact in translated manuals by enforcing verbatim CSS (Darafei Praliaskouski) - #5593, Docs: render manual images with GraphicsMagick without temporary files, diff --git a/raster/rt_pg/rtpg_mapalgebra.c b/raster/rt_pg/rtpg_mapalgebra.c index c1cac17c3..bb173aa29 100644 --- a/raster/rt_pg/rtpg_mapalgebra.c +++ b/raster/rt_pg/rtpg_mapalgebra.c @@ -11,6 +11,7 @@ * Copyright (C) 2009-2011 Mateusz Loskot * Copyright (C) 2008-2009 Sandro Santilli * Copyright (C) 2013 Nathaniel Hunter Clay + * Copyright (C) 2026 Darafei Praliaskouski * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -2993,8 +2994,6 @@ Datum RASTER_clip(PG_FUNCTION_ARGS) bool typbyval; char typalign; - int i = 0; - int j = 0; int k = 0; rtpg_clip_arg arg = NULL; LWGEOM *tmpgeom = NULL; @@ -3004,12 +3003,6 @@ Datum RASTER_clip(PG_FUNCTION_ARGS) double nodataval; double offset[4] = {0.}; - int input_x = 0; - int input_y = 0; - int mask_x = 0; - int mask_y = 0; - int x = 0; - int y = 0; int width = 0; int height = 0; int mask_width = 0; @@ -3145,6 +3138,8 @@ Datum RASTER_clip(PG_FUNCTION_ARGS) /* nband (1) */ if (!PG_ARGISNULL(1)) { + uint32_t band_count = 0; + array = PG_GETARG_ARRAYTYPE_P(1); etype = ARR_ELEMTYPE(array); get_typlenbyvalalign(etype, &typlen, &typbyval, &typalign); @@ -3177,23 +3172,26 @@ Datum RASTER_clip(PG_FUNCTION_ARGS) PG_RETURN_NULL(); } - for (i = 0, j = 0; i < arg->numbands; i++) { - if (nulls[i]) continue; + for (uint32_t i = 0; i < (uint32_t)arg->numbands; i++) + { + if (nulls[i]) + continue; switch (etype) { case INT2OID: - arg->band[j].nband = DatumGetInt16(e[i]) - 1; + arg->band[band_count].nband = DatumGetInt16(e[i]) - 1; break; case INT4OID: - arg->band[j].nband = DatumGetInt32(e[i]) - 1; + arg->band[band_count].nband = DatumGetInt32(e[i]) - 1; break; } - j++; + band_count++; } - if (j < arg->numbands) { - arg->band = repalloc(arg->band, sizeof(struct rtpg_clip_band_t) * j); + if (band_count < (uint32_t)arg->numbands) + { + arg->band = repalloc(arg->band, sizeof(struct rtpg_clip_band_t) * band_count); if (arg->band == NULL) { rtpg_clip_arg_destroy(arg); PG_FREE_IF_COPY(pgraster, 0); @@ -3202,12 +3200,14 @@ Datum RASTER_clip(PG_FUNCTION_ARGS) PG_RETURN_NULL(); } - arg->numbands = j; + arg->numbands = (int)band_count; } /* validate band */ - for (i = 0; i < arg->numbands; i++) { - if (!rt_raster_has_band(arg->raster, arg->band[i].nband)) { + for (uint32_t i = 0; i < (uint32_t)arg->numbands; i++) + { + if (!rt_raster_has_band(arg->raster, arg->band[i].nband)) + { elog(NOTICE, "Band at index %d not found in raster", arg->band[i].nband + 1); rtpg_clip_arg_destroy(arg); PG_FREE_IF_COPY(pgraster, 0); @@ -3235,8 +3235,9 @@ Datum RASTER_clip(PG_FUNCTION_ARGS) PG_RETURN_NULL(); } - for (i = 0; i < arg->numbands; i++) { - arg->band[i].nband = i; + for (uint32_t i = 0; i < (uint32_t)arg->numbands; i++) + { + arg->band[i].nband = (int)i; arg->band[i].hasnodata = 0; arg->band[i].nodataval = 0; } @@ -3269,7 +3270,8 @@ Datum RASTER_clip(PG_FUNCTION_ARGS) ); /* it doesn't matter if there are more nodataval */ - for (i = 0, j = 0; i < arg->numbands; i++, j++) { + for (int32_t i = 0, j = 0; i < arg->numbands; i++, j++) + { /* cap j to the last nodataval element */ if (j >= k) j = k - 1; @@ -3359,8 +3361,16 @@ Datum RASTER_clip(PG_FUNCTION_ARGS) mask_band = rt_raster_get_band(arg->mask, 0); - for (i = 0; i < arg->numbands; i++) { + for (uint32_t i = 0; i < (uint32_t)arg->numbands; i++) + { input_band = rt_raster_get_band(arg->raster, arg->band[i].nband); + if (!input_band) + { + rtpg_clip_arg_destroy(arg); + PG_FREE_IF_COPY(pgraster, 0); + elog(ERROR, "RASTER_clip: Could not get input band at index %d", arg->band[i].nband); + PG_RETURN_NULL(); + } /* band metadata */ pixtype = rt_band_get_pixtype(input_band); @@ -3378,7 +3388,8 @@ Datum RASTER_clip(PG_FUNCTION_ARGS) nodataval = rt_band_get_min_value(input_band); } - if (rt_raster_generate_new_band(rtn, pixtype, nodataval, hasnodata, nodataval, i) < 0) { + if (rt_raster_generate_new_band(rtn, pixtype, nodataval, hasnodata, nodataval, (int)i) < 0) + { rtpg_clip_arg_destroy(arg); PG_FREE_IF_COPY(pgraster, 0); elog(ERROR, "RASTER_clip: Could not add new band in output raster"); @@ -3389,16 +3400,32 @@ Datum RASTER_clip(PG_FUNCTION_ARGS) continue; } - output_band = rt_raster_get_band(rtn, arg->band[i].nband); + /* + * Output bands are packed densely in request order, regardless of + * the source band numbers used to populate them. + */ + output_band = rt_raster_get_band(rtn, (int)i); + if (!output_band) + { + rtpg_clip_arg_destroy(arg); + PG_FREE_IF_COPY(pgraster, 0); + elog(ERROR, "RASTER_clip: Could not get output band at index %u", i); + PG_RETURN_NULL(); + } - if (!mask_band) { + if (!mask_band) + { continue; } - for (y = 0; y < height; y++) { - for (x = 0; x < width; x++) { - mask_x = x - (int)offset[2]; - mask_y = y - (int)offset[3]; + for (int y = 0; y < height; y++) + { + for (int x = 0; x < width; x++) + { + int mask_x = x - (int)offset[2]; + int mask_y = y - (int)offset[3]; + int input_x = x - (int)offset[0]; + int input_y = y - (int)offset[1]; if (!( mask_x >= 0 && @@ -3420,9 +3447,6 @@ Datum RASTER_clip(PG_FUNCTION_ARGS) continue; } - input_x = x - (int)offset[0]; - input_y = y - (int)offset[1]; - if (rt_band_get_pixel(input_band, input_x, input_y, &value, &isnodata) != ES_NONE) { rtpg_clip_arg_destroy(arg); PG_FREE_IF_COPY(pgraster, 0); diff --git a/raster/test/regress/rt_clip.sql b/raster/test/regress/rt_clip.sql index 462e73b21..af358506c 100644 --- a/raster/test/regress/rt_clip.sql +++ b/raster/test/regress/rt_clip.sql @@ -172,4 +172,61 @@ FROM ST_Clip( 1, '8BUI', 1, 0 ), ST_GeomFromText('POLYGON((0 0.0009999, 0.0001 0.0009999, 0.0001 0.0009, 0 0.0009, 0 0.0009999))') -) AS rast; \ No newline at end of file +) AS rast; + +-- #6048 clipping a sparse band selection should populate dense output bands +WITH test_rast AS ( + SELECT ST_AddBand( + ST_AddBand( + ST_AddBand( + ST_SetSRID( + ST_MakeEmptyRaster(4, 4, 0, 4, 1, -1, 0, 0), + 4326 + ), + '8BUI'::text, 11, 1 + ), + '8BUI'::text, 22, 2 + ), + '8BUI'::text, 33, 3 + ) AS rast +), test_geom AS ( + SELECT ST_SetSRID(ST_MakeEnvelope(1, 1, 3, 3), 4326) AS geom +) +SELECT '#6048.1', + ST_Width(rast), + ST_Height(rast), + ST_NumBands(rast), + ST_BandNoDataValue(rast, 1)::int, + ST_Value(rast, 1, 2, 2)::int +FROM ( + SELECT _ST_Clip(rast, ARRAY[3], geom, ARRAY[255, 255, 255], FALSE) AS rast + FROM test_rast, test_geom +) AS clipped; + +WITH test_rast AS ( + SELECT ST_AddBand( + ST_AddBand( + ST_AddBand( + ST_SetSRID( + ST_MakeEmptyRaster(4, 4, 0, 4, 1, -1, 0, 0), + 4326 + ), + '8BUI'::text, 11, 1 + ), + '8BUI'::text, 22, 2 + ), + '8BUI'::text, 33, 3 + ) AS rast +), test_geom AS ( + SELECT ST_SetSRID(ST_MakeEnvelope(1, 1, 3, 3), 4326) AS geom +) +SELECT '#6048.2', + ST_NumBands(rast), + ST_BandNoDataValue(rast, 1)::int, + ST_BandNoDataValue(rast, 2)::int, + ST_Value(rast, 1, 2, 2)::int, + ST_Value(rast, 2, 2, 2)::int +FROM ( + SELECT _ST_Clip(rast, ARRAY[3, 1], geom, ARRAY[253, 251], FALSE) AS rast + FROM test_rast, test_geom +) AS clipped; diff --git a/raster/test/regress/rt_clip_expected b/raster/test/regress/rt_clip_expected index c704cb356..c2754b520 100644 --- a/raster/test/regress/rt_clip_expected +++ b/raster/test/regress/rt_clip_expected @@ -1065,3 +1065,5 @@ 4|2|5|3|4|4|f|3|POLYGON((3 -3,4 -3,4 -4,3 -4,3 -3))|16 4|2|5|3|4|4|t|3|POLYGON((3 -3,4 -3,4 -4,3 -4,3 -3))|16 0|0.001|10|10 +#6048.1|4|4|1|255|33 +#6048.2|2|253|251|33|11 ----------------------------------------------------------------------- Summary of changes: NEWS | 2 + raster/rt_pg/rtpg_mapalgebra.c | 88 +++++++++++++++++++++++------------- raster/test/regress/rt_clip.sql | 59 +++++++++++++++++++++++- raster/test/regress/rt_clip_expected | 2 + 4 files changed, 118 insertions(+), 33 deletions(-) hooks/post-receive -- PostGIS From trac at osgeo.org Sun Mar 8 16:26:05 2026 From: trac at osgeo.org (PostGIS) Date: Sun, 08 Mar 2026 23:26:05 -0000 Subject: [PostGIS] #6048: postgis_raster crashes in rt_band_set_pixel due to NULL band pointer during ST_Clip operation In-Reply-To: <048.750ab04d7888c92a08ff4b0ad22cd50a@osgeo.org> References: <048.750ab04d7888c92a08ff4b0ad22cd50a@osgeo.org> Message-ID: <063.3a30c3f625925801215615eb08e2363a@osgeo.org> #6048: postgis_raster crashes in rt_band_set_pixel due to NULL band pointer during ST_Clip operation ---------------------+--------------------------- Reporter: maxmli | Owner: robe Type: defect | Status: closed Priority: medium | Milestone: PostGIS 3.7.0 Component: raster | Version: master Resolution: fixed | Keywords: ---------------------+--------------------------- Changes (by Darafei Praliaskouski ): * resolution: => fixed * status: new => closed Comment: In [changeset:"a586d720eb01112b22052865feca01a6d4b6eb9e/git" a586d72/git]: {{{#!CommitTicketReference repository="git" revision="a586d720eb01112b22052865feca01a6d4b6eb9e" Fix #6048 ST_Clip sparse band selection crash Closes #6048 }}} -- Ticket URL: PostGIS The PostGIS Trac is used for bug, enhancement & task tracking, a user and developer wiki, and a view into the subversion code repository of PostGIS project. From git at osgeo.org Mon Mar 9 02:09:48 2026 From: git at osgeo.org (git at osgeo.org) Date: Mon, 9 Mar 2026 02:09:48 -0700 (PDT) Subject: [SCM] PostGIS branch master updated. 3.6.0rc2-380-g20fcd89ae Message-ID: <20260309090949.4ED3D1AC2B0@trac.osgeo.org> 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 20fcd89ae646c2557cf892251242bc16a76a927c (commit) from a586d720eb01112b22052865feca01a6d4b6eb9e (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 20fcd89ae646c2557cf892251242bc16a76a927c Author: Darafei Praliaskouski Date: Mon Mar 9 13:00:44 2026 +0400 #1599 Improve country-aware address normalization Canonicalize explicit country tokens in the address parser, carry country through norm_addy, and add regressions for country-aware tiger normalization while keeping tiger usable without address_standardizer. Closes #1599 diff --git a/NEWS b/NEWS index 4bbdc0e1d..d9bf639d8 100644 --- a/NEWS +++ b/NEWS @@ -41,6 +41,10 @@ This version requires GEOS 3.10 or higher - #4828, geometry_columns handles NOT VALID SRID checks without errors (Darafei Praliaskouski) - #6048, [raster] ST_Clip no longer crashes when clipping sparse band selections (Darafei Praliaskouski) + - #1599, [address_standardizer] parse_address() and normalize_address() now + canonicalize trailing country tokens to ISO 3166-1 alpha-2 codes and + expose country on normalized addresses + (Darafei Praliaskouski) - #5645, Docs: keep code operators ("=>") intact in translated manuals by enforcing verbatim CSS (Darafei Praliaskouski) - #5593, Docs: render manual images with GraphicsMagick without temporary files, diff --git a/doc/extras_address_standardizer.xml b/doc/extras_address_standardizer.xml index 287151ca4..d5735096d 100644 --- a/doc/extras_address_standardizer.xml +++ b/doc/extras_address_standardizer.xml @@ -14,8 +14,9 @@ The parser works from right to left looking first at the macro elements for postcode, state/province, city, and then looks micro elements to determine if we are dealing with a house number street or intersection or landmark. -It currently does not look for a country code or name, but that could be -introduced in the future. +It conservatively recognizes trailing country tokens and canonicalizes them to +ISO 3166-1 alpha-2 codes. Explicit country aliases update the parsed country, +and otherwise the default US or CA inference still applies. Country code diff --git a/doc/installation.xml b/doc/installation.xml index 35b05227f..e6805f8c0 100644 --- a/doc/installation.xml +++ b/doc/installation.xml @@ -925,7 +925,7 @@ test test-standardize_address_2 ... ok cd extensions/postgis_tiger_geocoder make install make installcheck - + output should look like: ============== dropping database "contrib_regression" ============== DROP DATABASE diff --git a/extensions/address_standardizer/address_parser.c b/extensions/address_standardizer/address_parser.c index 3e1c642bf..cbe318942 100644 --- a/extensions/address_standardizer/address_parser.c +++ b/extensions/address_standardizer/address_parser.c @@ -21,8 +21,10 @@ #endif Datum parse_address(PG_FUNCTION_ARGS); +Datum strip_explicit_country(PG_FUNCTION_ARGS); PG_FUNCTION_INFO_V1(parse_address); +PG_FUNCTION_INFO_V1(strip_explicit_country); Datum parse_address(PG_FUNCTION_ARGS) { @@ -110,3 +112,18 @@ Datum parse_address(PG_FUNCTION_ARGS) return result; } +Datum +strip_explicit_country(PG_FUNCTION_ARGS) +{ + char *input; + char *working; + char country_code[3] = {0}; + + input = text_to_cstring(PG_GETARG_TEXT_P(0)); + working = pstrdup(input); + + if (strip_explicit_country_token(working, country_code)) + PG_RETURN_TEXT_P(cstring_to_text(working)); + + PG_RETURN_TEXT_P(cstring_to_text(input)); +} diff --git a/extensions/address_standardizer/address_standardizer.c b/extensions/address_standardizer/address_standardizer.c index 363185529..5adb43666 100644 --- a/extensions/address_standardizer/address_standardizer.c +++ b/extensions/address_standardizer/address_standardizer.c @@ -386,11 +386,19 @@ static const char * stdaddr_field_value(const STDADDR *stdaddr, size_t offset) { const char *const *field_value; + const char *canonical_country; if (!stdaddr) return NULL; field_value = (const char *const *)((const char *)stdaddr + offset); + if (offset == offsetof(STDADDR, country) && *field_value) + { + canonical_country = country_code_from_name(*field_value); + if (canonical_country) + return canonical_country; + } + return *field_value; } diff --git a/extensions/address_standardizer/address_standardizer_functions.sql.in b/extensions/address_standardizer/address_standardizer_functions.sql.in index 65c3e919b..535a28de3 100644 --- a/extensions/address_standardizer/address_standardizer_functions.sql.in +++ b/extensions/address_standardizer/address_standardizer_functions.sql.in @@ -47,3 +47,7 @@ CREATE OR REPLACE FUNCTION parse_address(IN text, AS 'MODULE_PATHNAME', 'parse_address' LANGUAGE 'c' IMMUTABLE STRICT; +CREATE OR REPLACE FUNCTION strip_explicit_country(IN text) + RETURNS text + AS 'MODULE_PATHNAME', 'strip_explicit_country' + LANGUAGE 'c' IMMUTABLE STRICT; diff --git a/extensions/address_standardizer/expected/test-standardize_address_1.out b/extensions/address_standardizer/expected/test-standardize_address_1.out index 73604c0b6..ff6dbd83d 100644 --- a/extensions/address_standardizer/expected/test-standardize_address_1.out +++ b/extensions/address_standardizer/expected/test-standardize_address_1.out @@ -13,31 +13,31 @@ select * from standardize_address('us_lex'::text, 'us_gaz'::text, 'us_rules'::te SELECT '#2981' As ticket, * FROM standardize_address('us_lex','us_gaz','us_rules', '1566 NEW STATE HWY, RAYNHAM, MA'); ticket | building | house_num | predir | qual | pretype | name | suftype | sufdir | ruralroute | extra | city | state | country | postcode | box | unit --------+----------+-----------+--------+------+---------+-------------------+---------+--------+------------+-------+---------+---------------+---------+----------+-----+------ - #2981 | | 1566 | | | | NEW STATE HIGHWAY | | | | | RAYNHAM | MASSACHUSETTS | USA | | | + #2981 | | 1566 | | | | NEW STATE HIGHWAY | | | | | RAYNHAM | MASSACHUSETTS | US | | | (1 row) SELECT '#2978a' As ticket, * FROM standardize_address('us_lex','us_gaz','us_rules', '10-20 DORRANCE ST PROVIDENCE RI' ); ticket | building | house_num | predir | qual | pretype | name | suftype | sufdir | ruralroute | extra | city | state | country | postcode | box | unit --------+----------+-----------+--------+------+---------+----------+---------+--------+------------+-------+------------+--------------+---------+----------+-----+------ - #2978a | | 10 20 | | | | DORRANCE | STREET | | | | PROVIDENCE | RHODE ISLAND | USA | | | + #2978a | | 10 20 | | | | DORRANCE | STREET | | | | PROVIDENCE | RHODE ISLAND | US | | | (1 row) SELECT '#2978b' As ticket, * FROM standardize_address('us_lex','us_gaz','us_rules', '10 20 DORRANCE ST PROVIDENCE RI' ); ticket | building | house_num | predir | qual | pretype | name | suftype | sufdir | ruralroute | extra | city | state | country | postcode | box | unit --------+----------+-----------+--------+------+---------+----------+---------+--------+------------+-------+------------+--------------+---------+----------+-----+------ - #2978b | | 10 20 | | | | DORRANCE | STREET | | | | PROVIDENCE | RHODE ISLAND | USA | | | + #2978b | | 10 20 | | | | DORRANCE | STREET | | | | PROVIDENCE | RHODE ISLAND | US | | | (1 row) SELECT '#2978c' As ticket, * FROM standardize_address('us_lex','us_gaz','us_rules', '10-20 DORRANCE ST, PROVIDENCE, RI'); ticket | building | house_num | predir | qual | pretype | name | suftype | sufdir | ruralroute | extra | city | state | country | postcode | box | unit --------+----------+-----------+--------+------+---------+----------+---------+--------+------------+-------+------------+--------------+---------+----------+-----+------ - #2978c | | 10 20 | | | | DORRANCE | STREET | | | | PROVIDENCE | RHODE ISLAND | USA | | | + #2978c | | 10 20 | | | | DORRANCE | STREET | | | | PROVIDENCE | RHODE ISLAND | US | | | (1 row) SELECT '#state_only_macro' AS ticket, * FROM standardize_address('us_lex','us_gaz','us_rules', '25 Prince Street, NC 09985'); ticket | building | house_num | predir | qual | pretype | name | suftype | sufdir | ruralroute | extra | city | state | country | postcode | box | unit -------------------+----------+-----------+--------+------+---------+--------+---------+--------+------------+-------+------+----------------+---------+----------+-----+------ - #state_only_macro | | 25 | | | | PRINCE | STREET | | | | | NORTH CAROLINA | USA | 09985 | | + #state_only_macro | | 25 | | | | PRINCE | STREET | | | | | NORTH CAROLINA | US | 09985 | | (1 row) SELECT '#5299a' AS ticket, * FROM standardize_address('us_lex', 'us_gaz', 'us_rules','1 Timepiece Point','Boston, MA, 02220'); @@ -55,7 +55,7 @@ SELECT '#5299b' AS ticket, * FROM standardize_address('us_lex', 'us_gaz', 'us_r SELECT '#5695a' AS ticket, * FROM standardize_address('us_lex', 'us_gaz', 'us_rules', 'ONE E PIMA ST STE 999, TUCSON, AZ'); ticket | building | house_num | predir | qual | pretype | name | suftype | sufdir | ruralroute | extra | city | state | country | postcode | box | unit --------+----------+-----------+--------+------+---------+------+---------+--------+------------+-------+--------+---------+---------+----------+-----+----------- - #5695a | | 1 | EAST | | | PIMA | STREET | | | | TUCSON | ARIZONA | USA | | | SUITE 999 + #5695a | | 1 | EAST | | | PIMA | STREET | | | | TUCSON | ARIZONA | US | | | SUITE 999 (1 row) DO $$ diff --git a/extensions/address_standardizer/parseaddress-api.c b/extensions/address_standardizer/parseaddress-api.c index 8abf1d1b2..408a592f3 100644 --- a/extensions/address_standardizer/parseaddress-api.c +++ b/extensions/address_standardizer/parseaddress-api.c @@ -2,6 +2,7 @@ * parseaddres.c - utility to crack a string into address, city st zip * * Copyright 2006 Stephen Woodbridge + * Copyright 2026 Darafei Praliaskouski * * This code is released under and MIT-X style license, * @@ -9,13 +10,10 @@ * woodbri at swoodbridge.com * woodbr at imaptools.com * - * - * TODO: - * * add recognition of country before or after postalcode - * */ #include +#include #include #include @@ -48,6 +46,23 @@ const char *parseaddress_cvsid(); char *clean_leading_punct(char *s); static int is_parse_separator(unsigned char c); static size_t normalize_address_input(char *s); +static size_t normalize_country_token(const char *src, char *dst, size_t dst_size); +static bool ends_with_supported_macro(const char *s); +static bool extract_trailing_country(char *s, char *country_code); + +static const char *const us_zip_regex = "\\b(\\d{5})[-\\s]{0,1}?(\\d{0,4})?$"; +static const char *const canada_zip_regex = "\\b([a-z]\\d[a-z]\\s?\\d[a-z]\\d)$"; +static const char *const canada_province_regex = "^(?-xism:(?i:(?=[abmnopqsy])(?:n[ltsu]|[am]b|[bq]c|on|pe|sk|yt)))$"; +static const char *const us_ca_state_regex = + "\\b(?-xism:(?i:(?=[abcdfghiklmnopqrstuvwy])(?:a(?:l(?:a(?:bam|sk)a|berta)?|mer(?:ican)?\\ samoa|r(?:k(?:ansas)?|izona)?|[kszb])|s(?:a(?:moa|skatchewan)|outh\\ (?:carolin|dakot)a|\\ (?:carolin|dakot)a|[cdk])|c(?:a(?:lif(?:ornia)?)?|o(?:nn(?:ecticut)?|lorado)?|t)|d(?:e(?:la(?:ware)?)?|istrict\\ of\\ columbia|c)|f(?:l(?:(?:orid)?a)?|ederal\\ states\\ of\\ micronesia|m)|m(?:i(?:c(?:h(?:igan)?|ronesia)|nn(?:esota)?|ss(?:(?:issipp|our)i)?)?|a(?:r(?:shall(?:\\ is(?:l(?:and)?)?)?|yland)|ss(?:achusetts)?|ine|nitoba)?|o(?:nt(?:ana)?)?|[ehdnstpb])|g(?:u(?:am)?|(?:eorgi)?a)|h(?:awai)?i|i(?:d(?:aho)?|l(?:l(?:inois)?)?|n(?:d(?:iana)?)?|(?:ow)?a)|k(?:(?:ansa)?s|(?:entuck)?y)|l(?:a(?:bordor)?|ouisiana)|n(?:e(?:w(?:\\ (?:foundland(?:\\ and\\ labordor)?|hampshire|jersey|mexico|(?:yor|brunswic)k)|foundland)|(?:brask|vad)a)?|o(?:rth(?:\\ (?:mariana(?:\\ is(?:l(?:and)?)?)?|(?:carolin|dakot)a)|west\\ territor(?:ies|y))|va\\ scotia)|\\ (?:carolin|dakot)a|u(?:navut)?|[vhjmycdblsf]|w?t)|o(?:h(?:io)?|k( ?:lahoma)?|r(?:egon)?|n(?:t(?:ario)?)?)|p(?:a(?:lau)?|e(?:nn(?:sylvania)?|i)?|r(?:ince\\ edward\\ island)?|w|uerto\\ rico)|r(?:hode\\ island|i)|t(?:e(?:nn(?:essee)?|xas)|[nx])|ut(?:ah)?|v(?:i(?:rgin(?:\\ islands|ia))?|(?:ermon)?t|a)|w(?:a(?:sh(?:ington)?)?|i(?:sc(?:onsin)?)?|y(?:oming)?|(?:est)?\\ virginia|v)|b(?:ritish\\ columbia|c)|q(?:uebe)?c|y(?:ukon|t))))$"; +typedef struct country_alias { + const char *alias; + const char *alpha2; +} CountryAlias; + +static const CountryAlias country_aliases[] = { +#include "parseaddress-countries.h" +}; static int is_parse_separator(unsigned char c) @@ -97,6 +112,171 @@ normalize_address_input(char *s) return write_pos; } +static size_t +normalize_country_token(const char *src, char *dst, size_t dst_size) +{ + size_t write_pos = 0; + bool previous_was_space = false; + + if (!src || !dst || !dst_size) + return 0; + + for (; *src != '\0' && write_pos + 1 < dst_size; src++) + { + unsigned char current = (unsigned char)*src; + + if (isalpha(current)) + { + dst[write_pos++] = (char)toupper(current); + previous_was_space = false; + continue; + } + + if (isspace(current) || ispunct(current)) + { + if (!write_pos || previous_was_space) + continue; + + dst[write_pos++] = ' '; + previous_was_space = true; + } + } + + if (write_pos && dst[write_pos - 1] == ' ') + write_pos--; + + dst[write_pos] = '\0'; + return write_pos; +} + +static int +compare_country_alias(const void *lhs, const void *rhs) +{ + const CountryAlias *left = (const CountryAlias *)lhs; + const CountryAlias *right = (const CountryAlias *)rhs; + + return strcmp(left->alias, right->alias); +} + +const char * +country_code_from_name(const char *country_name) +{ + CountryAlias key; + char normalized_country[128]; + const CountryAlias *match; + + if (!normalize_country_token(country_name, normalized_country, sizeof(normalized_country))) + return NULL; + + key.alias = normalized_country; + key.alpha2 = NULL; + match = bsearch( + &key, country_aliases, lengthof(country_aliases), sizeof(country_aliases[0]), compare_country_alias); + + return match ? match->alpha2 : NULL; +} + +/* + * Recognize the right-most macro shape that this parser already knows how to + * consume. That lets us conservatively strip trailing countries without + * erasing ordinary trailing qualifiers, and still supports short ZIP fragments + * once they are paired with a valid trailing state/province. + */ +static bool +ends_with_supported_macro(const char *s) +{ + int macro_ovect[OVECCOUNT]; + int rc; + char *state_probe; + + if (!s || *s == '\0') + return false; + + rc = match((char *)us_zip_regex, (char *)s, macro_ovect, 0); + if (rc >= 2) + return true; + + rc = match((char *)canada_zip_regex, (char *)s, macro_ovect, PARSE_CASELESS); + if (rc >= 1) + return true; + + rc = match((char *)us_ca_state_regex, (char *)s, macro_ovect, PARSE_CASELESS); + if (rc > 0) + return true; + + rc = match("\\b(\\d{2,4})$", (char *)s, macro_ovect, 0); + if (rc < 2) + return false; + + state_probe = pstrdup(s); + *(state_probe + macro_ovect[0]) = '\0'; + (void)clean_trailing_punct(state_probe); + + rc = match((char *)us_ca_state_regex, state_probe, macro_ovect, PARSE_CASELESS); + pfree(state_probe); + + return rc > 0; +} + +/* + * Strip a trailing country token before macro parsing so postcode and state + * extraction still see the expected right-most fields. Known US/CA country + * tokens update the country code; other recognized country names are stripped + * without changing the default country inference. + */ +static bool +extract_trailing_country(char *s, char *country_code) +{ + int split_ovect[OVECCOUNT]; + int rc; + const char *matched_country_code; + char saved; + + if (!s || !country_code) + return false; + + rc = match("([\\s,]+)([A-Za-z][A-Za-z\\s]{1,})$", s, split_ovect, 0); + if (rc < 3) + return false; + + saved = s[split_ovect[0]]; + s[split_ovect[0]] = '\0'; + + matched_country_code = country_code_from_name(s + split_ovect[4]); + if (!matched_country_code) + { + s[split_ovect[0]] = saved; + return false; + } + + if (!ends_with_supported_macro(s)) + { + s[split_ovect[0]] = saved; + return false; + } + + strcpy(country_code, matched_country_code); + + (void)clean_trailing_punct(s); + return true; +} + +bool +strip_explicit_country_token(char *s, char *country_code) +{ + size_t normalized_length; + + if (!s || !country_code) + return false; + + normalized_length = normalize_address_input(s); + if (!normalized_length) + return false; + + (void)clean_trailing_punct(s); + return extract_trailing_country(s, country_code); +} + const char * get_state_regex(const char *st) { @@ -253,11 +433,10 @@ parseaddress(HHash *stH, char *s, int *reterr) #include "parseaddress-regex.h" int ovect[OVECCOUNT]; - char *stregx; - char *caregx; char *state = NULL; char *regx; size_t normalized_length; + bool explicit_country = false; int rc; ADDRESS *ret; #ifdef USE_HSEARCH @@ -299,14 +478,16 @@ parseaddress(HHash *stH, char *s, int *reterr) ret->cc = (char *)palloc0(3 * sizeof(char)); strcpy(ret->cc, "US"); + explicit_country = extract_trailing_country(s, ret->cc); + /* get US zipcode components */ - rc = match("\\b(\\d{5})[-\\s]{0,1}?(\\d{0,4})?$", s, ovect, 0); + rc = match((char *)us_zip_regex, s, ovect, 0); if (rc >= 2) { ret->zip = (char *)palloc0((ovect[3] - ovect[2] + 1) * sizeof(char)); strncpy(ret->zip, s + ovect[2], ovect[3] - ovect[2]); - if (rc >= 3) + if (rc >= 3 && ovect[5] > ovect[4]) { ret->zipplus = (char *)palloc0((ovect[5] - ovect[4] + 1) * sizeof(char)); strncpy(ret->zipplus, s + ovect[4], ovect[5] - ovect[4]); @@ -317,27 +498,54 @@ parseaddress(HHash *stH, char *s, int *reterr) /* get canada zipcode components */ else { - rc = match("\\b([a-z]\\d[a-z]\\s?\\d[a-z]\\d)$", s, ovect, PARSE_CASELESS); + rc = match((char *)canada_zip_regex, s, ovect, PARSE_CASELESS); if (rc >= 1) { ret->zip = (char *)palloc0((ovect[1] - ovect[0] + 1) * sizeof(char)); strncpy(ret->zip, s + ovect[0], ovect[1] - ovect[0]); - strcpy(ret->cc, "CA"); + if (!explicit_country) + strcpy(ret->cc, "CA"); /* truncate the postalcode off the string */ *(s + ovect[0]) = '\0'; } + else + { + int state_ovect[OVECCOUNT]; + char *state_probe; + + /* + * Accept a short trailing ZIP fragment only when removing it exposes + * a valid trailing state/province. That keeps "MA 021" working + * without turning arbitrary suffixes like "Suite 201" into ZIPs. + */ + rc = match("\\b(\\d{2,4})$", s, ovect, 0); + if (rc >= 2) + { + state_probe = pstrdup(s); + *(state_probe + ovect[0]) = '\0'; + (void)clean_trailing_punct(state_probe); + + rc = match((char *)us_ca_state_regex, state_probe, state_ovect, PARSE_CASELESS); + pfree(state_probe); + + if (rc > 0) + { + ret->zip = (char *)palloc0((ovect[3] - ovect[2] + 1) * sizeof(char)); + strncpy(ret->zip, s + ovect[2], ovect[3] - ovect[2]); + *(s + ovect[0]) = '\0'; + } + } + } } /* clean trailing punctuation */ (void)clean_trailing_punct(s); + explicit_country = extract_trailing_country(s, ret->cc) || explicit_country; + (void)clean_trailing_punct(s); /* get state components */ - caregx = "^(?-xism:(?i:(?=[abmnopqsy])(?:n[ltsu]|[am]b|[bq]c|on|pe|sk|yt)))$"; - stregx = - "\\b(?-xism:(?i:(?=[abcdfghiklmnopqrstuvwy])(?:a(?:l(?:a(?:bam|sk)a|berta)?|mer(?:ican)?\\ samoa|r(?:k(?:ansas)?|izona)?|[kszb])|s(?:a(?:moa|skatchewan)|outh\\ (?:carolin|dakot)a|\\ (?:carolin|dakot)a|[cdk])|c(?:a(?:lif(?:ornia)?)?|o(?:nn(?:ecticut)?|lorado)?|t)|d(?:e(?:la(?:ware)?)?|istrict\\ of\\ columbia|c)|f(?:l(?:(?:orid)?a)?|ederal\\ states\\ of\\ micronesia|m)|m(?:i(?:c(?:h(?:igan)?|ronesia)|nn(?:esota)?|ss(?:(?:issipp|our)i)?)?|a(?:r(?:shall(?:\\ is(?:l(?:and)?)?)?|yland)|ss(?:achusetts)?|ine|nitoba)?|o(?:nt(?:ana)?)?|[ehdnstpb])|g(?:u(?:am)?|(?:eorgi)?a)|h(?:awai)?i|i(?:d(?:aho)?|l(?:l(?:inois)?)?|n(?:d(?:iana)?)?|(?:ow)?a)|k(?:(?:ansa)?s|(?:entuck)?y)|l(?:a(?:bordor)?|ouisiana)|n(?:e(?:w(?:\\ (?:foundland(?:\\ and\\ labordor)?|hampshire|jersey|mexico|(?:yor|brunswic)k)|foundland)|(?:brask|vad)a)?|o(?:rth(?:\\ (?:mariana(?:\\ is(?:l(?:and)?)?)?|(?:carolin|dakot)a)|west\\ territor(?:ies|y))|va\\ scotia)|\\ (?:carolin|dakot)a|u(?:navut)?|[vhjmycdblsf]|w?t)|o(?:h(?:io)?|k (?:lahoma)?|r(?:egon)?|n(?:t(?:ario)?)?)|p(?:a(?:lau)?|e(?:nn(?:sylvania)?|i)?|r(?:ince\\ edward\\ island)?|w|uerto\\ rico)|r(?:hode\\ island|i)|t(?:e(?:nn(?:essee)?|xas)|[nx])|ut(?:ah)?|v(?:i(?:rgin(?:\\ islands|ia))?|(?:ermon)?t|a)|w(?:a(?:sh(?:ington)?)?|i(?:sc(?:onsin)?)?|y(?:oming)?|(?:est)?\\ virginia|v)|b(?:ritish\\ columbia|c)|q(?:uebe)?c|y(?:ukon|t))))$"; - - rc = match(stregx, s, ovect, PARSE_CASELESS); + rc = match((char *)us_ca_state_regex, s, ovect, PARSE_CASELESS); if (rc > 0) { state = (char *)palloc0((ovect[1] - ovect[0] + 1) * sizeof(char)); @@ -371,8 +579,8 @@ parseaddress(HHash *stH, char *s, int *reterr) } /* check if it a Canadian Province */ - rc = match(caregx, ret->st, ovect, PARSE_CASELESS); - if (rc > 0) + rc = match((char *)canada_province_regex, ret->st, ovect, PARSE_CASELESS); + if (rc > 0 && !explicit_country) { strcpy(ret->cc, "CA"); // if (ret->cc) printf(" CC: %s\n", ret->cc); diff --git a/extensions/address_standardizer/parseaddress-api.h b/extensions/address_standardizer/parseaddress-api.h index 4dffb5ab8..bb47558e7 100644 --- a/extensions/address_standardizer/parseaddress-api.h +++ b/extensions/address_standardizer/parseaddress-api.h @@ -57,6 +57,8 @@ typedef struct address_struct { int clean_trailing_punct(char *s); void strtoupper(char *s); int match(char *pattern, char *s, int *ovect, int options); +const char *country_code_from_name(const char *country_name); +bool strip_explicit_country_token(char *s, char *country_code); ADDRESS *parseaddress(HHash *stH, char *s, int *err); int load_state_hash(HHash *stH); void free_state_hash(HHash *stH); diff --git a/extensions/address_standardizer/parseaddress-countries.h b/extensions/address_standardizer/parseaddress-countries.h new file mode 100644 index 000000000..3b94c4932 --- /dev/null +++ b/extensions/address_standardizer/parseaddress-countries.h @@ -0,0 +1,942 @@ +/* + * Country aliases for parse_address(), generated from iso-codes and + * a small compatibility alias set. Keep this list sorted by alias. + */ +{"ABW", "AW"}, +{"AD", "AD"}, +{"AE", "AE"}, +{"AF", "AF"}, +{"AFG", "AF"}, +{"AFGHANISTAN", "AF"}, +{"AG", "AG"}, +{"AGO", "AO"}, +{"AI", "AI"}, +{"AIA", "AI"}, +{"AL", "AL"}, +{"ALA", "AX"}, +{"ALAND ISLANDS", "AX"}, +{"ALB", "AL"}, +{"ALBANIA", "AL"}, +{"ALGERIA", "DZ"}, +{"AM", "AM"}, +{"AMERICAN SAMOA", "AS"}, +{"AND", "AD"}, +{"ANDORRA", "AD"}, +{"ANGOLA", "AO"}, +{"ANGUILLA", "AI"}, +{"ANTARCTICA", "AQ"}, +{"ANTIGUA AND BARBUDA", "AG"}, +{"AO", "AO"}, +{"AQ", "AQ"}, +{"AR", "AR"}, +{"ARAB REPUBLIC OF EGYPT", "EG"}, +{"ARE", "AE"}, +{"ARG", "AR"}, +{"ARGENTINA", "AR"}, +{"ARGENTINE REPUBLIC", "AR"}, +{"ARM", "AM"}, +{"ARMENIA", "AM"}, +{"ARUBA", "AW"}, +{"AS", "AS"}, +{"ASM", "AS"}, +{"AT", "AT"}, +{"ATA", "AQ"}, +{"ATF", "TF"}, +{"ATG", "AG"}, +{"AU", "AU"}, +{"AUS", "AU"}, +{"AUSTRALIA", "AU"}, +{"AUSTRIA", "AT"}, +{"AUT", "AT"}, +{"AW", "AW"}, +{"AX", "AX"}, +{"AZ", "AZ"}, +{"AZE", "AZ"}, +{"AZERBAIJAN", "AZ"}, +{"BA", "BA"}, +{"BAHAMAS", "BS"}, +{"BAHRAIN", "BH"}, +{"BANGLADESH", "BD"}, +{"BARBADOS", "BB"}, +{"BB", "BB"}, +{"BD", "BD"}, +{"BDI", "BI"}, +{"BE", "BE"}, +{"BEL", "BE"}, +{"BELARUS", "BY"}, +{"BELGIUM", "BE"}, +{"BELIZE", "BZ"}, +{"BEN", "BJ"}, +{"BENIN", "BJ"}, +{"BERMUDA", "BM"}, +{"BES", "BQ"}, +{"BF", "BF"}, +{"BFA", "BF"}, +{"BG", "BG"}, +{"BGD", "BD"}, +{"BGR", "BG"}, +{"BH", "BH"}, +{"BHR", "BH"}, +{"BHS", "BS"}, +{"BHUTAN", "BT"}, +{"BI", "BI"}, +{"BIH", "BA"}, +{"BJ", "BJ"}, +{"BL", "BL"}, +{"BLM", "BL"}, +{"BLR", "BY"}, +{"BLZ", "BZ"}, +{"BM", "BM"}, +{"BMU", "BM"}, +{"BN", "BN"}, +{"BO", "BO"}, +{"BOL", "BO"}, +{"BOLIVARIAN REPUBLIC OF VENEZUELA", "VE"}, +{"BOLIVIA", "BO"}, +{"BOLIVIA PLURINATIONAL STATE OF", "BO"}, +{"BONAIRE SINT EUSTATIUS AND SABA", "BQ"}, +{"BOSNIA AND HERZEGOVINA", "BA"}, +{"BOSNIA HERZEGOVINA", "BA"}, +{"BOTSWANA", "BW"}, +{"BOUVET ISLAND", "BV"}, +{"BQ", "BQ"}, +{"BR", "BR"}, +{"BRA", "BR"}, +{"BRAZIL", "BR"}, +{"BRB", "BB"}, +{"BRITAIN", "GB"}, +{"BRITISH INDIAN OCEAN TERRITORY", "IO"}, +{"BRITISH VIRGIN ISLANDS", "VG"}, +{"BRN", "BN"}, +{"BRUNEI DARUSSALAM", "BN"}, +{"BS", "BS"}, +{"BT", "BT"}, +{"BTN", "BT"}, +{"BULGARIA", "BG"}, +{"BURKINA FASO", "BF"}, +{"BURMA", "MM"}, +{"BURUNDI", "BI"}, +{"BV", "BV"}, +{"BVT", "BV"}, +{"BW", "BW"}, +{"BWA", "BW"}, +{"BY", "BY"}, +{"BZ", "BZ"}, +{"CA", "CA"}, +{"CABO VERDE", "CV"}, +{"CAF", "CF"}, +{"CAMBODIA", "KH"}, +{"CAMEROON", "CM"}, +{"CAN", "CA"}, +{"CANADA", "CA"}, +{"CAYMAN ISLANDS", "KY"}, +{"CC", "CC"}, +{"CCK", "CC"}, +{"CD", "CD"}, +{"CENTRAL AFRICAN REPUBLIC", "CF"}, +{"CF", "CF"}, +{"CG", "CG"}, +{"CH", "CH"}, +{"CHAD", "TD"}, +{"CHE", "CH"}, +{"CHILE", "CL"}, +{"CHINA", "CN"}, +{"CHL", "CL"}, +{"CHN", "CN"}, +{"CHRISTMAS ISLAND", "CX"}, +{"CI", "CI"}, +{"CIV", "CI"}, +{"CK", "CK"}, +{"CL", "CL"}, +{"CM", "CM"}, +{"CMR", "CM"}, +{"CN", "CN"}, +{"CO", "CO"}, +{"COCOS KEELING ISLANDS", "CC"}, +{"COD", "CD"}, +{"COG", "CG"}, +{"COK", "CK"}, +{"COL", "CO"}, +{"COLOMBIA", "CO"}, +{"COM", "KM"}, +{"COMMONWEALTH OF DOMINICA", "DM"}, +{"COMMONWEALTH OF THE BAHAMAS", "BS"}, +{"COMMONWEALTH OF THE NORTHERN MARIANA ISLANDS", "MP"}, +{"COMOROS", "KM"}, +{"CONGO", "CG"}, +{"CONGO THE DEMOCRATIC REPUBLIC OF THE", "CD"}, +{"COOK ISLANDS", "CK"}, +{"COSTA RICA", "CR"}, +{"COTE D IVOIRE", "CI"}, +{"CPV", "CV"}, +{"CR", "CR"}, +{"CRI", "CR"}, +{"CROATIA", "HR"}, +{"CU", "CU"}, +{"CUB", "CU"}, +{"CUBA", "CU"}, +{"CURACAO", "CW"}, +{"CUW", "CW"}, +{"CV", "CV"}, +{"CW", "CW"}, +{"CX", "CX"}, +{"CXR", "CX"}, +{"CY", "CY"}, +{"CYM", "KY"}, +{"CYP", "CY"}, +{"CYPRUS", "CY"}, +{"CZ", "CZ"}, +{"CZE", "CZ"}, +{"CZECH REPUBLIC", "CZ"}, +{"CZECHIA", "CZ"}, +{"DE", "DE"}, +{"DEMOCRATIC PEOPLE S REPUBLIC OF KOREA", "KP"}, +{"DEMOCRATIC REPUBLIC OF SAO TOME AND PRINCIPE", "ST"}, +{"DEMOCRATIC REPUBLIC OF TIMOR LESTE", "TL"}, +{"DEMOCRATIC SOCIALIST REPUBLIC OF SRI LANKA", "LK"}, +{"DENMARK", "DK"}, +{"DEU", "DE"}, +{"DJ", "DJ"}, +{"DJI", "DJ"}, +{"DJIBOUTI", "DJ"}, +{"DK", "DK"}, +{"DM", "DM"}, +{"DMA", "DM"}, +{"DNK", "DK"}, +{"DO", "DO"}, +{"DOM", "DO"}, +{"DOMINICA", "DM"}, +{"DOMINICAN REPUBLIC", "DO"}, +{"DZ", "DZ"}, +{"DZA", "DZ"}, +{"EAST TIMOR", "TL"}, +{"EASTERN REPUBLIC OF URUGUAY", "UY"}, +{"EC", "EC"}, +{"ECU", "EC"}, +{"ECUADOR", "EC"}, +{"EE", "EE"}, +{"EG", "EG"}, +{"EGY", "EG"}, +{"EGYPT", "EG"}, +{"EH", "EH"}, +{"EL SALVADOR", "SV"}, +{"EQUATORIAL GUINEA", "GQ"}, +{"ER", "ER"}, +{"ERI", "ER"}, +{"ERITREA", "ER"}, +{"ES", "ES"}, +{"ESH", "EH"}, +{"ESP", "ES"}, +{"EST", "EE"}, +{"ESTONIA", "EE"}, +{"ESWATINI", "SZ"}, +{"ET", "ET"}, +{"ETH", "ET"}, +{"ETHIOPIA", "ET"}, +{"FALKLAND ISLANDS MALVINAS", "FK"}, +{"FAROE ISLANDS", "FO"}, +{"FEDERAL DEMOCRATIC REPUBLIC OF ETHIOPIA", "ET"}, +{"FEDERAL DEMOCRATIC REPUBLIC OF NEPAL", "NP"}, +{"FEDERAL REPUBLIC OF GERMANY", "DE"}, +{"FEDERAL REPUBLIC OF NIGERIA", "NG"}, +{"FEDERAL REPUBLIC OF SOMALIA", "SO"}, +{"FEDERATED STATES OF MICRONESIA", "FM"}, +{"FEDERATIVE REPUBLIC OF BRAZIL", "BR"}, +{"FI", "FI"}, +{"FIJI", "FJ"}, +{"FIN", "FI"}, +{"FINLAND", "FI"}, +{"FJ", "FJ"}, +{"FJI", "FJ"}, +{"FK", "FK"}, +{"FLK", "FK"}, +{"FM", "FM"}, +{"FO", "FO"}, +{"FR", "FR"}, +{"FRA", "FR"}, +{"FRANCE", "FR"}, +{"FRENCH GUIANA", "GF"}, +{"FRENCH POLYNESIA", "PF"}, +{"FRENCH REPUBLIC", "FR"}, +{"FRENCH SOUTHERN TERRITORIES", "TF"}, +{"FRO", "FO"}, +{"FSM", "FM"}, +{"GA", "GA"}, +{"GAB", "GA"}, +{"GABON", "GA"}, +{"GABONESE REPUBLIC", "GA"}, +{"GAMBIA", "GM"}, +{"GB", "GB"}, +{"GBR", "GB"}, +{"GD", "GD"}, +{"GE", "GE"}, +{"GEO", "GE"}, +{"GEORGIA", "GE"}, +{"GERMANY", "DE"}, +{"GF", "GF"}, +{"GG", "GG"}, +{"GGY", "GG"}, +{"GH", "GH"}, +{"GHA", "GH"}, +{"GHANA", "GH"}, +{"GI", "GI"}, +{"GIB", "GI"}, +{"GIBRALTAR", "GI"}, +{"GIN", "GN"}, +{"GL", "GL"}, +{"GLP", "GP"}, +{"GM", "GM"}, +{"GMB", "GM"}, +{"GN", "GN"}, +{"GNB", "GW"}, +{"GNQ", "GQ"}, +{"GP", "GP"}, +{"GQ", "GQ"}, +{"GR", "GR"}, +{"GRAND DUCHY OF LUXEMBOURG", "LU"}, +{"GRC", "GR"}, +{"GRD", "GD"}, +{"GREAT BRITAIN", "GB"}, +{"GREECE", "GR"}, +{"GREENLAND", "GL"}, +{"GRENADA", "GD"}, +{"GRL", "GL"}, +{"GS", "GS"}, +{"GT", "GT"}, +{"GTM", "GT"}, +{"GU", "GU"}, +{"GUADELOUPE", "GP"}, +{"GUAM", "GU"}, +{"GUATEMALA", "GT"}, +{"GUERNSEY", "GG"}, +{"GUF", "GF"}, +{"GUINEA", "GN"}, +{"GUINEA BISSAU", "GW"}, +{"GUM", "GU"}, +{"GUY", "GY"}, +{"GUYANA", "GY"}, +{"GW", "GW"}, +{"GY", "GY"}, +{"HAITI", "HT"}, +{"HASHEMITE KINGDOM OF JORDAN", "JO"}, +{"HEARD ISLAND AND MCDONALD ISLANDS", "HM"}, +{"HELLENIC REPUBLIC", "GR"}, +{"HK", "HK"}, +{"HKG", "HK"}, +{"HM", "HM"}, +{"HMD", "HM"}, +{"HN", "HN"}, +{"HND", "HN"}, +{"HOLY SEE VATICAN CITY STATE", "VA"}, +{"HONDURAS", "HN"}, +{"HONG KONG", "HK"}, +{"HONG KONG SPECIAL ADMINISTRATIVE REGION OF CHINA", "HK"}, +{"HR", "HR"}, +{"HRV", "HR"}, +{"HT", "HT"}, +{"HTI", "HT"}, +{"HU", "HU"}, +{"HUN", "HU"}, +{"HUNGARY", "HU"}, +{"ICELAND", "IS"}, +{"ID", "ID"}, +{"IDN", "ID"}, +{"IE", "IE"}, +{"IL", "IL"}, +{"IM", "IM"}, +{"IMN", "IM"}, +{"IN", "IN"}, +{"IND", "IN"}, +{"INDEPENDENT STATE OF PAPUA NEW GUINEA", "PG"}, +{"INDEPENDENT STATE OF SAMOA", "WS"}, +{"INDIA", "IN"}, +{"INDONESIA", "ID"}, +{"IO", "IO"}, +{"IOT", "IO"}, +{"IQ", "IQ"}, +{"IR", "IR"}, +{"IRAN", "IR"}, +{"IRAN ISLAMIC REPUBLIC OF", "IR"}, +{"IRAQ", "IQ"}, +{"IRELAND", "IE"}, +{"IRL", "IE"}, +{"IRN", "IR"}, +{"IRQ", "IQ"}, +{"IS", "IS"}, +{"ISL", "IS"}, +{"ISLAMIC REPUBLIC OF AFGHANISTAN", "AF"}, +{"ISLAMIC REPUBLIC OF IRAN", "IR"}, +{"ISLAMIC REPUBLIC OF MAURITANIA", "MR"}, +{"ISLAMIC REPUBLIC OF PAKISTAN", "PK"}, +{"ISLE OF MAN", "IM"}, +{"ISR", "IL"}, +{"ISRAEL", "IL"}, +{"IT", "IT"}, +{"ITA", "IT"}, +{"ITALIAN REPUBLIC", "IT"}, +{"ITALY", "IT"}, +{"IVORY COAST", "CI"}, +{"JAM", "JM"}, +{"JAMAICA", "JM"}, +{"JAPAN", "JP"}, +{"JE", "JE"}, +{"JERSEY", "JE"}, +{"JEY", "JE"}, +{"JM", "JM"}, +{"JO", "JO"}, +{"JOR", "JO"}, +{"JORDAN", "JO"}, +{"JP", "JP"}, +{"JPN", "JP"}, +{"KAZ", "KZ"}, +{"KAZAKHSTAN", "KZ"}, +{"KE", "KE"}, +{"KEN", "KE"}, +{"KENYA", "KE"}, +{"KG", "KG"}, +{"KGZ", "KG"}, +{"KH", "KH"}, +{"KHM", "KH"}, +{"KI", "KI"}, +{"KINGDOM OF BAHRAIN", "BH"}, +{"KINGDOM OF BELGIUM", "BE"}, +{"KINGDOM OF BHUTAN", "BT"}, +{"KINGDOM OF CAMBODIA", "KH"}, +{"KINGDOM OF DENMARK", "DK"}, +{"KINGDOM OF ESWATINI", "SZ"}, +{"KINGDOM OF LESOTHO", "LS"}, +{"KINGDOM OF MOROCCO", "MA"}, +{"KINGDOM OF NORWAY", "NO"}, +{"KINGDOM OF SAUDI ARABIA", "SA"}, +{"KINGDOM OF SPAIN", "ES"}, +{"KINGDOM OF SWEDEN", "SE"}, +{"KINGDOM OF THAILAND", "TH"}, +{"KINGDOM OF THE NETHERLANDS", "NL"}, +{"KINGDOM OF TONGA", "TO"}, +{"KIR", "KI"}, +{"KIRIBATI", "KI"}, +{"KM", "KM"}, +{"KN", "KN"}, +{"KNA", "KN"}, +{"KOR", "KR"}, +{"KOREA DEMOCRATIC PEOPLE S REPUBLIC OF", "KP"}, +{"KOREA REPUBLIC OF", "KR"}, +{"KP", "KP"}, +{"KR", "KR"}, +{"KUWAIT", "KW"}, +{"KW", "KW"}, +{"KWT", "KW"}, +{"KY", "KY"}, +{"KYRGYZ REPUBLIC", "KG"}, +{"KYRGYZSTAN", "KG"}, +{"KZ", "KZ"}, +{"LA", "LA"}, +{"LAO", "LA"}, +{"LAO PEOPLE S DEMOCRATIC REPUBLIC", "LA"}, +{"LAOS", "LA"}, +{"LATVIA", "LV"}, +{"LB", "LB"}, +{"LBN", "LB"}, +{"LBR", "LR"}, +{"LBY", "LY"}, +{"LC", "LC"}, +{"LCA", "LC"}, +{"LEBANESE REPUBLIC", "LB"}, +{"LEBANON", "LB"}, +{"LESOTHO", "LS"}, +{"LI", "LI"}, +{"LIBERIA", "LR"}, +{"LIBYA", "LY"}, +{"LIE", "LI"}, +{"LIECHTENSTEIN", "LI"}, +{"LITHUANIA", "LT"}, +{"LK", "LK"}, +{"LKA", "LK"}, +{"LR", "LR"}, +{"LS", "LS"}, +{"LSO", "LS"}, +{"LT", "LT"}, +{"LTU", "LT"}, +{"LU", "LU"}, +{"LUX", "LU"}, +{"LUXEMBOURG", "LU"}, +{"LV", "LV"}, +{"LVA", "LV"}, +{"LY", "LY"}, +{"MA", "MA"}, +{"MAC", "MO"}, +{"MACAO", "MO"}, +{"MACAO SPECIAL ADMINISTRATIVE REGION OF CHINA", "MO"}, +{"MADAGASCAR", "MG"}, +{"MAF", "MF"}, +{"MALAWI", "MW"}, +{"MALAYSIA", "MY"}, +{"MALDIVES", "MV"}, +{"MALI", "ML"}, +{"MALTA", "MT"}, +{"MAR", "MA"}, +{"MARSHALL ISLANDS", "MH"}, +{"MARTINIQUE", "MQ"}, +{"MAURITANIA", "MR"}, +{"MAURITIUS", "MU"}, +{"MAYOTTE", "YT"}, +{"MC", "MC"}, +{"MCO", "MC"}, +{"MD", "MD"}, +{"MDA", "MD"}, +{"MDG", "MG"}, +{"MDV", "MV"}, +{"ME", "ME"}, +{"MEX", "MX"}, +{"MEXICO", "MX"}, +{"MF", "MF"}, +{"MG", "MG"}, +{"MH", "MH"}, +{"MHL", "MH"}, +{"MICRONESIA", "FM"}, +{"MICRONESIA FEDERATED STATES OF", "FM"}, +{"MK", "MK"}, +{"MKD", "MK"}, +{"ML", "ML"}, +{"MLI", "ML"}, +{"MLT", "MT"}, +{"MM", "MM"}, +{"MMR", "MM"}, +{"MN", "MN"}, +{"MNE", "ME"}, +{"MNG", "MN"}, +{"MNP", "MP"}, +{"MO", "MO"}, +{"MOLDOVA", "MD"}, +{"MOLDOVA REPUBLIC OF", "MD"}, +{"MONACO", "MC"}, +{"MONGOLIA", "MN"}, +{"MONTENEGRO", "ME"}, +{"MONTSERRAT", "MS"}, +{"MOROCCO", "MA"}, +{"MOZ", "MZ"}, +{"MOZAMBIQUE", "MZ"}, +{"MP", "MP"}, +{"MQ", "MQ"}, +{"MR", "MR"}, +{"MRT", "MR"}, +{"MS", "MS"}, +{"MSR", "MS"}, +{"MT", "MT"}, +{"MTQ", "MQ"}, +{"MU", "MU"}, +{"MUS", "MU"}, +{"MV", "MV"}, +{"MW", "MW"}, +{"MWI", "MW"}, +{"MX", "MX"}, +{"MY", "MY"}, +{"MYANMAR", "MM"}, +{"MYS", "MY"}, +{"MYT", "YT"}, +{"MZ", "MZ"}, +{"NA", "NA"}, +{"NAM", "NA"}, +{"NAMIBIA", "NA"}, +{"NAURU", "NR"}, +{"NC", "NC"}, +{"NCL", "NC"}, +{"NE", "NE"}, +{"NEPAL", "NP"}, +{"NER", "NE"}, +{"NETHERLANDS", "NL"}, +{"NEW CALEDONIA", "NC"}, +{"NEW ZEALAND", "NZ"}, +{"NF", "NF"}, +{"NFK", "NF"}, +{"NG", "NG"}, +{"NGA", "NG"}, +{"NI", "NI"}, +{"NIC", "NI"}, +{"NICARAGUA", "NI"}, +{"NIGER", "NE"}, +{"NIGERIA", "NG"}, +{"NIU", "NU"}, +{"NIUE", "NU"}, +{"NL", "NL"}, +{"NLD", "NL"}, +{"NO", "NO"}, +{"NOR", "NO"}, +{"NORFOLK ISLAND", "NF"}, +{"NORTH KOREA", "KP"}, +{"NORTH MACEDONIA", "MK"}, +{"NORTHERN MARIANA ISLANDS", "MP"}, +{"NORWAY", "NO"}, +{"NP", "NP"}, +{"NPL", "NP"}, +{"NR", "NR"}, +{"NRU", "NR"}, +{"NU", "NU"}, +{"NZ", "NZ"}, +{"NZL", "NZ"}, +{"OM", "OM"}, +{"OMAN", "OM"}, +{"OMN", "OM"}, +{"PA", "PA"}, +{"PAK", "PK"}, +{"PAKISTAN", "PK"}, +{"PALAU", "PW"}, +{"PALESTINE", "PS"}, +{"PALESTINE STATE OF", "PS"}, +{"PAN", "PA"}, +{"PANAMA", "PA"}, +{"PAPUA NEW GUINEA", "PG"}, +{"PARAGUAY", "PY"}, +{"PCN", "PN"}, +{"PE", "PE"}, +{"PEOPLE S DEMOCRATIC REPUBLIC OF ALGERIA", "DZ"}, +{"PEOPLE S REPUBLIC OF BANGLADESH", "BD"}, +{"PEOPLE S REPUBLIC OF CHINA", "CN"}, +{"PER", "PE"}, +{"PERU", "PE"}, +{"PF", "PF"}, +{"PG", "PG"}, +{"PH", "PH"}, +{"PHILIPPINES", "PH"}, +{"PHL", "PH"}, +{"PITCAIRN", "PN"}, +{"PK", "PK"}, +{"PL", "PL"}, +{"PLURINATIONAL STATE OF BOLIVIA", "BO"}, +{"PLW", "PW"}, +{"PM", "PM"}, +{"PN", "PN"}, +{"PNG", "PG"}, +{"POL", "PL"}, +{"POLAND", "PL"}, +{"PORTUGAL", "PT"}, +{"PORTUGUESE REPUBLIC", "PT"}, +{"PR", "PR"}, +{"PRI", "PR"}, +{"PRINCIPALITY OF ANDORRA", "AD"}, +{"PRINCIPALITY OF LIECHTENSTEIN", "LI"}, +{"PRINCIPALITY OF MONACO", "MC"}, +{"PRK", "KP"}, +{"PRT", "PT"}, +{"PRY", "PY"}, +{"PS", "PS"}, +{"PSE", "PS"}, +{"PT", "PT"}, +{"PUERTO RICO", "PR"}, +{"PW", "PW"}, +{"PY", "PY"}, +{"PYF", "PF"}, +{"QA", "QA"}, +{"QAT", "QA"}, +{"QATAR", "QA"}, +{"RE", "RE"}, +{"REPUBLIC OF ALBANIA", "AL"}, +{"REPUBLIC OF ANGOLA", "AO"}, +{"REPUBLIC OF ARMENIA", "AM"}, +{"REPUBLIC OF AUSTRIA", "AT"}, +{"REPUBLIC OF AZERBAIJAN", "AZ"}, +{"REPUBLIC OF BELARUS", "BY"}, +{"REPUBLIC OF BENIN", "BJ"}, +{"REPUBLIC OF BOSNIA AND HERZEGOVINA", "BA"}, +{"REPUBLIC OF BOTSWANA", "BW"}, +{"REPUBLIC OF BULGARIA", "BG"}, +{"REPUBLIC OF BURUNDI", "BI"}, +{"REPUBLIC OF CABO VERDE", "CV"}, +{"REPUBLIC OF CAMEROON", "CM"}, +{"REPUBLIC OF CHAD", "TD"}, +{"REPUBLIC OF CHILE", "CL"}, +{"REPUBLIC OF COLOMBIA", "CO"}, +{"REPUBLIC OF COSTA RICA", "CR"}, +{"REPUBLIC OF COTE D IVOIRE", "CI"}, +{"REPUBLIC OF CROATIA", "HR"}, +{"REPUBLIC OF CUBA", "CU"}, +{"REPUBLIC OF CYPRUS", "CY"}, +{"REPUBLIC OF DJIBOUTI", "DJ"}, +{"REPUBLIC OF ECUADOR", "EC"}, +{"REPUBLIC OF EL SALVADOR", "SV"}, +{"REPUBLIC OF EQUATORIAL GUINEA", "GQ"}, +{"REPUBLIC OF ESTONIA", "EE"}, +{"REPUBLIC OF FIJI", "FJ"}, +{"REPUBLIC OF FINLAND", "FI"}, +{"REPUBLIC OF GHANA", "GH"}, +{"REPUBLIC OF GUATEMALA", "GT"}, +{"REPUBLIC OF GUINEA", "GN"}, +{"REPUBLIC OF GUINEA BISSAU", "GW"}, +{"REPUBLIC OF GUYANA", "GY"}, +{"REPUBLIC OF HAITI", "HT"}, +{"REPUBLIC OF HONDURAS", "HN"}, +{"REPUBLIC OF ICELAND", "IS"}, +{"REPUBLIC OF INDIA", "IN"}, +{"REPUBLIC OF INDONESIA", "ID"}, +{"REPUBLIC OF IRAQ", "IQ"}, +{"REPUBLIC OF KAZAKHSTAN", "KZ"}, +{"REPUBLIC OF KENYA", "KE"}, +{"REPUBLIC OF KIRIBATI", "KI"}, +{"REPUBLIC OF LATVIA", "LV"}, +{"REPUBLIC OF LIBERIA", "LR"}, +{"REPUBLIC OF LITHUANIA", "LT"}, +{"REPUBLIC OF MADAGASCAR", "MG"}, +{"REPUBLIC OF MALAWI", "MW"}, +{"REPUBLIC OF MALDIVES", "MV"}, +{"REPUBLIC OF MALI", "ML"}, +{"REPUBLIC OF MALTA", "MT"}, +{"REPUBLIC OF MAURITIUS", "MU"}, +{"REPUBLIC OF MOLDOVA", "MD"}, +{"REPUBLIC OF MOZAMBIQUE", "MZ"}, +{"REPUBLIC OF MYANMAR", "MM"}, +{"REPUBLIC OF NAMIBIA", "NA"}, +{"REPUBLIC OF NAURU", "NR"}, +{"REPUBLIC OF NICARAGUA", "NI"}, +{"REPUBLIC OF NORTH MACEDONIA", "MK"}, +{"REPUBLIC OF PALAU", "PW"}, +{"REPUBLIC OF PANAMA", "PA"}, +{"REPUBLIC OF PARAGUAY", "PY"}, +{"REPUBLIC OF PERU", "PE"}, +{"REPUBLIC OF POLAND", "PL"}, +{"REPUBLIC OF SAN MARINO", "SM"}, +{"REPUBLIC OF SENEGAL", "SN"}, +{"REPUBLIC OF SERBIA", "RS"}, +{"REPUBLIC OF SEYCHELLES", "SC"}, +{"REPUBLIC OF SIERRA LEONE", "SL"}, +{"REPUBLIC OF SINGAPORE", "SG"}, +{"REPUBLIC OF SLOVENIA", "SI"}, +{"REPUBLIC OF SOUTH AFRICA", "ZA"}, +{"REPUBLIC OF SOUTH SUDAN", "SS"}, +{"REPUBLIC OF SURINAME", "SR"}, +{"REPUBLIC OF TAJIKISTAN", "TJ"}, +{"REPUBLIC OF THE CONGO", "CG"}, +{"REPUBLIC OF THE GAMBIA", "GM"}, +{"REPUBLIC OF THE MARSHALL ISLANDS", "MH"}, +{"REPUBLIC OF THE NIGER", "NE"}, +{"REPUBLIC OF THE PHILIPPINES", "PH"}, +{"REPUBLIC OF THE SUDAN", "SD"}, +{"REPUBLIC OF TRINIDAD AND TOBAGO", "TT"}, +{"REPUBLIC OF TUNISIA", "TN"}, +{"REPUBLIC OF TURKIYE", "TR"}, +{"REPUBLIC OF UGANDA", "UG"}, +{"REPUBLIC OF UZBEKISTAN", "UZ"}, +{"REPUBLIC OF VANUATU", "VU"}, +{"REPUBLIC OF YEMEN", "YE"}, +{"REPUBLIC OF ZAMBIA", "ZM"}, +{"REPUBLIC OF ZIMBABWE", "ZW"}, +{"REU", "RE"}, +{"REUNION", "RE"}, +{"RO", "RO"}, +{"ROMANIA", "RO"}, +{"ROU", "RO"}, +{"RS", "RS"}, +{"RU", "RU"}, +{"RUS", "RU"}, +{"RUSSIA", "RU"}, +{"RUSSIAN FEDERATION", "RU"}, +{"RW", "RW"}, +{"RWA", "RW"}, +{"RWANDA", "RW"}, +{"RWANDESE REPUBLIC", "RW"}, +{"SA", "SA"}, +{"SAINT BARTHELEMY", "BL"}, +{"SAINT HELENA ASCENSION AND TRISTAN DA CUNHA", "SH"}, +{"SAINT KITTS AND NEVIS", "KN"}, +{"SAINT LUCIA", "LC"}, +{"SAINT MARTIN FRENCH PART", "MF"}, +{"SAINT PIERRE AND MIQUELON", "PM"}, +{"SAINT VINCENT AND THE GRENADINES", "VC"}, +{"SAMOA", "WS"}, +{"SAN MARINO", "SM"}, +{"SAO TOME AND PRINCIPE", "ST"}, +{"SAU", "SA"}, +{"SAUDI ARABIA", "SA"}, +{"SB", "SB"}, +{"SC", "SC"}, +{"SD", "SD"}, +{"SDN", "SD"}, +{"SE", "SE"}, +{"SEN", "SN"}, +{"SENEGAL", "SN"}, +{"SERBIA", "RS"}, +{"SEYCHELLES", "SC"}, +{"SG", "SG"}, +{"SGP", "SG"}, +{"SGS", "GS"}, +{"SH", "SH"}, +{"SHN", "SH"}, +{"SI", "SI"}, +{"SIERRA LEONE", "SL"}, +{"SINGAPORE", "SG"}, +{"SINT MAARTEN DUTCH PART", "SX"}, +{"SJ", "SJ"}, +{"SJM", "SJ"}, +{"SK", "SK"}, +{"SL", "SL"}, +{"SLB", "SB"}, +{"SLE", "SL"}, +{"SLOVAK REPUBLIC", "SK"}, +{"SLOVAKIA", "SK"}, +{"SLOVENIA", "SI"}, +{"SLV", "SV"}, +{"SM", "SM"}, +{"SMR", "SM"}, +{"SN", "SN"}, +{"SO", "SO"}, +{"SOCIALIST REPUBLIC OF VIET NAM", "VN"}, +{"SOLOMON ISLANDS", "SB"}, +{"SOM", "SO"}, +{"SOMALIA", "SO"}, +{"SOUTH AFRICA", "ZA"}, +{"SOUTH GEORGIA AND THE SOUTH SANDWICH ISLANDS", "GS"}, +{"SOUTH KOREA", "KR"}, +{"SOUTH SUDAN", "SS"}, +{"SPAIN", "ES"}, +{"SPM", "PM"}, +{"SR", "SR"}, +{"SRB", "RS"}, +{"SRI LANKA", "LK"}, +{"SS", "SS"}, +{"SSD", "SS"}, +{"ST", "ST"}, +{"STATE OF ISRAEL", "IL"}, +{"STATE OF KUWAIT", "KW"}, +{"STATE OF QATAR", "QA"}, +{"STP", "ST"}, +{"SUDAN", "SD"}, +{"SULTANATE OF OMAN", "OM"}, +{"SUR", "SR"}, +{"SURINAME", "SR"}, +{"SV", "SV"}, +{"SVALBARD AND JAN MAYEN", "SJ"}, +{"SVK", "SK"}, +{"SVN", "SI"}, +{"SWE", "SE"}, +{"SWEDEN", "SE"}, +{"SWISS CONFEDERATION", "CH"}, +{"SWITZERLAND", "CH"}, +{"SWZ", "SZ"}, +{"SX", "SX"}, +{"SXM", "SX"}, +{"SY", "SY"}, +{"SYC", "SC"}, +{"SYR", "SY"}, +{"SYRIA", "SY"}, +{"SYRIAN ARAB REPUBLIC", "SY"}, +{"SZ", "SZ"}, +{"TAIWAN", "TW"}, +{"TAIWAN PROVINCE OF CHINA", "TW"}, +{"TAJIKISTAN", "TJ"}, +{"TANZANIA", "TZ"}, +{"TANZANIA UNITED REPUBLIC OF", "TZ"}, +{"TC", "TC"}, +{"TCA", "TC"}, +{"TCD", "TD"}, +{"TD", "TD"}, +{"TF", "TF"}, +{"TG", "TG"}, +{"TGO", "TG"}, +{"TH", "TH"}, +{"THA", "TH"}, +{"THAILAND", "TH"}, +{"THE STATE OF ERITREA", "ER"}, +{"THE STATE OF PALESTINE", "PS"}, +{"TIMOR LESTE", "TL"}, +{"TJ", "TJ"}, +{"TJK", "TJ"}, +{"TK", "TK"}, +{"TKL", "TK"}, +{"TKM", "TM"}, +{"TL", "TL"}, +{"TLS", "TL"}, +{"TM", "TM"}, +{"TN", "TN"}, +{"TO", "TO"}, +{"TOGO", "TG"}, +{"TOGOLESE REPUBLIC", "TG"}, +{"TOKELAU", "TK"}, +{"TON", "TO"}, +{"TONGA", "TO"}, +{"TR", "TR"}, +{"TRINIDAD AND TOBAGO", "TT"}, +{"TT", "TT"}, +{"TTO", "TT"}, +{"TUN", "TN"}, +{"TUNISIA", "TN"}, +{"TUR", "TR"}, +{"TURKEY", "TR"}, +{"TURKIYE", "TR"}, +{"TURKMENISTAN", "TM"}, +{"TURKS AND CAICOS ISLANDS", "TC"}, +{"TUV", "TV"}, +{"TUVALU", "TV"}, +{"TV", "TV"}, +{"TW", "TW"}, +{"TWN", "TW"}, +{"TZ", "TZ"}, +{"TZA", "TZ"}, +{"U K", "GB"}, +{"U S", "US"}, +{"U S A", "US"}, +{"UA", "UA"}, +{"UG", "UG"}, +{"UGA", "UG"}, +{"UGANDA", "UG"}, +{"UK", "GB"}, +{"UKR", "UA"}, +{"UKRAINE", "UA"}, +{"UM", "UM"}, +{"UMI", "UM"}, +{"UNION OF THE COMOROS", "KM"}, +{"UNITED ARAB EMIRATES", "AE"}, +{"UNITED KINGDOM", "GB"}, +{"UNITED KINGDOM OF GREAT BRITAIN AND NORTHERN IRELAND", "GB"}, +{"UNITED MEXICAN STATES", "MX"}, +{"UNITED REPUBLIC OF TANZANIA", "TZ"}, +{"UNITED STATES", "US"}, +{"UNITED STATES MINOR OUTLYING ISLANDS", "UM"}, +{"UNITED STATES OF AMERICA", "US"}, +{"URUGUAY", "UY"}, +{"URY", "UY"}, +{"US", "US"}, +{"USA", "US"}, +{"UY", "UY"}, +{"UZ", "UZ"}, +{"UZB", "UZ"}, +{"UZBEKISTAN", "UZ"}, +{"VA", "VA"}, +{"VANUATU", "VU"}, +{"VAT", "VA"}, +{"VATICAN CITY", "VA"}, +{"VC", "VC"}, +{"VCT", "VC"}, +{"VE", "VE"}, +{"VEN", "VE"}, +{"VENEZUELA", "VE"}, +{"VENEZUELA BOLIVARIAN REPUBLIC OF", "VE"}, +{"VG", "VG"}, +{"VGB", "VG"}, +{"VI", "VI"}, +{"VIET NAM", "VN"}, +{"VIETNAM", "VN"}, +{"VIR", "VI"}, +{"VIRGIN ISLANDS BRITISH", "VG"}, +{"VIRGIN ISLANDS OF THE UNITED STATES", "VI"}, +{"VIRGIN ISLANDS U S", "VI"}, +{"VN", "VN"}, +{"VNM", "VN"}, +{"VU", "VU"}, +{"VUT", "VU"}, +{"WALLIS AND FUTUNA", "WF"}, +{"WESTERN SAHARA", "EH"}, +{"WF", "WF"}, +{"WLF", "WF"}, +{"WS", "WS"}, +{"WSM", "WS"}, +{"YE", "YE"}, +{"YEM", "YE"}, +{"YEMEN", "YE"}, +{"YT", "YT"}, +{"ZA", "ZA"}, +{"ZAF", "ZA"}, +{"ZAMBIA", "ZM"}, +{"ZIMBABWE", "ZW"}, +{"ZM", "ZM"}, +{"ZMB", "ZM"}, +{"ZW", "ZW"}, +{"ZWE", "ZW"}, diff --git a/extensions/address_standardizer/test-parseaddress.sql.in b/extensions/address_standardizer/test-parseaddress.sql.in index b2a1224c0..f327354f5 100644 --- a/extensions/address_standardizer/test-parseaddress.sql.in +++ b/extensions/address_standardizer/test-parseaddress.sql.in @@ -69,6 +69,15 @@ copy test_parse_address (instring, outstring) from stdin; @@ sttype words$ 123 oak ln, marie ny (123,"oak ln",,"123 oak ln",marie,NY,,,US) 123 oak ln, new marie ny (123,"oak ln",,"123 oak ln","new marie",NY,,,US) +529 Main Street, Boston, MA 021 (529,"Main Street",,"529 Main Street",Boston,MA,021,,US) +529 Main Street, Boston, MA 021, France (529,"Main Street",,"529 Main Street",Boston,MA,021,,FR) +100 Peachtree St, Atlanta, Georgia (100,"Peachtree St",,"100 Peachtree St",Atlanta,GA,,,US) +212 n 3rd ave, Minneapolis, mn 55401, USA (212,"n 3rd ave",,"212 n 3rd ave",Minneapolis,MN,55401,,US) +26 Court Street, Boston, Massachusetts 02109, FR (26,"Court Street",,"26 Court Street",Boston,MA,02109,,FR) +26 Court Street, Boston, MA 02109, Rear (26,"Court Street, Boston, MA 02109",,"26 Court Street, Boston, MA 02109",Rear,,,,US) +212 N 3rd Ave, Minneapolis, MN 55401, Suite A (212,"N 3rd Ave, Minneapolis, MN 55401",,"212 N 3rd Ave, Minneapolis, MN 55401","Suite A",,,,US) +26 Court Street, Boston, Massachusetts 02109, France (26,"Court Street",,"26 Court Street",Boston,MA,02109,,FR) +10 Main Street, Toronto, ON M5V 2T6, France (10,"Main Street",,"10 Main Street",Toronto,ON,"M5V 2T6",,FR) \. select id, instring, outstring as expected, parse_address(instring) as got_result diff --git a/extensions/postgis_tiger_geocoder/Makefile.in b/extensions/postgis_tiger_geocoder/Makefile.in index e0faf1caf..d2b5029d4 100644 --- a/extensions/postgis_tiger_geocoder/Makefile.in +++ b/extensions/postgis_tiger_geocoder/Makefile.in @@ -30,7 +30,7 @@ DATA_built = \ $(NULL) REGRESS = test-normalize_address test-upgrade -REGRESS_OPTS = --load-extension=fuzzystrmatch --load-extension=postgis --load-extension=$(EXTENSION) +REGRESS_OPTS = --load-extension=fuzzystrmatch --load-extension=postgis EXTSCHEMA_SUPPORTED = yes ## PostgreSQL < 16 doesn't understand new @extschema:extname@ syntax, so strip it @@ -46,6 +46,7 @@ ifeq (@ADDRESS_STANDARDIZER@,address_standardizer) REGRESS += test-pagc_normalize_address REGRESS_OPTS += --load-extension=address_standardizer endif +REGRESS_OPTS += --load-extension=$(EXTENSION) all: sql/$(EXTENSION)_pre.sql sql/$(EXTENSION)--$(EXTVERSION).sql sql/$(EXTENSION)--unpackaged--$(EXTVERSION).sql sql/$(EXTENSION)--ANY--$(EXTVERSION).sql sql/test-normalize_address.sql sql/test-pagc_normalize_address.sql expected/test-normalize_address.out expected/test-pagc_normalize_address.out sql/test-upgrade.sql expected/test-upgrade.out diff --git a/extensions/postgis_tiger_geocoder/postgis_tiger_geocoder.control.in b/extensions/postgis_tiger_geocoder/postgis_tiger_geocoder.control.in index 647cba6b8..ed256b89d 100644 --- a/extensions/postgis_tiger_geocoder/postgis_tiger_geocoder.control.in +++ b/extensions/postgis_tiger_geocoder/postgis_tiger_geocoder.control.in @@ -5,4 +5,4 @@ relocatable = false schema = tiger requires = 'postgis,fuzzystrmatch' superuser= false -no_relocate = 'postgis,fuzzystrmatch' \ No newline at end of file +no_relocate = 'postgis,fuzzystrmatch' diff --git a/extensions/postgis_tiger_geocoder/sql_bits/norm_addy_create.sql.in b/extensions/postgis_tiger_geocoder/sql_bits/norm_addy_create.sql.in index 7b70bf876..121548f8b 100644 --- a/extensions/postgis_tiger_geocoder/sql_bits/norm_addy_create.sql.in +++ b/extensions/postgis_tiger_geocoder/sql_bits/norm_addy_create.sql.in @@ -9,5 +9,6 @@ CREATE TYPE norm_addy AS ( stateAbbrev VARCHAR, zip VARCHAR, parsed BOOLEAN, - zip4 varchar, - address_alphanumeric varchar); + zip4 varchar(4), + address_alphanumeric varchar, + country varchar(2)); diff --git a/extensions/postgis_tiger_geocoder/sql_bits/norm_addy_upgrade.sql.in b/extensions/postgis_tiger_geocoder/sql_bits/norm_addy_upgrade.sql.in index 99bf4364c..77561fa14 100644 --- a/extensions/postgis_tiger_geocoder/sql_bits/norm_addy_upgrade.sql.in +++ b/extensions/postgis_tiger_geocoder/sql_bits/norm_addy_upgrade.sql.in @@ -1,2 +1,3 @@ ALTER TYPE tiger.norm_addy ADD ATTRIBUTE zip4 varchar(4); -ALTER TYPE tiger.norm_addy ADD ATTRIBUTE address_alphanumeric varchar; \ No newline at end of file +ALTER TYPE tiger.norm_addy ADD ATTRIBUTE address_alphanumeric varchar; +ALTER TYPE tiger.norm_addy ADD ATTRIBUTE country varchar(2); diff --git a/extensions/postgis_tiger_geocoder/sql_bits/upgrade_before.sql.in b/extensions/postgis_tiger_geocoder/sql_bits/upgrade_before.sql.in index 5bba06428..bcaba281d 100644 --- a/extensions/postgis_tiger_geocoder/sql_bits/upgrade_before.sql.in +++ b/extensions/postgis_tiger_geocoder/sql_bits/upgrade_before.sql.in @@ -1,10 +1,41 @@ -- these introduced in PostGIS 2.4 DO language plpgsql $$ - BEGIN - ALTER TYPE tiger.norm_addy ADD ATTRIBUTE zip4 varchar; +DECLARE + norm_addy_relid oid := (SELECT typrelid FROM pg_type WHERE oid = 'tiger.norm_addy'::regtype); +BEGIN + /* + * Check each attribute independently so upgrades from releases that already + * have zip4/address_alphanumeric still pick up newer additions like country. + */ + IF NOT EXISTS ( + SELECT 1 + FROM pg_attribute + WHERE attrelid = norm_addy_relid + AND attname = 'zip4' + AND NOT attisdropped + ) THEN + ALTER TYPE tiger.norm_addy ADD ATTRIBUTE zip4 varchar(4); + END IF; + + IF NOT EXISTS ( + SELECT 1 + FROM pg_attribute + WHERE attrelid = norm_addy_relid + AND attname = 'address_alphanumeric' + AND NOT attisdropped + ) THEN ALTER TYPE tiger.norm_addy ADD ATTRIBUTE address_alphanumeric varchar; - EXCEPTION - WHEN others THEN -- ignore the error probably cause it already exists - END; -$$; \ No newline at end of file + END IF; + + IF NOT EXISTS ( + SELECT 1 + FROM pg_attribute + WHERE attrelid = norm_addy_relid + AND attname = 'country' + AND NOT attisdropped + ) THEN + ALTER TYPE tiger.norm_addy ADD ATTRIBUTE country varchar(2); + END IF; +END; +$$; diff --git a/extras/tiger_geocoder/create_geocode.sql b/extras/tiger_geocoder/create_geocode.sql index 58647c154..daaa98f33 100644 --- a/extras/tiger_geocoder/create_geocode.sql +++ b/extras/tiger_geocoder/create_geocode.sql @@ -34,7 +34,7 @@ CREATE TYPE norm_addy AS ( location VARCHAR, stateAbbrev VARCHAR, zip VARCHAR, - parsed BOOLEAN, zip4 varchar, address_alphanumeric varchar); + parsed BOOLEAN, zip4 varchar(4), address_alphanumeric varchar, country varchar(2)); -- System/General helper functions \i utility/utmzone.sql @@ -82,4 +82,4 @@ COMMIT; -- Tiger to PostGIS Topology -- only usable if you have topology installed -\i topology/tiger_topology_loader.sql \ No newline at end of file +\i topology/tiger_topology_loader.sql diff --git a/extras/tiger_geocoder/normalize/normalize_address.sql b/extras/tiger_geocoder/normalize/normalize_address.sql index 7af89b318..59bd9f148 100644 --- a/extras/tiger_geocoder/normalize/normalize_address.sql +++ b/extras/tiger_geocoder/normalize/normalize_address.sql @@ -71,6 +71,8 @@ DECLARE rec RECORD; ws VARCHAR; rawInput VARCHAR; + parse_address_helper oid := to_regprocedure('parse_address(text)'); + strip_country_helper oid := to_regprocedure('strip_explicit_country(text)'); -- is this a highway -- (we treat these differently since the road name often comes after the streetType) isHighway boolean := false; @@ -87,6 +89,22 @@ BEGIN RETURN result; END IF; + /* + * Legacy tiger SQL can still be installed without address_standardizer. + * Probe for the newer country helpers before using them. + */ + IF parse_address_helper IS NOT NULL THEN + EXECUTE 'SELECT NULLIF((parse_address($1)).country, '''')' + INTO result.country + USING rawInput; + END IF; + + IF strip_country_helper IS NOT NULL THEN + EXECUTE 'SELECT strip_explicit_country($1)' + INTO rawInput + USING rawInput; + END IF; + ws := E'[ ,.\t\n\f\r]'; IF debug_flag THEN diff --git a/extras/tiger_geocoder/normalize/pprint_addy.sql b/extras/tiger_geocoder/normalize/pprint_addy.sql index 900ee952b..f9ad31347 100644 --- a/extras/tiger_geocoder/normalize/pprint_addy.sql +++ b/extras/tiger_geocoder/normalize/pprint_addy.sql @@ -37,7 +37,13 @@ BEGIN || COALESCE(input.stateAbbrev || ' ' , '') || cull_null(input.zip) || COALESCE('-' || input.zip4, ''); - RETURN trim(result); + result := trim(result); + + IF result <> '' AND input.country IS NOT NULL THEN + result := result || ', ' || input.country; + END IF; + + RETURN result; END; $_$ LANGUAGE plpgsql IMMUTABLE; diff --git a/extras/tiger_geocoder/pagc_normalize/pagc_normalize_address.sql b/extras/tiger_geocoder/pagc_normalize/pagc_normalize_address.sql index e1acdaddc..befce7643 100644 --- a/extras/tiger_geocoder/pagc_normalize/pagc_normalize_address.sql +++ b/extras/tiger_geocoder/pagc_normalize/pagc_normalize_address.sql @@ -20,10 +20,12 @@ BEGIN rawInput := trim(in_rawinput); var_parse_rec := parse_address(rawInput); + result.location := var_parse_rec.city; result.stateAbbrev := trim(var_parse_rec.state); result.zip := var_parse_rec.zip; result.zip4 := NULLIF(var_parse_rec.zipplus,''); + result.country := NULLIF(var_parse_rec.country,''); var_rec := standardize_address('pagc_lex' , 'pagc_gaz' @@ -39,6 +41,7 @@ BEGIN result.streetName := trim(var_rec.name); result.location := trim(var_rec.city); result.stateAbbrev := trim(var_rec.state); + result.country := COALESCE(NULLIF(var_rec.country,''), result.country); --this should be broken out separately like pagc, but normalizer doesn't have a slot for it result.streettypeAbbrev := trim(COALESCE(var_rec.suftype, var_rec.pretype)); result.preDirAbbrev := trim(var_rec.predir); @@ -49,4 +52,4 @@ BEGIN END $$ LANGUAGE plpgsql IMMUTABLE STRICT - COST 100; \ No newline at end of file + COST 100; diff --git a/extras/tiger_geocoder/regress/normalize_address_regress b/extras/tiger_geocoder/regress/normalize_address_regress index 6a417acaa..676bb7698 100644 --- a/extras/tiger_geocoder/regress/normalize_address_regress +++ b/extras/tiger_geocoder/regress/normalize_address_regress @@ -1,45 +1,51 @@ -#887|2450|N|COLORADO|St|||PHILADELPHIA|PA|19132|t||2450 -#1051a|212||3rd|Ave|N|Suite 560|Minneapolis|MN|55401|t||212 -#1051b|3937||43RD|Ave|S||MINNEAPOLIS|MN|55406|t||3937 -#1051c|212|N|3rd|Ave|||Minneapolis|MN|55401|t||212 -#1051d|212||3rd|Ave|N||Minneapolis|MN|55401|t||212 -529||Main|St|||Boston|MA|02129|t||529 -529||Main|St|||Boston|MA|02129|t||529 -529||Main|St|||Boston|MA||t||529 -529||Main|St||Apt 201|Boston|MA|02129|t||529 -529||Main|St||Apt 201|Boston|MA|02129|t||529 -529||Main|St||Apt 201|Boston|MA||t||529 -#1108a|529||Main|St||Suite 201|Boston|MA|02129|t||529 -#1073a|212||3rd|Ave|N||MINNEAPOLIS|MN|553404|t|4|212 -#1073b|212||3rd|Ave|N||MINNEAPOLIS|MN|55401|t||212 -#1073c|529||Main|St|||Boston|MA|021|t||529 -#1086a|949|N|3rd|St|||New Hyde Park|NY|11040|t||949 -#1086b|949|N|3rd|St|||New Hyde Park|NY|11040|t||949 -#1076a|16725||24|Co Rd|||Plymouth|MN|55447|t||16725 -#1076b|16725||24|Co Rd|||Plymouth|MN|55447|t||16725 -#1076c|13800||9|Co Hwy|||Andover|MN|55304|t||13800 -#1076d|13800||9||||Andover|MN|55304|t||13800 -#1076e|14||Forest|Rd|||Acton|MA||t||14 -#1076f|1940||C|Co Rd|W||Roseville|MN|55113|t||1940 -#1076g|3900||6|Rte|||Eastham|MA|02642|t||3900 -#1076h|4533||PARK|Ave|S||MINNEAPOLIS|MN|55407|t||4533 -#1076i|4533||33|Co Rd|||MINNEAPOLIS|MN|55407|t||4533 -#1109a|4373||LAKE|Dr|||ROBBINSDALE|MN|55422|t||4373 -#1109b|4373||LAKE|Dr|||ROBBINSDALE|MN|55422|t||4373 -#1074a|3420||RHODE ISLAND|Ave|S||ST. LOUIS PARK|MN|55426|t||3420 -#1074b|26||Court|St|||Boston|MA|02109|t||26 -#1112a|8401|W|35W|Svc Dr|NE||Blaine|MN|55449|t||8401 -#1112b|8401||35W||||Blaine|MN|55449|t||8401 -#1112c|8401||35W||W||Blaine|MN|55449|t||8401 -#1112d|8401|W|35W||||Blaine|MN|55449|t||8401 -#1112e|8401|W|35W||||Blaine|MN|55449|t||8401 -#1125a|19596 Co Rd 480, COLCORD, OK 74338 -#1125b|4345 353 Rte, SALAMANCA, NY 14779|4345||353|Rte|||SALAMANCA|NY|14779|t||4345 -#1125c|19799 State Rte O, COSBY, MO 64436|19799||O|State Rte|||COSBY|MO|64436|t||19799 -#1125d|Interstate Interstate 90, Boston, MA|||Interstate 90||||Boston|MA||t||Interstate -#1125e|I-90 I-90,Boston, MA|||I-90,Boston|||||MA||t||I-90 -#1125f|I I 90, Boston, MA|||I 90||||Boston|MA||t||I -#1310a|1110 W CAPITOL Ave, WEST SACRAMENTO, CA|1110|W|CAPITOL|Ave|||WEST SACRAMENTO|CA||t||1110 -#1614a|8435 Co Rd 20 SE, ROCHESTER, MN 55904|8435||20|Co Rd|SE||ROCHESTER|MN|55904|t||8435 -#1614b|3208 US Hwy 52, Rochester, MN 55901|3208||52|US Hwy|||Rochester|MN|55901|t||3208 -#1108a|529 Main St, Suite 201, Boston, MA 02129|529||Main|St||Suite 201|Boston|MA|02129|t||529 +#887|2450|N|COLORADO|St|||PHILADELPHIA|PA|19132|t||2450|US +#1051a|212||3rd|Ave|N|Suite 560|Minneapolis|MN|55401|t||212|US +#1051b|3937||43RD|Ave|S||MINNEAPOLIS|MN|55406|t||3937|US +#1051c|212|N|3rd|Ave|||Minneapolis|MN|55401|t||212|US +#1599|212|N|3rd|Ave|||Minneapolis|MN|55401|t||212|US +#1599b|212|N|3rd|Ave|||Minneapolis|MN|55401|t||212|FR +#1599c|26||Court|St|||Boston|MA|02109|t||26|FR +#1599d|529||Main|St|||Boston|MA|021|t||529|FR +#1599e|26||Court|St|||Boston|MA|02109|t||26|FR +#1051d|212||3rd|Ave|N||Minneapolis|MN|55401|t||212|US +529||Main|St|||Boston|MA|02129|t||529|US +529||Main|St|||Boston|MA|02129|t||529|US +529||Main|St|||Boston|MA||t||529|US +529||Main|St||Apt 201|Boston|MA|02129|t||529|US +529||Main|St||Apt 201|Boston|MA|02129|t||529|US +529||Main|St||Apt 201|Boston|MA||t||529|US +#1108a|529||Main|St||Suite 201|Boston|MA|02129|t||529|US +#1073a|212||3rd|Ave|N||MINNEAPOLIS|MN|553404|t|4|212|US +#1073b|212||3rd|Ave|N||MINNEAPOLIS|MN|55401|t||212|US +#1073c|529||Main|St|||Boston|MA|021|t||529|US +#1086a|949|N|3rd|St|||New Hyde Park|NY|11040|t||949|US +#1086b|949|N|3rd|St|||New Hyde Park|NY|11040|t||949|US +#1076a|16725||24|Co Rd|||Plymouth|MN|55447|t||16725|US +#1076b|16725||24|Co Rd|||Plymouth|MN|55447|t||16725|US +#1076c|13800||9|Co Hwy|||Andover|MN|55304|t||13800|US +#1076d|13800||9||||Andover|MN|55304|t||13800|US +#1076e|14||Forest|Rd|||Acton|MA||t||14|US +#1076f|1940||C|Co Rd|W||Roseville|MN|55113|t||1940|US +#1076g|3900||6|Rte|||Eastham|MA|02642|t||3900|US +#1076h|4533||PARK|Ave|S||MINNEAPOLIS|MN|55407|t||4533|US +#1076i|4533||33|Co Rd|||MINNEAPOLIS|MN|55407|t||4533|US +#1109a|4373||LAKE|Dr|||ROBBINSDALE|MN|55422|t||4373|US +#1109b|4373||LAKE|Dr|||ROBBINSDALE|MN|55422|t||4373|US +#1074a|3420||RHODE ISLAND|Ave|S||ST. LOUIS PARK|MN|55426|t||3420|US +#1074b|26||Court|St|||Boston|MA|02109|t||26|US +#1112a|8401|W|35W|Svc Dr|NE||Blaine|MN|55449|t||8401|US +#1112b|8401||35W||||Blaine|MN|55449|t||8401|US +#1112c|8401||35W||W||Blaine|MN|55449|t||8401|US +#1112d|8401|W|35W||||Blaine|MN|55449|t||8401|US +#1112e|8401|W|35W||||Blaine|MN|55449|t||8401|US +#1125a|19596 Co Rd 480, COLCORD, OK 74338, US +#1125b|4345 353 Rte, SALAMANCA, NY 14779, US|4345||353|Rte|||SALAMANCA|NY|14779|t||4345|US +#1125c|19799 State Rte O, COSBY, MO 64436, US|19799||O|State Rte|||COSBY|MO|64436|t||19799|US +#1125d|Interstate Interstate 90, Boston, MA, US|||Interstate 90||||Boston|MA||t||Interstate|US +#1125e|I-90 I-90,Boston, MA, US|||I-90,Boston|||||MA||t||I-90|US +#1125f|I I 90, Boston, MA, US|||I 90||||Boston|MA||t||I|US +#1599g| +#1310a|1110 W CAPITOL Ave, WEST SACRAMENTO, CA, US|1110|W|CAPITOL|Ave|||WEST SACRAMENTO|CA||t||1110|US +#1614a|8435 Co Rd 20 SE, ROCHESTER, MN 55904, US|8435||20|Co Rd|SE||ROCHESTER|MN|55904|t||8435|US +#1614b|3208 US Hwy 52, Rochester, MN 55901, US|3208||52|US Hwy|||Rochester|MN|55901|t||3208|US +#1108a|529 Main St, Suite 201, Boston, MA 02129, US|529||Main|St||Suite 201|Boston|MA|02129|t||529|US diff --git a/extras/tiger_geocoder/regress/normalize_address_regress.sql b/extras/tiger_geocoder/regress/normalize_address_regress.sql index 0447bdfdf..46749542e 100644 --- a/extras/tiger_geocoder/regress/normalize_address_regress.sql +++ b/extras/tiger_geocoder/regress/normalize_address_regress.sql @@ -3,6 +3,11 @@ SELECT '#887' As ticket, * FROM normalize_address('2450 N COLORADO ST, PHILADELP SELECT '#1051a' As ticket, * FROM normalize_address('212 3rd Ave N Suite 560, Minneapolis, MN 55401'); SELECT '#1051b' As ticket, * FROM normalize_address('3937 43RD AVE S, MINNEAPOLIS, MN 55406'); SELECT '#1051c' As ticket, * FROM normalize_address('212 N 3rd Ave, Minneapolis, MN 55401'); +SELECT '#1599' As ticket, * FROM normalize_address('212 n 3rd ave, Minneapolis, mn 55401, USA'); +SELECT '#1599b' As ticket, * FROM normalize_address('212 n 3rd ave, Minneapolis, mn 55401, France'); +SELECT '#1599c' As ticket, * FROM normalize_address('26 Court Street, Boston, Massachusetts 02109, France'); +SELECT '#1599d' As ticket, * FROM normalize_address('529 Main Street, Boston, MA 021, France'); +SELECT '#1599e' As ticket, * FROM normalize_address('26 Court Street, Boston, Massachusetts 02109, FR'); -- City missing , -- NOTE this one won't normalize right if you don't have MN data loaded SELECT '#1051d' As ticket, * FROM normalize_address('212 3rd Ave N Minneapolis, MN 55401'); -- comma in wrong spot @@ -86,6 +91,7 @@ SELECT '#1125d' As ticket, pprint_addy(addy), addy.* FROM normalize_address('Int SELECT '#1125e' As ticket, pprint_addy(addy), addy.* FROM normalize_address('I-90,Boston, MA') As addy; --broke this one too SELECT '#1125f' As ticket, pprint_addy(addy), addy.* FROM normalize_address('I 90,Boston, MA') As addy; +SELECT '#1599g' As ticket, pprint_addy(ROW(NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,true,NULL,NULL,'US')::norm_addy); -- location with prefixes getting caught in post prefix SELECT '#1310a' As ticket, pprint_addy(addy), addy.* FROM normalize_address('1110 W CAPITOL AVE, WEST SACRAMENTO, CA') As addy; diff --git a/extras/tiger_geocoder/regress/pagc_normalize_address_regress b/extras/tiger_geocoder/regress/pagc_normalize_address_regress index 95216890b..9ea5fefd6 100644 --- a/extras/tiger_geocoder/regress/pagc_normalize_address_regress +++ b/extras/tiger_geocoder/regress/pagc_normalize_address_regress @@ -1,53 +1,58 @@ true -#887|2450|N|COLORADO|ST|||PHILADELPHIA|PA|19132|t||2450 -#1051a|212||3RD|AVE|N|STE 560|MINNEAPOLIS|MN|55401|t||212 -#1051b|3937||43RD|AVE|S||MINNEAPOLIS|MN|55406|t||3937 -#1051c|212|N|3RD|AVE|||MINNEAPOLIS|MN|55401|t||212 -#1051d|212||3RD|AVE|N||MINNEAPOLIS|MN|55401|t||212 -529||MAIN|ST|||BOSTON|MA|02129|t||529 -529||MAIN|ST|||BOSTON|MA|02129|t||529 -529||MAIN|ST|||BOSTON|MA||t||529 -529||MAIN|ST||APT 201|BOSTON|MA|02129|t||529 -529||MAIN|ST||APT 201|BOSTON|MA|02129|t||529 -529||MAIN|ST||APT 201|BOSTON|MA||t||529 -#1108a|529||MAIN|ST||STE 201|BOSTON|MA|02129|t||529 -#1073a|212||3RD|AVE|N||MINNEAPOLIS|MN|55340|t|4|212 -#1073b|212||3RD|AVE|N||MINNEAPOLIS|MN|55401|t||212 -#1073c|529||MAIN|ST||BOSTON|MASSACHUSETTS||021|t||529 -#1086a|949|N|3RD|ST|||NEW HYDE PARK|NY|11040|t||949 -#1086b|949|N|3RD|ST|||NEW HYDE PARK|NY|11040|t||949 -#1076a|16725||24|CO RD|||PLYMOUTH|MN|55447|t||16725 -#1076b|16725||24|CO RD|||PLYMOUTH|MN|55447|t||16725 -#1076c|13800||9|CO HWY|||ANDOVER|MN|55304|t||13800 -#1076d|13800||9||||ANDOVER|MN|55304|t||13800 -#1076e|14||FOREST|RD|||ACTON|MA||t||14 -#1076f|1940||C|CO RD|W||ROSEVILLE|MN|55113|t||1940 -#1076g|3900||6|RTE|||EASTHAM|MA|02642|t||3900 -#1076h|4533||PARK|AVE|S||MINNEAPOLIS|MN|55407|t||4533 -#1076i|4533||33|CO RD|||MINNEAPOLIS|MN|55407|t||4533 -#1109a|4373||LAKE|DR|||ROBBINSDALE|MN|55422|t||4373 -#1109b|4373||LAKE|DR|||ROBBINSDALE|MN|55422|t||4373 -#1074a|3420||RHODE ISLAND|AVE|S||SAINT LOUIS PARK|MN|55426|t||3420 -#1074b|26||COURT|ST|||BOSTON|MA|02109|t||26 -#1112a|8401|W|35 W|SVC DR|NE||BLAINE|MN|55449|t||8401 -#1112b|8401||35 W||||BLAINE|MN|55449|t||8401 -#1112c|8401||35 W||W||BLAINE|MN|55449|t||8401 -#1112d|8401|W|35||W||BLAINE|MN|55449|t||8401 -#1112e|8401|W|35||W||BLAINE|MN|55449|t||8401 -#1125a|19596 CO RD 480, COLCORD, OK 74338 -#1125b|4345 353 RTE, SALAMANCA, NY 14779|4345||353|RTE|||SALAMANCA|NY|14779|t||4345 -#1125c|19799 STATE RTE 0, COSBY, MO 64436|19799||0|STATE RTE|||COSBY|MO|64436|t||19799 -#1125d|||||||||||t|| -#1125e|||||||||||t|| -#1125f|||||||||||t|| -#1310a|1110 W CAPITOL AVE, WEST SACRAMENTO, CA|1110|W|CAPITOL|AVE|||WEST SACRAMENTO|CA||t||1110 -#1614a|8435 CO RD 20 SE, ROCHESTER, MN 55904|8435||20|CO RD|SE||ROCHESTER|MN|55904|t||8435 -#1614b|3208 US RTE 52, ROCHESTER, MN 55901|3208||52|US RTE|||ROCHESTER|MN|55901|t||3208 -#1108a|529 MAIN ST, STE 201, BOSTON, MA 02129|529||MAIN|ST||STE 201|BOSTON|MA|02129|t||529 -#3259a|212||3RD|AVE|N|STE 560|MINNEAPOLIS|MN|55401|t||212 -#3259b|3937||43RD|AVE|S||MINNEAPOLIS|MN|55406|t||3937 -#2981|1566||NEW STATE HWY||||RAYNHAM|MA||t||1566 -#2978a|10||DORRANCE|ST|||PROVIDENCE|RI||t||10 20 -#2978b|10||DORRANCE|ST|||PROVIDENCE|RI||t||10 20 -#2978c|10||DORRANCE|ST|||PROVIDENCE|RI||t||10 20 +#887|2450|N|COLORADO|ST|||PHILADELPHIA|PA|19132|t||2450|US +#1051a|212||3RD|AVE|N|STE 560|MINNEAPOLIS|MN|55401|t||212|US +#1051b|3937||43RD|AVE|S||MINNEAPOLIS|MN|55406|t||3937|US +#1051c|212|N|3RD|AVE|||MINNEAPOLIS|MN|55401|t||212|US +#1599|212|N|3RD|AVE|||MINNEAPOLIS|MN|55401|t||212|US +#1599b|212|N|3RD|AVE|||MINNEAPOLIS|MN|55401|t||212|FR +#1599c|26||COURT|ST|||BOSTON|MA|02109|t||26|FR +#1599d|529||MAIN|ST|||BOSTON|MA|021|t||529|FR +#1599e|26||COURT|ST|||BOSTON|MA|02109|t||26|FR +#1051d|212||3RD|AVE|N||MINNEAPOLIS|MN|55401|t||212|US +529||MAIN|ST|||BOSTON|MA|02129|t||529|US +529||MAIN|ST|||BOSTON|MA|02129|t||529|US +529||MAIN|ST|||BOSTON|MA||t||529|US +529||MAIN|ST||APT 201|BOSTON|MA|02129|t||529|US +529||MAIN|ST||APT 201|BOSTON|MA|02129|t||529|US +529||MAIN|ST||APT 201|BOSTON|MA||t||529|US +#1108a|529||MAIN|ST||STE 201|BOSTON|MA|02129|t||529|US +#1073a|212||3RD|AVE|N||MINNEAPOLIS|MN|55340|t|4|212|US +#1073b|212||3RD|AVE|N||MINNEAPOLIS|MN|55401|t||212|US +#1073c|529||MAIN|ST|||BOSTON|MA|021|t||529|US +#1086a|949|N|3RD|ST|||NEW HYDE PARK|NY|11040|t||949|US +#1086b|949|N|3RD|ST|||NEW HYDE PARK|NY|11040|t||949|US +#1076a|16725||24|CO RD|||PLYMOUTH|MN|55447|t||16725|US +#1076b|16725||24|CO RD|||PLYMOUTH|MN|55447|t||16725|US +#1076c|13800||9|CO HWY|||ANDOVER|MN|55304|t||13800|US +#1076d|13800||9||||ANDOVER|MN|55304|t||13800|US +#1076e|14||FOREST|RD|||ACTON|MA||t||14|US +#1076f|1940||C|CO RD|W||ROSEVILLE|MN|55113|t||1940|US +#1076g|3900||6|RTE|||EASTHAM|MA|02642|t||3900|US +#1076h|4533||PARK|AVE|S||MINNEAPOLIS|MN|55407|t||4533|US +#1076i|4533||33|CO RD|||MINNEAPOLIS|MN|55407|t||4533|US +#1109a|4373||LAKE|DR|||ROBBINSDALE|MN|55422|t||4373|US +#1109b|4373||LAKE|DR|||ROBBINSDALE|MN|55422|t||4373|US +#1074a|3420||RHODE ISLAND|AVE|S||SAINT LOUIS PARK|MN|55426|t||3420|US +#1074b|26||COURT|ST|||BOSTON|MA|02109|t||26|US +#1112a|8401|W|35 W|SVC DR|NE||BLAINE|MN|55449|t||8401|US +#1112b|8401||35 W||||BLAINE|MN|55449|t||8401|US +#1112c|8401||35 W||W||BLAINE|MN|55449|t||8401|US +#1112d|8401|W|35||W||BLAINE|MN|55449|t||8401|US +#1112e|8401|W|35||W||BLAINE|MN|55449|t||8401|US +#1125a|19596 CO RD 480, COLCORD, OK 74338, US +#1125b|4345 353 RTE, SALAMANCA, NY 14779, US|4345||353|RTE|||SALAMANCA|NY|14779|t||4345|US +#1125c|19799 STATE RTE 0, COSBY, MO 64436, US|19799||0|STATE RTE|||COSBY|MO|64436|t||19799|US +#1125d|||||||||||t|||US +#1125e|||||||||||t|||US +#1125f|||||||||||t|||US +#1310a|1110 W CAPITOL AVE, WEST SACRAMENTO, CA, US|1110|W|CAPITOL|AVE|||WEST SACRAMENTO|CA||t||1110|US +#1614a|8435 CO RD 20 SE, ROCHESTER, MN 55904, US|8435||20|CO RD|SE||ROCHESTER|MN|55904|t||8435|US +#1614b|3208 US RTE 52, ROCHESTER, MN 55901, US|3208||52|US RTE|||ROCHESTER|MN|55901|t||3208|US +#1108a|529 MAIN ST, STE 201, BOSTON, MA 02129, US|529||MAIN|ST||STE 201|BOSTON|MA|02129|t||529|US +#3259a|212||3RD|AVE|N|STE 560|MINNEAPOLIS|MN|55401|t||212|US +#3259b|3937||43RD|AVE|S||MINNEAPOLIS|MN|55406|t||3937|US +#2981|1566||NEW STATE HWY||||RAYNHAM|MA||t||1566|US +#2978a|10||DORRANCE|ST|||PROVIDENCE|RI||t||10 20|US +#2978b|10||DORRANCE|ST|||PROVIDENCE|RI||t||10 20|US +#2978c|10||DORRANCE|ST|||PROVIDENCE|RI||t||10 20|US false diff --git a/extras/tiger_geocoder/regress/pagc_normalize_address_regress.sql b/extras/tiger_geocoder/regress/pagc_normalize_address_regress.sql index abd6d094b..783732fce 100644 --- a/extras/tiger_geocoder/regress/pagc_normalize_address_regress.sql +++ b/extras/tiger_geocoder/regress/pagc_normalize_address_regress.sql @@ -7,6 +7,11 @@ SELECT '#1051a' As ticket, * FROM normalize_address('212 3rd Ave N Suite 560, Mi SELECT '#1051b' As ticket, * FROM normalize_address('3937 43RD AVE S, MINNEAPOLIS, MN 55406'); -- this currently turns 3rd to 3, we want to fix to keep 3rd as is SELECT '#1051c' As ticket, * FROM normalize_address('212 N 3rd Ave, Minneapolis, MN 55401'); +SELECT '#1599' As ticket, * FROM normalize_address('212 n 3rd ave, Minneapolis, mn 55401, USA'); +SELECT '#1599b' As ticket, * FROM normalize_address('212 n 3rd ave, Minneapolis, mn 55401, France'); +SELECT '#1599c' As ticket, * FROM normalize_address('26 Court Street, Boston, Massachusetts 02109, France'); +SELECT '#1599d' As ticket, * FROM normalize_address('529 Main Street, Boston, MA 021, France'); +SELECT '#1599e' As ticket, * FROM normalize_address('26 Court Street, Boston, Massachusetts 02109, FR'); -- this currently turns 3rd to 3, we want to fix to keep 3rd as is SELECT '#1051d' As ticket, * FROM normalize_address('212 3rd Ave N Minneapolis, MN 55401'); -- comma in wrong spot diff --git a/extras/tiger_geocoder/upgrade_geocode.sql b/extras/tiger_geocoder/upgrade_geocode.sql index 1057a3a8b..c98decd9f 100644 --- a/extras/tiger_geocoder/upgrade_geocode.sql +++ b/extras/tiger_geocoder/upgrade_geocode.sql @@ -28,12 +28,43 @@ ALTER TABLE state_lookup ADD CONSTRAINT state_lookup_statefp_key UNIQUE(statefp) -- these introduced in PostGIS 2.4 DO language plpgsql $$ - BEGIN - ALTER TYPE tiger.norm_addy ADD ATTRIBUTE zip4 varchar; +DECLARE + norm_addy_relid oid := (SELECT typrelid FROM pg_type WHERE oid = 'tiger.norm_addy'::regtype); +BEGIN + /* + * Check each attribute independently so upgrades from releases that already + * have zip4/address_alphanumeric still pick up newer additions like country. + */ + IF NOT EXISTS ( + SELECT 1 + FROM pg_attribute + WHERE attrelid = norm_addy_relid + AND attname = 'zip4' + AND NOT attisdropped + ) THEN + ALTER TYPE tiger.norm_addy ADD ATTRIBUTE zip4 varchar(4); + END IF; + + IF NOT EXISTS ( + SELECT 1 + FROM pg_attribute + WHERE attrelid = norm_addy_relid + AND attname = 'address_alphanumeric' + AND NOT attisdropped + ) THEN ALTER TYPE tiger.norm_addy ADD ATTRIBUTE address_alphanumeric varchar; - EXCEPTION - WHEN others THEN -- ignore the error probably cause it already exists - END; + END IF; + + IF NOT EXISTS ( + SELECT 1 + FROM pg_attribute + WHERE attrelid = norm_addy_relid + AND attname = 'country' + AND NOT attisdropped + ) THEN + ALTER TYPE tiger.norm_addy ADD ATTRIBUTE country varchar(2); + END IF; +END; $$; CREATE INDEX idx_tiger_edges_countyfp ON edges USING btree(countyfp); ----------------------------------------------------------------------- Summary of changes: NEWS | 4 + doc/extras_address_standardizer.xml | 5 +- doc/installation.xml | 2 +- extensions/address_standardizer/address_parser.c | 17 + .../address_standardizer/address_standardizer.c | 8 + .../address_standardizer_functions.sql.in | 4 + .../expected/test-standardize_address_1.out | 12 +- extensions/address_standardizer/parseaddress-api.c | 242 +++++- extensions/address_standardizer/parseaddress-api.h | 2 + .../address_standardizer/parseaddress-countries.h | 942 +++++++++++++++++++++ .../address_standardizer/test-parseaddress.sql.in | 9 + extensions/postgis_tiger_geocoder/Makefile.in | 3 +- .../postgis_tiger_geocoder.control.in | 2 +- .../sql_bits/norm_addy_create.sql.in | 5 +- .../sql_bits/norm_addy_upgrade.sql.in | 3 +- .../sql_bits/upgrade_before.sql.in | 43 +- extras/tiger_geocoder/create_geocode.sql | 4 +- .../tiger_geocoder/normalize/normalize_address.sql | 18 + extras/tiger_geocoder/normalize/pprint_addy.sql | 8 +- .../pagc_normalize/pagc_normalize_address.sql | 5 +- .../regress/normalize_address_regress | 96 ++- .../regress/normalize_address_regress.sql | 6 + .../regress/pagc_normalize_address_regress | 107 +-- .../regress/pagc_normalize_address_regress.sql | 5 + extras/tiger_geocoder/upgrade_geocode.sql | 41 +- 25 files changed, 1451 insertions(+), 142 deletions(-) create mode 100644 extensions/address_standardizer/parseaddress-countries.h hooks/post-receive -- PostGIS From trac at osgeo.org Mon Mar 9 02:09:57 2026 From: trac at osgeo.org (PostGIS) Date: Mon, 09 Mar 2026 09:09:57 -0000 Subject: [PostGIS] #1599: normalize_address() confused by country In-Reply-To: <051.d971ae23b4cc45973d91a5cb2a22fabe@osgeo.org> References: <051.d971ae23b4cc45973d91a5cb2a22fabe@osgeo.org> Message-ID: <066.956e295e23824d8248c5700abf49c0ea@osgeo.org> #1599: normalize_address() confused by country ----------------------------------+----------------------------- Reporter: mikepease | Owner: robe Type: defect | Status: closed Priority: medium | Milestone: PostGIS Fund Me Component: pagc_address_parser | Version: master Resolution: fixed | Keywords: ----------------------------------+----------------------------- Changes (by Darafei Praliaskouski ): * resolution: => fixed * status: assigned => closed Comment: In [changeset:"20fcd89ae646c2557cf892251242bc16a76a927c/git" 20fcd89/git]: {{{#!CommitTicketReference repository="git" revision="20fcd89ae646c2557cf892251242bc16a76a927c" #1599 Improve country-aware address normalization Canonicalize explicit country tokens in the address parser, carry country through norm_addy, and add regressions for country-aware tiger normalization while keeping tiger usable without address_standardizer. Closes #1599 }}} -- Ticket URL: PostGIS The PostGIS Trac is used for bug, enhancement & task tracking, a user and developer wiki, and a view into the subversion code repository of PostGIS project. From git at osgeo.org Mon Mar 9 04:23:45 2026 From: git at osgeo.org (git at osgeo.org) Date: Mon, 9 Mar 2026 04:23:45 -0700 (PDT) Subject: [SCM] PostGIS branch master updated. 3.6.0rc2-381-gd2a87d630 Message-ID: <20260309112345.CC3611AFF96@trac.osgeo.org> 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 d2a87d6305a558906618f7df087ffdcf8a60d988 (commit) from 20fcd89ae646c2557cf892251242bc16a76a927c (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 d2a87d6305a558906618f7df087ffdcf8a60d988 Author: Darafei Praliaskouski Date: Mon Mar 9 14:34:50 2026 +0400 Fix #1461 geocode_intersection spacing fallback Add a narrow normalized-fullname comparison so geocode_intersection matches TIGER highway names when spacing around hyphens differs, without changing suffix-form route parsing or type-less second-street scoring. Closes #1461 diff --git a/NEWS b/NEWS index d9bf639d8..c6d77cc77 100644 --- a/NEWS +++ b/NEWS @@ -41,6 +41,9 @@ This version requires GEOS 3.10 or higher - #4828, geometry_columns handles NOT VALID SRID checks without errors (Darafei Praliaskouski) - #6048, [raster] ST_Clip no longer crashes when clipping sparse band selections (Darafei Praliaskouski) + - #1461, [tiger geocoder] geocode_intersection now tolerates irregular + spacing in highway names such as `I- 635` vs `I-635` + (OpenAI) - #1599, [address_standardizer] parse_address() and normalize_address() now canonicalize trailing country tokens to ISO 3166-1 alpha-2 codes and expose country on normalized addresses diff --git a/extensions/postgis_tiger_geocoder/Makefile.in b/extensions/postgis_tiger_geocoder/Makefile.in index d2b5029d4..c103b3069 100644 --- a/extensions/postgis_tiger_geocoder/Makefile.in +++ b/extensions/postgis_tiger_geocoder/Makefile.in @@ -29,7 +29,7 @@ DATA_built = \ sql/$(EXTENSION)--unpackaged--$(EXTVERSION).sql \ $(NULL) -REGRESS = test-normalize_address test-upgrade +REGRESS = test-normalize_address test-geocode_intersection_spacing test-upgrade REGRESS_OPTS = --load-extension=fuzzystrmatch --load-extension=postgis EXTSCHEMA_SUPPORTED = yes @@ -48,7 +48,7 @@ ifeq (@ADDRESS_STANDARDIZER@,address_standardizer) endif REGRESS_OPTS += --load-extension=$(EXTENSION) -all: sql/$(EXTENSION)_pre.sql sql/$(EXTENSION)--$(EXTVERSION).sql sql/$(EXTENSION)--unpackaged--$(EXTVERSION).sql sql/$(EXTENSION)--ANY--$(EXTVERSION).sql sql/test-normalize_address.sql sql/test-pagc_normalize_address.sql expected/test-normalize_address.out expected/test-pagc_normalize_address.out sql/test-upgrade.sql expected/test-upgrade.out +all: sql/$(EXTENSION)_pre.sql sql/$(EXTENSION)--$(EXTVERSION).sql sql/$(EXTENSION)--unpackaged--$(EXTVERSION).sql sql/$(EXTENSION)--ANY--$(EXTVERSION).sql sql/test-normalize_address.sql sql/test-geocode_intersection_spacing.sql sql/test-pagc_normalize_address.sql expected/test-normalize_address.out expected/test-geocode_intersection_spacing.out expected/test-pagc_normalize_address.out sql/test-upgrade.sql expected/test-upgrade.out .PHONY: expected @@ -71,6 +71,9 @@ endif expected/test-normalize_address.out: sql_bits/test_tuples_only_unaligned.sql.in ../../extras/tiger_geocoder/regress/normalize_address_regress | expected cat $^ > $@ +expected/test-geocode_intersection_spacing.out: sql_bits/test_tuples_only_unaligned.sql.in sql_bits/test-geocode_intersection_spacing.out.in | expected + cat $^ > $@ + expected/test-pagc_normalize_address.out: sql_bits/test_tuples_only_unaligned.sql.in ../../extras/tiger_geocoder/regress/pagc_normalize_address_regress | expected cat $^ > $@ @@ -78,6 +81,9 @@ expected/test-pagc_normalize_address.out: sql_bits/test_tuples_only_unaligned.sq sql/test-normalize_address.sql: sql_bits/test_tuples_only_unaligned.sql.in ../../extras/tiger_geocoder/regress/normalize_address_regress.sql | sql cat $^ > $@ +sql/test-geocode_intersection_spacing.sql: sql_bits/test_tuples_only_unaligned.sql.in sql_bits/test-geocode_intersection_spacing.sql.in | sql + cat $^ > $@ + sql/test-upgrade.sql: | sql echo 'ALTER EXTENSION ${EXTENSION} UPDATE TO "ANY"; ALTER EXTENSION ${EXTENSION} UPDATE TO "$(EXTVERSION)"' > $@ diff --git a/extensions/postgis_tiger_geocoder/sql_bits/test-geocode_intersection_spacing.out.in b/extensions/postgis_tiger_geocoder/sql_bits/test-geocode_intersection_spacing.out.in new file mode 100644 index 000000000..805fad2d3 --- /dev/null +++ b/extensions/postgis_tiger_geocoder/sql_bits/test-geocode_intersection_spacing.out.in @@ -0,0 +1,4 @@ +#1461c|353|Rte +#1461a|100 N Belt Line Rd, Coppell, TX 75019|POINT(-96.99 32.986)|5 +#1461b|100 N Belt Line Rd, Coppell, TX 75019|POINT(-96.99 32.986)|5 +#1461d|50 Weld Ave, Coppell, TX 75019|POINT(-96.98 32.98)|4 diff --git a/extensions/postgis_tiger_geocoder/sql_bits/test-geocode_intersection_spacing.sql.in b/extensions/postgis_tiger_geocoder/sql_bits/test-geocode_intersection_spacing.sql.in new file mode 100644 index 000000000..304f928ee --- /dev/null +++ b/extensions/postgis_tiger_geocoder/sql_bits/test-geocode_intersection_spacing.sql.in @@ -0,0 +1,63 @@ +\o /dev/null +BEGIN; + +INSERT INTO tiger.zip_lookup_base(zip, state, county, city, statefp) +VALUES ('75019', 'Texas', 'Dallas', 'Coppell', '48'); + +INSERT INTO tiger.place(statefp, placefp, plcidfp, name) +VALUES ('48', '00001', '4800001', 'Coppell'); + +INSERT INTO tiger.faces(tfid, statefp, placefp) +VALUES (2001, '48', '00001'); + +INSERT INTO tiger.edges(statefp, countyfp, tlid, tfidl, tfidr, fullname, tnidf, tnidt, the_geom) +VALUES + ('48', '113', 1001, 2001, 2001, 'N Belt Line Rd', 10, 11, + ST_GeomFromText('MULTILINESTRING((-96.990000 32.986000,-96.990000 32.987000))', 4269)), + ('48', '113', 1002, 2001, 2001, 'I- 635', 10, 12, + ST_GeomFromText('MULTILINESTRING((-96.991000 32.986000,-96.989000 32.986000))', 4269)), + ('48', '113', 1003, 2001, 2001, 'Weld Ave', 20, 21, + ST_GeomFromText('MULTILINESTRING((-96.980000 32.980000,-96.980000 32.982000))', 4269)), + ('48', '113', 1004, 2001, 2001, 'School Terrace', 20, 22, + ST_GeomFromText('MULTILINESTRING((-96.981000 32.980000,-96.980000 32.980000))', 4269)), + ('48', '113', 1005, 2001, 2001, 'Schools', 21, 23, + ST_GeomFromText('MULTILINESTRING((-96.981000 32.982000,-96.980000 32.982000))', 4269)); + +INSERT INTO tiger.featnames(statefp, tlid, fullname, name, predirabrv, suftypabrv, pretypabrv) +VALUES + ('48', 1001, 'N Belt Line Rd', 'Belt Line', 'N', 'Rd', NULL), + ('48', 1002, 'I- 635', '635', NULL, NULL, 'I-'), + ('48', 1003, 'Weld Ave', 'Weld', NULL, 'Ave', NULL), + ('48', 1004, 'School Terrace', 'School', NULL, 'Ter', NULL), + ('48', 1005, 'Schools', 'Schools', NULL, NULL, NULL); + +INSERT INTO tiger.addr(statefp, tlid, fromhn, tohn, side, zip) +VALUES + ('48', 1001, '100', '198', 'L', '75019'), + ('48', 1002, '0', '0', 'L', '75019'), + ('48', 1003, '50', '98', 'L', '75019'), + ('48', 1004, '0', '0', 'L', '75019'), + ('48', 1005, '0', '0', 'L', '75019'); + +\o +SELECT '#1461c' AS ticket, streetname, streettypeabbrev +FROM normalize_address('0 353 Rte, Coppell, TX'); + +SELECT '#1461a' AS ticket, pprint_addy(addy), ST_AsText(ST_SnapToGrid(geomout, 0.000001)), rating +FROM geocode_intersection('N. Belt Line', 'I- 635', 'TX', 'Coppell') +ORDER BY rating +LIMIT 1; + +SELECT '#1461b' AS ticket, pprint_addy(addy), ST_AsText(ST_SnapToGrid(geomout, 0.000001)), rating +FROM geocode_intersection('N. Belt Line', 'I-635', 'TX', 'Coppell') +ORDER BY rating +LIMIT 1; + +SELECT '#1461d' AS ticket, pprint_addy(addy), ST_AsText(ST_SnapToGrid(geomout, 0.000001)), rating +FROM geocode_intersection('Weld', 'School', 'TX', 'Coppell') +ORDER BY rating +LIMIT 1; + +\o /dev/null +ROLLBACK; +\o diff --git a/extras/tiger_geocoder/geocode/geocode_intersection.sql b/extras/tiger_geocoder/geocode/geocode_intersection.sql index 3029e23c1..599a1e108 100644 --- a/extras/tiger_geocoder/geocode/geocode_intersection.sql +++ b/extras/tiger_geocoder/geocode/geocode_intersection.sql @@ -23,6 +23,12 @@ $$ DECLARE var_na_road norm_addy; var_na_inter1 norm_addy; + var_road_name text; + var_road_fullname text; + var_inter_name text; + var_inter_fullname text; + var_road_input_normalized text; + var_inter_input_normalized text; var_sql text := ''; var_zip varchar(5)[]; in_statefp varchar(2) ; @@ -36,6 +42,12 @@ BEGIN var_na_road := normalize_address('0 ' || roadway1 || ', ' || COALESCE(in_city,'') || ', ' || in_state || ' ' || in_zip); var_na_inter1 := normalize_address('0 ' || roadway2 || ', ' || COALESCE(in_city,'') || ', ' || in_state || ' ' || in_zip); END IF; + var_road_name := trim(lower(COALESCE(var_na_road.streetName, ''))); + var_road_fullname := trim(lower(var_na_road.streetName || ' ' || COALESCE(var_na_road.streetTypeAbbrev,''))); + var_inter_name := trim(lower(COALESCE(var_na_inter1.streetName, ''))); + var_inter_fullname := trim(lower(var_na_inter1.streetName || ' ' || COALESCE(var_na_inter1.streetTypeAbbrev,''))); + var_road_input_normalized := normalize_street_name(trim(lower(roadway1))); + var_inter_input_normalized := normalize_street_name(trim(lower(roadway2))); in_statefp := statefp FROM state_lookup As s WHERE s.abbrev = upper(in_state); IF COALESCE(in_zip,'') > '' THEN -- limit search to 2 plus or minus the input zip var_zip := zip_range(in_zip, -2,2); @@ -54,42 +66,61 @@ BEGIN END IF; var_sql := ' WITH - a1 AS (SELECT f.*, addr.fromhn, addr.tohn, addr.side , addr.zip - FROM (SELECT * FROM tiger.featnames - WHERE statefp = $1 AND ( lower(name) = $2 ' || - CASE WHEN length(var_na_road.streetName) > 5 THEN ' or lower(fullname) LIKE $6 || ''%'' ' ELSE '' END || ')' - || ') AS f LEFT JOIN (SELECT * FROM tiger.addr As addr WHERE addr.statefp = $1) As addr ON (addr.tlid = f.tlid AND addr.statefp = f.statefp) - WHERE $5::text[] IS NULL OR addr.zip = ANY($5::text[]) OR addr.zip IS NULL - ORDER BY CASE WHEN lower(f.fullname) = $6 THEN 0 ELSE 1 END - LIMIT 50000 - ), + a1 AS (SELECT f.*, addr.fromhn, addr.tohn, addr.side , addr.zip + FROM (SELECT * FROM tiger.featnames + WHERE statefp = $1 AND ( + lower(name) = $2 ' || + CASE WHEN length(var_na_road.streetName) > 5 THEN ' or lower(fullname) LIKE $6 || ''%'' ' ELSE '' END || + ' or normalize_street_name(fullname) = $10)' + || ') AS f LEFT JOIN (SELECT * FROM tiger.addr As addr WHERE addr.statefp = $1) As addr ON (addr.tlid = f.tlid AND addr.statefp = f.statefp) + WHERE $5::text[] IS NULL OR addr.zip = ANY($5::text[]) OR addr.zip IS NULL + ORDER BY CASE + WHEN lower(f.fullname) = $6 OR normalize_street_name(f.fullname) = $10 THEN 0 + ELSE 1 END + LIMIT 50000 + ), a2 AS (SELECT f.*, addr.fromhn, addr.tohn, addr.side , addr.zip - FROM (SELECT * FROM tiger.featnames - WHERE statefp = $1 AND ( lower(name) = $4 ' || - CASE WHEN length(var_na_inter1.streetName) > 5 THEN ' or lower(fullname) LIKE $7 || ''%'' ' ELSE '' END || ')' - || ' ) AS f LEFT JOIN (SELECT * FROM tiger.addr As addr WHERE addr.statefp = $1) AS addr ON (addr.tlid = f.tlid AND addr.statefp = f.statefp) - WHERE $5::text[] IS NULL OR addr.zip = ANY($5::text[]) or addr.zip IS NULL - ORDER BY CASE WHEN lower(f.fullname) = $7 THEN 0 ELSE 1 END - LIMIT 50000 - ), - e1 AS (SELECT e.the_geom, e.tnidf, e.tnidt, a.*, - CASE WHEN a.side = ''L'' THEN e.tfidl ELSE e.tfidr END AS tfid - FROM a1 As a - INNER JOIN tiger.edges AS e ON (e.statefp = a.statefp AND a.tlid = e.tlid) - WHERE e.statefp = $1 - ORDER BY CASE WHEN lower(a.name) = $4 THEN 0 ELSE 1 END + CASE WHEN lower(e.fullname) = $7 THEN 0 ELSE 1 END - LIMIT 5000) , - e2 AS (SELECT e.the_geom, e.tnidf, e.tnidt, a.*, - CASE WHEN a.side = ''L'' THEN e.tfidl ELSE e.tfidr END AS tfid - FROM (SELECT * FROM tiger.edges WHERE statefp = $1) AS e INNER JOIN a2 AS a ON (e.statefp = a.statefp AND a.tlid = e.tlid) - INNER JOIN e1 ON (e.statefp = e1.statefp - AND ARRAY[e.tnidf, e.tnidt] && ARRAY[e1.tnidf, e1.tnidt] ) + FROM (SELECT * FROM tiger.featnames + WHERE statefp = $1 AND ( + lower(name) = $4 ' || + CASE WHEN length(var_na_inter1.streetName) > 5 THEN ' or lower(fullname) LIKE $7 || ''%'' ' ELSE '' END || + ' or normalize_street_name(fullname) = $11)' + || ' ) AS f LEFT JOIN (SELECT * FROM tiger.addr As addr WHERE addr.statefp = $1) AS addr ON (addr.tlid = f.tlid AND addr.statefp = f.statefp) + WHERE $5::text[] IS NULL OR addr.zip = ANY($5::text[]) or addr.zip IS NULL + ORDER BY CASE + WHEN lower(f.fullname) = $7 OR normalize_street_name(f.fullname) = $11 THEN 0 + ELSE 1 END + LIMIT 50000 + ), + e1 AS (SELECT e.the_geom, e.tnidf, e.tnidt, a.*, + CASE WHEN a.side = ''L'' THEN e.tfidl ELSE e.tfidr END AS tfid + FROM a1 As a + INNER JOIN tiger.edges AS e ON (e.statefp = a.statefp AND a.tlid = e.tlid) + WHERE e.statefp = $1 + ORDER BY CASE + WHEN lower(a.name) = $4 THEN 0 ELSE 1 END + + CASE + WHEN lower(e.fullname) = $7 OR normalize_street_name(e.fullname) = $11 THEN 0 + ELSE 1 END + LIMIT 5000) , + e2 AS (SELECT e.the_geom, e.tnidf, e.tnidt, a.*, + CASE WHEN a.side = ''L'' THEN e.tfidl ELSE e.tfidr END AS tfid + FROM (SELECT * FROM tiger.edges WHERE statefp = $1) AS e INNER JOIN a2 AS a ON (e.statefp = a.statefp AND a.tlid = e.tlid) + INNER JOIN e1 ON (e.statefp = e1.statefp + AND ARRAY[e.tnidf, e.tnidt] && ARRAY[e1.tnidf, e1.tnidt] ) - WHERE (lower(e.fullname) = $7 or lower(a.name) LIKE $4 || ''%'') - ORDER BY CASE WHEN lower(a.name) = $4 THEN 0 ELSE 1 END + CASE WHEN lower(e.fullname) = $7 THEN 0 ELSE 1 END - LIMIT 5000 - ), - segs AS (SELECT DISTINCT ON(e1.tlid, e1.side) + WHERE ( + lower(e.fullname) = $7 + OR normalize_street_name(e.fullname) = $11 + OR lower(a.name) LIKE $4 || ''%'') + ORDER BY CASE + WHEN lower(a.name) = $4 THEN 0 ELSE 1 END + + CASE + WHEN lower(e.fullname) = $7 OR normalize_street_name(e.fullname) = $11 THEN 0 + ELSE 1 END + LIMIT 5000 + ), + segs AS (SELECT DISTINCT ON(e1.tlid, e1.side) CASE WHEN e1.tnidf = e2.tnidf OR e1.tnidf = e2.tnidt THEN e1.fromhn ELSE @@ -101,9 +132,15 @@ BEGIN ELSE ST_EndPoint(ST_GeometryN(ST_Multi(e1.the_geom),1)) END AS geom , CASE WHEN lower(p.name) = $3 THEN 0 ELSE 1 END + tiger.levenshtein_ignore_case(p.name, $3) - + tiger.levenshtein_ignore_case(e1.name || COALESCE('' '' || e1.sufqualabr, ''''),$2) + - CASE WHEN e1.fullname = $6 THEN 0 ELSE tiger.levenshtein_ignore_case(e1.fullname, $6) END + - + tiger.levenshtein_ignore_case(e2.name || COALESCE('' '' || e2.sufqualabr, ''''),$4) + + tiger.levenshtein_ignore_case(e1.name || COALESCE('' '' || e1.sufqualabr, ''''),$2) + + CASE + WHEN lower(e1.fullname) = $6 OR normalize_street_name(e1.fullname) = $10 THEN 0 + ELSE tiger.levenshtein_ignore_case(e1.fullname, $6) + END + + CASE + WHEN normalize_street_name(e2.fullname) = $11 THEN 0 + ELSE tiger.levenshtein_ignore_case(e2.name || COALESCE('' '' || e2.sufqualabr, ''''),$4) + END AS a_rating FROM e1 INNER JOIN e2 ON ( @@ -115,23 +152,16 @@ BEGIN FROM segs ORDER BY a_rating LIMIT $9'; IF var_debug THEN - RAISE NOTICE 'sql: %', replace(replace(replace( - replace(replace(replace( - replace( - replace( - replace(var_sql, '$1', quote_nullable(in_statefp)), - '$2', quote_nullable(lower(var_na_road.streetName) ) ), - '$3', quote_nullable(lower(in_city)) ), - '$4', quote_nullable(lower(var_na_inter1.streetName) ) ), - '$5', quote_nullable(var_zip) ), - '$6', quote_nullable(lower(var_na_road.streetName || ' ' || COALESCE(var_na_road.streetTypeAbbrev,'') )) ) , - '$7', quote_nullable(trim(lower(var_na_inter1.streetName || ' ' || COALESCE(var_na_inter1.streetTypeAbbrev,'') )) ) ) , - '$8', quote_nullable(in_state ) ), '$9', num_results::text ); + RAISE NOTICE 'sql: %', var_sql; + RAISE NOTICE 'args: %, %, %, %, %, %, %, %, %, %, %', + in_statefp, var_road_name, lower(in_city), var_inter_name, var_zip, + var_road_fullname, var_inter_fullname, in_state, num_results, + var_road_input_normalized, var_inter_input_normalized; END IF; - FOR results IN EXECUTE var_sql USING in_statefp, trim(lower(var_na_road.streetName)), lower(in_city), lower(var_na_inter1.streetName), var_zip, - trim(lower(var_na_road.streetName || ' ' || COALESCE(var_na_road.streetTypeAbbrev,''))), - trim(lower(var_na_inter1.streetName || ' ' || COALESCE(var_na_inter1.streetTypeAbbrev,''))), in_state, num_results LOOP + FOR results IN EXECUTE var_sql USING in_statefp, var_road_name, lower(in_city), var_inter_name, var_zip, + var_road_fullname, var_inter_fullname, in_state, num_results, + var_road_input_normalized, var_inter_input_normalized LOOP ADDY.preDirAbbrev := results.fedirp; ADDY.streetName := results.fename; ADDY.streetTypeAbbrev := results.fetype; diff --git a/extras/tiger_geocoder/geocode/other_helper_functions.sql b/extras/tiger_geocoder/geocode/other_helper_functions.sql index 41513bc1e..4af024ca5 100644 --- a/extras/tiger_geocoder/geocode/other_helper_functions.sql +++ b/extras/tiger_geocoder/geocode/other_helper_functions.sql @@ -30,6 +30,24 @@ $$ SELECT abs(to_number( CASE WHEN trim(substring($1,1,5)) ~ '^[0-9]+$' THEN $1 LANGUAGE sql IMMUTABLE STRICT COST 200 PARALLEL SAFE; +-- Canonicalize separator-only formatting differences in road names without +-- collapsing all punctuation, so highway names like I-635 and I- 635 +-- compare equally while still distinguishing unrelated names. +CREATE OR REPLACE FUNCTION normalize_street_name(input_street varchar) + RETURNS varchar AS +$$ + SELECT trim( + regexp_replace( + regexp_replace(lower($1), E'\\s*-\\s*', '-', 'g'), + E'\\s+', + ' ', + 'g' + ) + )::varchar; +$$ +LANGUAGE sql IMMUTABLE STRICT +COST 5 PARALLEL SAFE; + -- function return true or false if 2 numeric streets are equal such as 15th St, 23rd st -- it compares just the numeric part of the street for equality -- PURPOSE: handle bad formats such as 23th St so 23th St = 23rd St ----------------------------------------------------------------------- Summary of changes: NEWS | 3 + extensions/postgis_tiger_geocoder/Makefile.in | 10 +- .../test-geocode_intersection_spacing.out.in | 4 + .../test-geocode_intersection_spacing.sql.in | 63 ++++++++++ .../geocode/geocode_intersection.sql | 134 +++++++++++++-------- .../geocode/other_helper_functions.sql | 18 +++ 6 files changed, 178 insertions(+), 54 deletions(-) create mode 100644 extensions/postgis_tiger_geocoder/sql_bits/test-geocode_intersection_spacing.out.in create mode 100644 extensions/postgis_tiger_geocoder/sql_bits/test-geocode_intersection_spacing.sql.in hooks/post-receive -- PostGIS From trac at osgeo.org Mon Mar 9 04:23:57 2026 From: trac at osgeo.org (PostGIS) Date: Mon, 09 Mar 2026 11:23:57 -0000 Subject: [PostGIS] #1461: Tiger Geocoder doesn't anticipate irregular spacing in road name In-Reply-To: <052.169bc5a7154bec2415d1e0203ba66609@osgeo.org> References: <052.169bc5a7154bec2415d1e0203ba66609@osgeo.org> Message-ID: <067.920d1717709f10982f868378de008569@osgeo.org> #1461: Tiger Geocoder doesn't anticipate irregular spacing in road name ----------------------------------+----------------------------- Reporter: arencambre | Owner: robe Type: defect | Status: closed Priority: medium | Milestone: PostGIS Fund Me Component: pagc_address_parser | Version: master Resolution: fixed | Keywords: ----------------------------------+----------------------------- Changes (by Darafei Praliaskouski ): * resolution: => fixed * status: new => closed Comment: In [changeset:"d2a87d6305a558906618f7df087ffdcf8a60d988/git" d2a87d6/git]: {{{#!CommitTicketReference repository="git" revision="d2a87d6305a558906618f7df087ffdcf8a60d988" Fix #1461 geocode_intersection spacing fallback Add a narrow normalized-fullname comparison so geocode_intersection matches TIGER highway names when spacing around hyphens differs, without changing suffix-form route parsing or type-less second-street scoring. Closes #1461 }}} -- Ticket URL: PostGIS The PostGIS Trac is used for bug, enhancement & task tracking, a user and developer wiki, and a view into the subversion code repository of PostGIS project. From git at osgeo.org Mon Mar 9 11:12:27 2026 From: git at osgeo.org (git at osgeo.org) Date: Mon, 9 Mar 2026 11:12:27 -0700 (PDT) Subject: [SCM] PostGIS branch master updated. 3.6.0rc2-382-g08054a171 Message-ID: <20260309181227.EFFDF1B1176@trac.osgeo.org> 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 08054a171b90f96bc4ad4ba89ada81c4709cb141 (commit) from d2a87d6305a558906618f7df087ffdcf8a60d988 (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 08054a171b90f96bc4ad4ba89ada81c4709cb141 Author: Sandro Santilli Date: Mon Mar 9 19:12:08 2026 +0100 Have codespell ignore generated sql files under doc/ (comments) diff --git a/.codespellrc b/.codespellrc index b68fd7fbf..2e8dc1b78 100644 --- a/.codespellrc +++ b/.codespellrc @@ -9,6 +9,7 @@ skip = ./doc/html/**, ./doc/po/**, ./doc/postgis-out.xml, + ./doc/*.sql, ./doc/postgis-nospecial.xml, ./postgis/*.sql, ./raster/rt_pg/*.sql, ----------------------------------------------------------------------- Summary of changes: .codespellrc | 1 + 1 file changed, 1 insertion(+) hooks/post-receive -- PostGIS From git at osgeo.org Mon Mar 9 13:27:31 2026 From: git at osgeo.org (git at osgeo.org) Date: Mon, 9 Mar 2026 13:27:31 -0700 (PDT) Subject: [SCM] PostGIS branch master updated. 3.6.0rc2-383-gbd6ef65e8 Message-ID: <20260309202732.2D8481B17D6@trac.osgeo.org> 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 bd6ef65e8d418d17064225b182347478ebe84b11 (commit) from 08054a171b90f96bc4ad4ba89ada81c4709cb141 (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 bd6ef65e8d418d17064225b182347478ebe84b11 Author: Darafei Praliaskouski Date: Tue Mar 10 00:25:07 2026 +0400 #2459 Improve tiger geocoder wrapper normalization Speed up pagc_normalize_address with a single standardize_address() call while preserving ZIP+4, country, and ZIP-only fallbacks. Convert several expression-only tiger wrappers to SQL where install order allows, preserve extension schema qualifications, and refresh the related docs and regression coverage. Closes #2459 diff --git a/NEWS b/NEWS index c6d77cc77..6d6847db0 100644 --- a/NEWS +++ b/NEWS @@ -41,9 +41,16 @@ This version requires GEOS 3.10 or higher - #4828, geometry_columns handles NOT VALID SRID checks without errors (Darafei Praliaskouski) - #6048, [raster] ST_Clip no longer crashes when clipping sparse band selections (Darafei Praliaskouski) + - #2459, [tiger geocoder] Speed up pagc_normalize_address by avoiding + redundant wrapper parsing while preserving ZIP+4 and country + details from the structured parser (Darafei Praliaskouski) + - [tiger geocoder] Replace several expression-only PL/pgSQL wrappers with + SQL functions in helper and text geocode entry points while + preserving extension schema qualifications + (Darafei Praliaskouski) - #1461, [tiger geocoder] geocode_intersection now tolerates irregular spacing in highway names such as `I- 635` vs `I-635` - (OpenAI) + (Darafei Praliaskouski) - #1599, [address_standardizer] parse_address() and normalize_address() now canonicalize trailing country tokens to ISO 3166-1 alpha-2 codes and expose country on normalized addresses diff --git a/doc/extras_tigergeocoder.xml b/doc/extras_tigergeocoder.xml index 2889f6286..ec4906a2e 100644 --- a/doc/extras_tigergeocoder.xml +++ b/doc/extras_tigergeocoder.xml @@ -1104,9 +1104,7 @@ FROM pagc_normalize_address('9000 E ROO ST STE 999, Springfield, CO') AS addy; ---------+--------------+------------+------------------+---------------+-----------+-------------+-------------+-----+-------- 9000 | E | ROO | ST | | SUITE 999 | SPRINGFIELD | CO | | t - Batch call. There are currently speed issues with the way postgis_tiger_geocoder wraps the address_standardizer. These will hopefully -be resolved in later editions. To work around them, if you need speed for batch geocoding to call generate a normaddy in batch mode, you are encouraged -to directly call the address_standardizer standardize_address function as shown below which is similar exercise to what we did in that uses data created in . + Batch call. pagc_normalize_address now follows the same single-address standardizer path internally, but for large set-based geocoding jobs you may still prefer to call standardize_address directly when materializing norm_addy rows in SQL, as shown below. This is similar to the exercise in that uses data created in . WITH g AS (SELECT address, ROW((sa).house_num, (sa).predir, (sa).name , (sa).suftype, (sa).sufdir, (sa).unit , (sa).city, (sa).state, (sa).postcode, true)::norm_addy As na diff --git a/extensions/address_standardizer/address_standardizer.c b/extensions/address_standardizer/address_standardizer.c index 5adb43666..7eee099b0 100644 --- a/extensions/address_standardizer/address_standardizer.c +++ b/extensions/address_standardizer/address_standardizer.c @@ -1,3 +1,7 @@ +/* + * Copyright (c) 2026 Darafei Praliaskouski + */ + #include "postgres.h" #include "fmgr.h" #include "funcapi.h" @@ -496,6 +500,22 @@ parse_address_wrapper_input(const char *function_name, const char *raw_address, return parsed_address; } +/* + * Preserve ZIP+4 details from structured parses so callers can reuse the + * standardized postcode without reparsing the original address text. + */ +static char * +build_postcode_component(const ADDRESS *parsed_address) +{ + if (!parsed_address || !parsed_address->zip || parsed_address->zip[0] == '\0') + return NULL; + + if (parsed_address->zipplus && parsed_address->zipplus[0] != '\0') + return psprintf("%s-%s", parsed_address->zip, parsed_address->zipplus); + + return pstrdup(parsed_address->zip); +} + /* * The explicit SQL macro argument models city/state/postcode text, not a full * address. parseaddress() mostly gives us that split already, but when a city @@ -523,6 +543,10 @@ parse_macro_input(const char *function_name, const char *raw_macro) return parsed_macro; } +/* + * Diagnostic entry point that returns tokenization, rule matching, and the + * final standardized address for either split or one-line input. + */ PG_FUNCTION_INFO_V1(debug_standardize_address); Datum @@ -751,6 +775,7 @@ standardize_address(PG_FUNCTION_ARGS) char **values; HeapTuple tuple; ADDRESS *parsed_macro = NULL; + char *postcode = NULL; DBG("Start standardize_address"); @@ -777,9 +802,10 @@ standardize_address(PG_FUNCTION_ARGS) if (parsed_macro) { + postcode = build_postcode_component(parsed_macro); DBG("calling std_standardize('%s', ... parsed macro)", micro); stdaddr = std_standardize( - std, micro, parsed_macro->city, parsed_macro->st, parsed_macro->zip, parsed_macro->cc, 0); + std, micro, parsed_macro->city, parsed_macro->st, postcode, parsed_macro->cc, 0); } else { @@ -806,6 +832,10 @@ standardize_address(PG_FUNCTION_ARGS) PG_RETURN_DATUM(result); } +/* + * One-line standardization entry point. Parse the raw address first so the + * structured postcode and country can be preserved during normalization. + */ PG_FUNCTION_INFO_V1(standardize_address1); Datum @@ -824,6 +854,7 @@ standardize_address1(PG_FUNCTION_ARGS) char **values; HeapTuple tuple; ADDRESS *parsed_address; + char *postcode; DBG("Start standardize_address"); @@ -840,6 +871,7 @@ standardize_address1(PG_FUNCTION_ARGS) attinmeta = TupleDescGetAttInMetadata(tuple_desc); parsed_address = parse_address_wrapper_input(__func__, addr, µ, NULL); + postcode = build_postcode_component(parsed_address); DBG("calling GetStdUsingFCInfo(fcinfo, '%s', '%s', '%s')", lextab, gaztab, rultab); std = GetStdUsingFCInfo(fcinfo, lextab, gaztab, rultab); @@ -848,7 +880,7 @@ standardize_address1(PG_FUNCTION_ARGS) DBG("calling std_standardize('%s', ...)", micro); stdaddr = std_standardize( - std, micro, parsed_address->city, parsed_address->st, parsed_address->zip, parsed_address->cc, 0); + std, micro, parsed_address->city, parsed_address->st, postcode, parsed_address->cc, 0); DBG("back from fetch_stdaddr"); diff --git a/extensions/address_standardizer/expected/test-standardize_address_1.out b/extensions/address_standardizer/expected/test-standardize_address_1.out index ff6dbd83d..849732c2e 100644 --- a/extensions/address_standardizer/expected/test-standardize_address_1.out +++ b/extensions/address_standardizer/expected/test-standardize_address_1.out @@ -58,6 +58,18 @@ SELECT '#5695a' AS ticket, * FROM standardize_address('us_lex', 'us_gaz', 'us_ru #5695a | | 1 | EAST | | | PIMA | STREET | | | | TUCSON | ARIZONA | US | | | SUITE 999 (1 row) +SELECT '#2459a' AS ticket, * FROM standardize_address('us_lex', 'us_gaz', 'us_rules', '26 Court Street, Boston, Massachusetts 02109, France'); + ticket | building | house_num | predir | qual | pretype | name | suftype | sufdir | ruralroute | extra | city | state | country | postcode | box | unit +--------+----------+-----------+--------+------+---------+-------+---------+--------+------------+-------+--------+---------------+---------+----------+-----+------ + #2459a | | 26 | | | | COURT | STREET | | | | BOSTON | MASSACHUSETTS | FR | 02109 | | +(1 row) + +SELECT '#2459b' AS ticket, * FROM standardize_address('us_lex', 'us_gaz', 'us_rules', '212 3rd Ave N, MINNEAPOLIS, MN 553404'); + ticket | building | house_num | predir | qual | pretype | name | suftype | sufdir | ruralroute | extra | city | state | country | postcode | box | unit +--------+----------+-----------+--------+------+---------+------+---------+--------+------------+-------+-------------+-----------+---------+----------+-----+------ + #2459b | | 212 | | | | 3 | AVENUE | NORTH | | | MINNEAPOLIS | MINNESOTA | US | 55340-4 | | +(1 row) + DO $$ BEGIN PERFORM standardize_address('us_lex', 'us_gaz', 'us_rules', ' '); diff --git a/extensions/address_standardizer/standard.c b/extensions/address_standardizer/standard.c index fbd35a319..f88e8af31 100644 --- a/extensions/address_standardizer/standard.c +++ b/extensions/address_standardizer/standard.c @@ -7,6 +7,7 @@ Prototype 7H08 (This file was written by Walter Sinclair). This file is part of PAGC. Copyright (c) 2009 Walter Bruce Sinclair +Copyright (c) 2026 Darafei Praliaskouski Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: @@ -452,31 +453,53 @@ STDADDR *std_standardize_one(STANDARDIZER *std, char *address_one_line, int opti } */ +/* Replace one STDADDR field with a caller-supplied structured component. */ +static void +replace_stdaddr_component(char **field, const char *value) +{ + if (!field) + return; + + if (*field) + { + free(*field); + *field = NULL; + } + + if (value && value[0] != '\0') + *field = strdup(value); +} + /* * The string-based analyzer can collapse a supplied state into the city slot - * when there is no city component. When the caller provides structured macro - * components, preserve that split in the final STDADDR. + * when there is no city component. When callers provide structured city/state/ + * postcode/country pieces, restore those values onto the final STDADDR. */ static void -apply_component_split_to_stdaddr(STDADDR *stdaddr, const char *city, const char *state) +apply_component_values_to_stdaddr( + STDADDR *stdaddr, const char *city, const char *state, const char *postcode, const char *country) { if (!stdaddr) return; - if ((city && city[0] != '\0') || !state || state[0] == '\0') - return; - - if (stdaddr->state && stdaddr->state[0] != '\0') - return; - - if (stdaddr->city && stdaddr->city[0] != '\0') + if ((!city || city[0] == '\0') && state && state[0] != '\0' && (!stdaddr->state || stdaddr->state[0] == '\0')) { - stdaddr->state = stdaddr->city; - stdaddr->city = NULL; - return; + if (stdaddr->city && stdaddr->city[0] != '\0') + { + stdaddr->state = stdaddr->city; + stdaddr->city = NULL; + } + else + { + stdaddr->state = strdup(state); + } } - stdaddr->state = strdup(state); + if (postcode && postcode[0] != '\0') + replace_stdaddr_component(&stdaddr->postcode, postcode); + + if (country && country[0] != '\0') + replace_stdaddr_component(&stdaddr->country, country); } /* @@ -617,7 +640,7 @@ std_standardize(STANDARDIZER *std, if (macro) free(macro); - apply_component_split_to_stdaddr(stdaddr, city, state); + apply_component_values_to_stdaddr(stdaddr, city, state, postcode, country); return stdaddr; } diff --git a/extensions/address_standardizer/test-standardize_address_1.sql.in b/extensions/address_standardizer/test-standardize_address_1.sql.in index b67017e57..7084c9384 100644 --- a/extensions/address_standardizer/test-standardize_address_1.sql.in +++ b/extensions/address_standardizer/test-standardize_address_1.sql.in @@ -8,6 +8,8 @@ SELECT '#state_only_macro' AS ticket, * FROM standardize_address('us_lex','us_ga SELECT '#5299a' AS ticket, * FROM standardize_address('us_lex', 'us_gaz', 'us_rules','1 Timepiece Point','Boston, MA, 02220'); SELECT '#5299b' AS ticket, * FROM standardize_address('us_lex', 'us_gaz', 'us_rules','50 Gold Piece Drive','Boston, MA, 02020'); SELECT '#5695a' AS ticket, * FROM standardize_address('us_lex', 'us_gaz', 'us_rules', 'ONE E PIMA ST STE 999, TUCSON, AZ'); +SELECT '#2459a' AS ticket, * FROM standardize_address('us_lex', 'us_gaz', 'us_rules', '26 Court Street, Boston, Massachusetts 02109, France'); +SELECT '#2459b' AS ticket, * FROM standardize_address('us_lex', 'us_gaz', 'us_rules', '212 3rd Ave N, MINNEAPOLIS, MN 553404'); DO $$ BEGIN PERFORM standardize_address('us_lex', 'us_gaz', 'us_rules', ' '); diff --git a/extensions/postgis_tiger_geocoder/Makefile.in b/extensions/postgis_tiger_geocoder/Makefile.in index c103b3069..a4335489a 100644 --- a/extensions/postgis_tiger_geocoder/Makefile.in +++ b/extensions/postgis_tiger_geocoder/Makefile.in @@ -126,11 +126,11 @@ sql/$(EXTENSION)--$(EXTVERSION)next--$(EXTVERSION).sql: sql/$(EXTENSION)--$(EXTV sql/tiger_geocoder_minor.sql.in: ../../extras/tiger_geocoder/utility/set_search_path.sql \ sql_bits/upgrade_before.sql.in \ ../../extras/tiger_geocoder/geocode_settings.sql \ - ../../extras/tiger_geocoder/tiger_loader_2025.sql \ + ../../extras/tiger_geocoder/tiger_loader_2025.sql \ ../../extras/tiger_geocoder/utility/utmzone.sql \ ../../extras/tiger_geocoder/utility/cull_null.sql \ - ../../extras/tiger_geocoder/utility/nullable_levenshtein.sql \ ../../extras/tiger_geocoder/utility/levenshtein_ignore_case.sql \ + ../../extras/tiger_geocoder/utility/nullable_levenshtein.sql \ ../../extras/tiger_geocoder/normalize/end_soundex.sql \ ../../extras/tiger_geocoder/normalize/count_words.sql \ ../../extras/tiger_geocoder/normalize/state_extract.sql \ @@ -166,8 +166,8 @@ sql/tiger_geocoder.sql.in: sql_bits/norm_addy_create.sql.in \ ../../extras/tiger_geocoder/utility/set_search_path.sql \ ../../extras/tiger_geocoder/utility/utmzone.sql \ ../../extras/tiger_geocoder/utility/cull_null.sql \ - ../../extras/tiger_geocoder/utility/nullable_levenshtein.sql \ ../../extras/tiger_geocoder/utility/levenshtein_ignore_case.sql \ + ../../extras/tiger_geocoder/utility/nullable_levenshtein.sql \ ../../extras/tiger_geocoder/normalize/end_soundex.sql \ ../../extras/tiger_geocoder/normalize/count_words.sql \ ../../extras/tiger_geocoder/normalize/state_extract.sql \ diff --git a/extras/tiger_geocoder/create_geocode.sql b/extras/tiger_geocoder/create_geocode.sql index daaa98f33..9f48e8766 100644 --- a/extras/tiger_geocoder/create_geocode.sql +++ b/extras/tiger_geocoder/create_geocode.sql @@ -39,8 +39,8 @@ CREATE TYPE norm_addy AS ( -- System/General helper functions \i utility/utmzone.sql \i utility/cull_null.sql -\i utility/nullable_levenshtein.sql \i utility/levenshtein_ignore_case.sql +\i utility/nullable_levenshtein.sql ---- Address normalizer -- General helpers diff --git a/extras/tiger_geocoder/geocode/geocode.sql b/extras/tiger_geocoder/geocode/geocode.sql index 34df34fd7..b1c547fe8 100644 --- a/extras/tiger_geocoder/geocode/geocode.sql +++ b/extras/tiger_geocoder/geocode/geocode.sql @@ -1,42 +1,5 @@ -CREATE OR REPLACE FUNCTION geocode( - input VARCHAR, max_results integer DEFAULT 10, - restrict_geom geometry DEFAULT NULL, - OUT ADDY NORM_ADDY, - OUT GEOMOUT GEOMETRY, - OUT RATING INTEGER -) RETURNS SETOF RECORD -AS $_$ -DECLARE - rec RECORD; -BEGIN - - IF input IS NULL THEN - RETURN; - END IF; - - -- Pass the input string into the address normalizer - ADDY := normalize_address(input); - IF NOT ADDY.parsed THEN - RETURN; - END IF; - -/* FOR rec IN SELECT * FROM geocode(ADDY) - LOOP - - ADDY := rec.addy; - GEOMOUT := rec.geomout; - RATING := rec.rating; - - RETURN NEXT; - END LOOP;*/ - - RETURN QUERY SELECT g.addy, g.geomout, g.rating FROM geocode(ADDY, max_results, restrict_geom) As g ORDER BY g.rating; - -END; -$_$ LANGUAGE plpgsql COST 1000 -STABLE PARALLEL SAFE -ROWS 1; - +-- Geocode an already parsed address, preferring precise address matches and +-- falling back to broader location matches when needed. CREATE OR REPLACE FUNCTION geocode( IN_ADDY NORM_ADDY, max_results integer DEFAULT 10, @@ -131,3 +94,30 @@ $_$ LANGUAGE plpgsql COST 1000 STABLE PARALLEL SAFE ROWS 1; + +-- Normalize free-form input once, then only delegate to the structured +-- geocoder overload when parsing succeeds. +CREATE OR REPLACE FUNCTION geocode( + input VARCHAR, max_results integer DEFAULT 10, + restrict_geom geometry DEFAULT NULL, + OUT ADDY NORM_ADDY, + OUT GEOMOUT GEOMETRY, + OUT RATING INTEGER +) RETURNS SETOF RECORD +AS $$ + WITH normalized AS ( + SELECT @extschema at .normalize_address(input) AS addy + WHERE input IS NOT NULL + ), + parsed AS ( + SELECT addy + FROM normalized + WHERE (addy).parsed + ) + SELECT g.addy, g.geomout, g.rating + FROM parsed + CROSS JOIN LATERAL @extschema at .geocode(addy, max_results, restrict_geom) AS g + ORDER BY g.rating; +$$ LANGUAGE sql COST 1000 +STABLE PARALLEL SAFE +ROWS 1; diff --git a/extras/tiger_geocoder/geocode/rate_attributes.sql b/extras/tiger_geocoder/geocode/rate_attributes.sql index 1949dcbde..1e19be911 100644 --- a/extras/tiger_geocoder/geocode/rate_attributes.sql +++ b/extras/tiger_geocoder/geocode/rate_attributes.sql @@ -1,31 +1,3 @@ --- rate_attributes(dirpA, dirpB, streetNameA, streetNameB, streetTypeA, --- streetTypeB, dirsA, dirsB, locationA, locationB) --- Rates the street based on the given attributes. The locations must be --- non-null. The other eight values are handled by the other rate_attributes --- function, so it's requirements must also be met. --- changed: 2010-10-18 Regina Obe - all references to verbose to var_verbose since causes compile errors in 9.0 --- changed: 2011-06-25 revise to use real named args and fix direction rating typo -CREATE OR REPLACE FUNCTION rate_attributes(dirpA VARCHAR, dirpB VARCHAR, streetNameA VARCHAR, streetNameB VARCHAR, - streetTypeA VARCHAR, streetTypeB VARCHAR, dirsA VARCHAR, dirsB VARCHAR, locationA VARCHAR, locationB VARCHAR, prequalabr VARCHAR) RETURNS INTEGER -AS $_$ -DECLARE - result INTEGER := 0; - locationWeight INTEGER := 14; - var_verbose BOOLEAN := FALSE; -BEGIN - IF locationA IS NOT NULL AND locationB IS NOT NULL THEN - result := tiger.levenshtein_ignore_case(locationA, locationB); - ELSE - IF var_verbose THEN - RAISE NOTICE 'rate_attributes() - Location names cannot be null!'; - END IF; - RETURN NULL; - END IF; - result := result + rate_attributes($1, $2, streetNameA, streetNameB, $5, $6, $7, $8,prequalabr); - RETURN result; -END; -$_$ LANGUAGE plpgsql IMMUTABLE; - -- rate_attributes(dirpA, dirpB, streetNameA, streetNameB, streetTypeA, -- streetTypeB, dirsA, dirsB) -- Rates the street based on the given attributes. Only streetNames are @@ -76,3 +48,20 @@ BEGIN return result; END; $_$ LANGUAGE plpgsql IMMUTABLE; + +-- rate_attributes(dirpA, dirpB, streetNameA, streetNameB, streetTypeA, +-- streetTypeB, dirsA, dirsB, locationA, locationB) +-- Rates the street based on the given attributes. The locations must be +-- non-null. The other eight values are handled by the other rate_attributes +-- function, so it's requirements must also be met. +-- changed: 2010-10-18 Regina Obe - all references to verbose to var_verbose since causes compile errors in 9.0 +-- changed: 2011-06-25 revise to use real named args and fix direction rating typo +CREATE OR REPLACE FUNCTION rate_attributes(dirpA VARCHAR, dirpB VARCHAR, streetNameA VARCHAR, streetNameB VARCHAR, + streetTypeA VARCHAR, streetTypeB VARCHAR, dirsA VARCHAR, dirsB VARCHAR, locationA VARCHAR, locationB VARCHAR, prequalabr VARCHAR) RETURNS INTEGER +AS $$ + SELECT CASE + WHEN locationA IS NULL OR locationB IS NULL THEN NULL + ELSE @extschema at .levenshtein_ignore_case(locationA, locationB) + + @extschema at .rate_attributes($1, $2, streetNameA, streetNameB, $5, $6, $7, $8, prequalabr) + END; +$$ LANGUAGE sql IMMUTABLE; diff --git a/extras/tiger_geocoder/normalize/end_soundex.sql b/extras/tiger_geocoder/normalize/end_soundex.sql index 36a8bda56..be9e71c6a 100644 --- a/extras/tiger_geocoder/normalize/end_soundex.sql +++ b/extras/tiger_geocoder/normalize/end_soundex.sql @@ -2,16 +2,8 @@ -- Words are allowed to be separated by space, comma, period, new-line -- tab or form feed. CREATE OR REPLACE FUNCTION end_soundex(VARCHAR) RETURNS VARCHAR -AS $_$ -DECLARE - tempString VARCHAR; -BEGIN - tempString := substring($1, E'[ ,.\n\t\f]([a-zA-Z0-9]*)$'); - IF tempString IS NOT NULL THEN - tempString := @extschema:fuzzystrmatch at .soundex(tempString); - ELSE - tempString := @extschema:fuzzystrmatch at .soundex($1); - END IF; - return tempString; -END; -$_$ LANGUAGE plpgsql IMMUTABLE; +AS $$ + SELECT @extschema:fuzzystrmatch at .soundex( + COALESCE(substring($1, E'[ ,.\n\t\f]([a-zA-Z0-9]*)$'), $1) + ); +$$ LANGUAGE sql IMMUTABLE; diff --git a/extras/tiger_geocoder/normalize/location_extract_place_exact.sql b/extras/tiger_geocoder/normalize/location_extract_place_exact.sql index 1ab610164..373e1e8de 100644 --- a/extras/tiger_geocoder/normalize/location_extract_place_exact.sql +++ b/extras/tiger_geocoder/normalize/location_extract_place_exact.sql @@ -7,54 +7,14 @@ CREATE OR REPLACE FUNCTION location_extract_place_exact( fullStreet VARCHAR, stateAbbrev VARCHAR ) RETURNS VARCHAR -AS $_$ -DECLARE - ws VARCHAR; - location VARCHAR; - tempInt INTEGER; - lstate VARCHAR; - rec RECORD; -BEGIN - ws := E'[ ,.\n\f\t]'; - - -- Try for an exact match against places - IF stateAbbrev IS NOT NULL THEN - lstate := statefp FROM state WHERE stusps = stateAbbrev; - SELECT INTO tempInt count(*) FROM place - WHERE place.statefp = lstate AND fullStreet ILIKE '%' || name || '%' - AND texticregexeq(fullStreet, '(?i)' || name || '$'); - ELSE - SELECT INTO tempInt count(*) FROM place - WHERE fullStreet ILIKE '%' || name || '%' AND - texticregexeq(fullStreet, '(?i)' || name || '$'); - END IF; - - IF tempInt > 0 THEN - -- Some matches were found. Look for the last one in the string. - IF stateAbbrev IS NOT NULL THEN - FOR rec IN SELECT substring(fullStreet, '(?i)(' - || name || ')$') AS value, name FROM place - WHERE place.statefp = lstate AND fullStreet ILIKE '%' || name || '%' - AND texticregexeq(fullStreet, '(?i)' - || name || '$') ORDER BY length(name) DESC LOOP - -- Since the regex is end of string, only the longest (first) result - -- is useful. - location := rec.value; - EXIT; - END LOOP; - ELSE - FOR rec IN SELECT substring(fullStreet, '(?i)(' - || name || ')$') AS value, name FROM place - WHERE fullStreet ILIKE '%' || name || '%' AND texticregexeq(fullStreet, '(?i)' - || name || '$') ORDER BY length(name) DESC LOOP - -- Since the regex is end of string, only the longest (first) result - -- is useful. - location := rec.value; - EXIT; - END LOOP; - END IF; - END IF; - - RETURN location; -END; -$_$ LANGUAGE plpgsql STABLE COST 100; +AS $$ + SELECT ( + SELECT substring(fullStreet, '(?i)(' || name || ')$') + FROM place + WHERE (stateAbbrev IS NULL OR place.statefp = (SELECT statefp FROM state WHERE stusps = stateAbbrev)) + AND fullStreet ILIKE '%' || name || '%' + AND texticregexeq(fullStreet, '(?i)' || name || '$') + ORDER BY length(name) DESC + LIMIT 1 + ); +$$ LANGUAGE sql STABLE COST 100; diff --git a/extras/tiger_geocoder/pagc_normalize/pagc_normalize_address.sql b/extras/tiger_geocoder/pagc_normalize/pagc_normalize_address.sql index befce7643..15d0734fd 100644 --- a/extras/tiger_geocoder/pagc_normalize/pagc_normalize_address.sql +++ b/extras/tiger_geocoder/pagc_normalize/pagc_normalize_address.sql @@ -4,51 +4,51 @@ -- zip code, depending on what can be found in the string. -- This is a drop in replacement for packaged normalize_address -- that uses the pagc address standardizer C library instead +-- Keep the wrapper in plpgsql so the optional address_standardizer extension +-- is only resolved when PAGC parsing is invoked, while still using a single +-- standardize_address() call to preserve the wrapper speedup work. -- USAGE: SELECT * FROM tiger.pagc_normalize_address('One Devonshire Place, PH 301, Boston, MA 02109'); SELECT tiger.SetSearchPathForInstall('tiger'); CREATE OR REPLACE FUNCTION pagc_normalize_address(in_rawinput character varying) RETURNS norm_addy AS $$ DECLARE - result norm_addy; - var_rec RECORD; - var_parse_rec RECORD; - rawInput VARCHAR; - + sa RECORD; + parsed RECORD; + raw_input VARCHAR; BEGIN - result.parsed := FALSE; + raw_input := trim(in_rawinput); - rawInput := trim(in_rawinput); - var_parse_rec := parse_address(rawInput); + -- Preserve parse_address()'s macro-only ZIP and country detection for + -- non-street inputs while keeping a single standardize_address() call. + SELECT * + INTO parsed + FROM parse_address(raw_input); - result.location := var_parse_rec.city; - result.stateAbbrev := trim(var_parse_rec.state); - result.zip := var_parse_rec.zip; - result.zip4 := NULLIF(var_parse_rec.zipplus,''); - result.country := NULLIF(var_parse_rec.country,''); + SELECT * + INTO sa + FROM standardize_address( + 'pagc_lex', + 'pagc_gaz', + 'pagc_rules', + raw_input + ) AS sa; - var_rec := standardize_address('pagc_lex' - , 'pagc_gaz' - , 'pagc_rules' -, COALESCE(var_parse_rec.address1,''), - COALESCE(var_parse_rec.city,'') || COALESCE(', ' || var_parse_rec.state, '') || COALESCE(' ' || var_parse_rec.zip,'') ) ; - - -- For address number only put numbers and stop if reach a non-number e.g. 123-456 will return 123 - result.address := to_number(substring(var_rec.house_num, '[0-9]+'), '99999999'); - result.address_alphanumeric := var_rec.house_num; - --get rid of extraneous spaces before we return - result.zip := COALESCE(var_rec.postcode,result.zip); - result.streetName := trim(var_rec.name); - result.location := trim(var_rec.city); - result.stateAbbrev := trim(var_rec.state); - result.country := COALESCE(NULLIF(var_rec.country,''), result.country); - --this should be broken out separately like pagc, but normalizer doesn't have a slot for it - result.streettypeAbbrev := trim(COALESCE(var_rec.suftype, var_rec.pretype)); - result.preDirAbbrev := trim(var_rec.predir); - result.postDirAbbrev := trim(var_rec.sufdir); - result.internal := trim(regexp_replace(replace(var_rec.unit, '#',''), '([0-9]+)\s+([A-Za-z]){0,1}', E'\\1\\2')); - result.parsed := TRUE; - RETURN result; + RETURN ROW( + to_number(substring(sa.house_num, '[0-9]+'), '99999999'), + NULLIF(trim(sa.predir), ''), + NULLIF(trim(sa.name), ''), + NULLIF(trim(COALESCE(sa.suftype, sa.pretype)), ''), + NULLIF(trim(sa.sufdir), ''), + NULLIF(trim(regexp_replace(replace(COALESCE(sa.unit, ''), '#', ''), '([0-9]+)\s+([A-Za-z]){0,1}', E'\\1\\2')), ''), + COALESCE(NULLIF(trim(sa.city), ''), NULLIF(trim(parsed.city), '')), + COALESCE(NULLIF(trim(sa.state), ''), NULLIF(trim(parsed.state), '')), + COALESCE(NULLIF(split_part(COALESCE(sa.postcode, ''), '-', 1), ''), NULLIF(parsed.zip, '')), + TRUE, + COALESCE(NULLIF(split_part(COALESCE(sa.postcode, ''), '-', 2), ''), NULLIF(parsed.zipplus, '')), + NULLIF(sa.house_num, ''), + COALESCE(NULLIF(trim(sa.country), ''), NULLIF(trim(parsed.country), ''), 'US') + )::norm_addy; END $$ LANGUAGE plpgsql IMMUTABLE STRICT diff --git a/extras/tiger_geocoder/regress/normalize_address_regress b/extras/tiger_geocoder/regress/normalize_address_regress index 676bb7698..4814836f0 100644 --- a/extras/tiger_geocoder/regress/normalize_address_regress +++ b/extras/tiger_geocoder/regress/normalize_address_regress @@ -49,3 +49,12 @@ #1614a|8435 Co Rd 20 SE, ROCHESTER, MN 55904, US|8435||20|Co Rd|SE||ROCHESTER|MN|55904|t||8435|US #1614b|3208 US Hwy 52, Rochester, MN 55901, US|3208||52|US Hwy|||Rochester|MN|55901|t||3208|US #1108a|529 Main St, Suite 201, Boston, MA 02129, US|529||Main|St||Suite 201|Boston|MA|02129|t||529|US +#sqlify1|S363|S363| +#sqlify2||3|3|1 +#sqlify3|0| +#sqlify4| +#sqlify5|0 +#sqlify6|t +#sqlify7|t +#sqlify8|t|t +#sqlify9|t|t diff --git a/extras/tiger_geocoder/regress/normalize_address_regress.sql b/extras/tiger_geocoder/regress/normalize_address_regress.sql index 46749542e..1f99fcba2 100644 --- a/extras/tiger_geocoder/regress/normalize_address_regress.sql +++ b/extras/tiger_geocoder/regress/normalize_address_regress.sql @@ -102,4 +102,39 @@ SELECT '#1614b' As ticket, pprint_addy(addy), addy.* FROM normalize_address('320 --internal address prefix sometimes get caught in post dir SELECT '#1108a' As ticket, pprint_addy(addy), addy.* FROM normalize_address('529 Main Street, Suite 201, Boston, MA 02129') AS addy; + +-- direct helper coverage for SQL wrappers +SELECT '#sqlify1' As ticket, end_soundex('123 Main Street'), end_soundex('Street'), end_soundex(NULL::varchar); +SELECT '#sqlify2' As ticket, nullable_levenshtein(NULL::varchar, 'foo'), nullable_levenshtein('foo', NULL::varchar), nullable_levenshtein('foo', ''), nullable_levenshtein('foo', 'food'); +SELECT '#sqlify3' As ticket, rate_attributes('N','N','MAIN','MAIN','ST','ST',NULL,NULL,'BOSTON','BOSTON',NULL), rate_attributes('N','N','MAIN','MAIN','ST','ST',NULL,NULL,NULL,'BOSTON',NULL); +SELECT '#sqlify4' As ticket, location_extract_place_exact('999 Main Street, Boston', 'MA'); +SELECT '#sqlify5' As ticket, count(*) FROM geocode(NULL::varchar, 1) AS g; +SELECT '#sqlify6' As ticket, strpos( + pg_get_functiondef(to_regprocedure((SELECT n.nspname || '.nullable_levenshtein(character varying,character varying)' FROM pg_extension e JOIN pg_namespace n ON n.oid = e.extnamespace WHERE e.extname = 'postgis_tiger_geocoder'))), + (SELECT n.nspname || '.levenshtein_ignore_case' FROM pg_extension e JOIN pg_namespace n ON n.oid = e.extnamespace WHERE e.extname = 'postgis_tiger_geocoder') +) > 0; +SELECT '#sqlify7' As ticket, CASE + WHEN current_setting('server_version_num')::integer >= 160000 THEN strpos( + pg_get_functiondef(to_regprocedure((SELECT n.nspname || '.end_soundex(character varying)' FROM pg_extension e JOIN pg_namespace n ON n.oid = e.extnamespace WHERE e.extname = 'postgis_tiger_geocoder'))), + (SELECT n.nspname || '.soundex' FROM pg_extension e JOIN pg_namespace n ON n.oid = e.extnamespace WHERE e.extname = 'fuzzystrmatch') + ) > 0 + ELSE strpos( + pg_get_functiondef(to_regprocedure((SELECT n.nspname || '.end_soundex(character varying)' FROM pg_extension e JOIN pg_namespace n ON n.oid = e.extnamespace WHERE e.extname = 'postgis_tiger_geocoder'))), + 'soundex(' + ) > 0 +END; +SELECT '#sqlify8' As ticket, strpos( + pg_get_functiondef(to_regprocedure((SELECT n.nspname || '.geocode(character varying,integer,geometry)' FROM pg_extension e JOIN pg_namespace n ON n.oid = e.extnamespace WHERE e.extname = 'postgis_tiger_geocoder'))), + (SELECT n.nspname || '.normalize_address' FROM pg_extension e JOIN pg_namespace n ON n.oid = e.extnamespace WHERE e.extname = 'postgis_tiger_geocoder') +) > 0, strpos( + pg_get_functiondef(to_regprocedure((SELECT n.nspname || '.geocode(character varying,integer,geometry)' FROM pg_extension e JOIN pg_namespace n ON n.oid = e.extnamespace WHERE e.extname = 'postgis_tiger_geocoder'))), + (SELECT n.nspname || '.geocode(addy, max_results, restrict_geom)' FROM pg_extension e JOIN pg_namespace n ON n.oid = e.extnamespace WHERE e.extname = 'postgis_tiger_geocoder') +) > 0; +SELECT '#sqlify9' As ticket, strpos( + pg_get_functiondef(to_regprocedure((SELECT n.nspname || '.rate_attributes(character varying,character varying,character varying,character varying,character varying,character varying,character varying,character varying,character varying,character varying,character varying)' FROM pg_extension e JOIN pg_namespace n ON n.oid = e.extnamespace WHERE e.extname = 'postgis_tiger_geocoder'))), + (SELECT n.nspname || '.levenshtein_ignore_case' FROM pg_extension e JOIN pg_namespace n ON n.oid = e.extnamespace WHERE e.extname = 'postgis_tiger_geocoder') +) > 0, strpos( + pg_get_functiondef(to_regprocedure((SELECT n.nspname || '.rate_attributes(character varying,character varying,character varying,character varying,character varying,character varying,character varying,character varying,character varying,character varying,character varying)' FROM pg_extension e JOIN pg_namespace n ON n.oid = e.extnamespace WHERE e.extname = 'postgis_tiger_geocoder'))), + (SELECT n.nspname || '.rate_attributes(' FROM pg_extension e JOIN pg_namespace n ON n.oid = e.extnamespace WHERE e.extname = 'postgis_tiger_geocoder') +) > 0; --\timing diff --git a/extras/tiger_geocoder/regress/pagc_normalize_address_regress b/extras/tiger_geocoder/regress/pagc_normalize_address_regress index 9ea5fefd6..507db6bfe 100644 --- a/extras/tiger_geocoder/regress/pagc_normalize_address_regress +++ b/extras/tiger_geocoder/regress/pagc_normalize_address_regress @@ -42,9 +42,9 @@ true #1125a|19596 CO RD 480, COLCORD, OK 74338, US #1125b|4345 353 RTE, SALAMANCA, NY 14779, US|4345||353|RTE|||SALAMANCA|NY|14779|t||4345|US #1125c|19799 STATE RTE 0, COSBY, MO 64436, US|19799||0|STATE RTE|||COSBY|MO|64436|t||19799|US -#1125d|||||||||||t|||US -#1125e|||||||||||t|||US -#1125f|||||||||||t|||US +#1125d|Boston, MA, US|||||||Boston|MA||t|||US +#1125e|Boston, MA, US|||||||Boston|MA||t|||US +#1125f|Boston, MA, US|||||||Boston|MA||t|||US #1310a|1110 W CAPITOL AVE, WEST SACRAMENTO, CA, US|1110|W|CAPITOL|AVE|||WEST SACRAMENTO|CA||t||1110|US #1614a|8435 CO RD 20 SE, ROCHESTER, MN 55904, US|8435||20|CO RD|SE||ROCHESTER|MN|55904|t||8435|US #1614b|3208 US RTE 52, ROCHESTER, MN 55901, US|3208||52|US RTE|||ROCHESTER|MN|55901|t||3208|US @@ -55,4 +55,8 @@ true #2978a|10||DORRANCE|ST|||PROVIDENCE|RI||t||10 20|US #2978b|10||DORRANCE|ST|||PROVIDENCE|RI||t||10 20|US #2978c|10||DORRANCE|ST|||PROVIDENCE|RI||t||10 20|US +#2459|1000|S|FREMONT|AVE|||ALHAMBRA|CA|91803|t||1000|US +#2459zipa|||||||||02109|t|||US +#2459zipb|||||||||02109|t|1234||US +#2459zipc|||||||Minneapolis|MN|55401|t|||US false diff --git a/extras/tiger_geocoder/regress/pagc_normalize_address_regress.sql b/extras/tiger_geocoder/regress/pagc_normalize_address_regress.sql index 783732fce..cf2a11b07 100644 --- a/extras/tiger_geocoder/regress/pagc_normalize_address_regress.sql +++ b/extras/tiger_geocoder/regress/pagc_normalize_address_regress.sql @@ -112,6 +112,10 @@ SELECT '#2981' As ticket, * FROM normalize_address('1566 NEW STATE HWY, RAYNHAM, SELECT '#2978a' As ticket, * FROM normalize_address('10-20 DORRANCE ST PROVIDENCE RI' ) ; SELECT '#2978b' As ticket, * FROM normalize_address('10 20 DORRANCE ST PROVIDENCE RI' ) ; SELECT '#2978c' As ticket, * FROM normalize_address('10-20 DORRANCE ST, PROVIDENCE. RI' ) ; +SELECT '#2459' As ticket, * FROM normalize_address(E'1000 S. Fremont Ave.,\nBldg. A-11,\nAlhambra, CA 91803'); +SELECT '#2459zipa' As ticket, * FROM normalize_address('02109'); +SELECT '#2459zipb' As ticket, * FROM normalize_address('02109-1234'); +SELECT '#2459zipc' As ticket, * FROM normalize_address('Minneapolis, MN 55401'); --\timing SELECT set_geocode_setting('use_pagc_address_parser', 'false'); diff --git a/extras/tiger_geocoder/upgrade_geocode.sql b/extras/tiger_geocoder/upgrade_geocode.sql index c98decd9f..775f18a1b 100644 --- a/extras/tiger_geocoder/upgrade_geocode.sql +++ b/extras/tiger_geocoder/upgrade_geocode.sql @@ -286,8 +286,8 @@ SELECT create_census_base_tables(); -- System/General helper functions \i utility/utmzone.sql \i utility/cull_null.sql -\i utility/nullable_levenshtein.sql \i utility/levenshtein_ignore_case.sql +\i utility/nullable_levenshtein.sql ---- Address normalizer -- General helpers diff --git a/extras/tiger_geocoder/utility/nullable_levenshtein.sql b/extras/tiger_geocoder/utility/nullable_levenshtein.sql index e0ee3beca..bbeff98b1 100644 --- a/extras/tiger_geocoder/utility/nullable_levenshtein.sql +++ b/extras/tiger_geocoder/utility/nullable_levenshtein.sql @@ -4,25 +4,10 @@ -- 3, otherwise it is the levenshtein difference between the two. -- Change 2010-10-18 Regina Obe - name verbose to var_verbose since get compile error in PostgreSQL 9.0 CREATE OR REPLACE FUNCTION nullable_levenshtein(VARCHAR, VARCHAR) RETURNS INTEGER -AS $_$ -DECLARE - given_string VARCHAR; - result INTEGER := 3; - var_verbose BOOLEAN := FALSE; /**change from verbose to param_verbose since its a keyword and get compile error in 9.0 **/ -BEGIN - IF $1 IS NULL THEN - IF var_verbose THEN - RAISE NOTICE 'nullable_levenshtein - given string is NULL!'; - END IF; - RETURN NULL; - ELSE - given_string := $1; - END IF; - - IF $2 IS NOT NULL AND $2 != '' THEN - result := @extschema:fuzzystrmatch at .levenshtein_ignore_case_ignore_case(given_string, $2); - END IF; - - RETURN result; -END -$_$ LANGUAGE plpgsql IMMUTABLE COST 10; +AS $$ + SELECT CASE + WHEN $1 IS NULL THEN NULL + WHEN $2 IS NOT NULL AND $2 != '' THEN @extschema at .levenshtein_ignore_case($1, $2) + ELSE 3 + END; +$$ LANGUAGE sql IMMUTABLE COST 10; ----------------------------------------------------------------------- Summary of changes: NEWS | 9 ++- doc/extras_tigergeocoder.xml | 4 +- .../address_standardizer/address_standardizer.c | 36 ++++++++++- .../expected/test-standardize_address_1.out | 12 ++++ extensions/address_standardizer/standard.c | 53 +++++++++++----- .../test-standardize_address_1.sql.in | 2 + extensions/postgis_tiger_geocoder/Makefile.in | 6 +- extras/tiger_geocoder/create_geocode.sql | 2 +- extras/tiger_geocoder/geocode/geocode.sql | 68 +++++++++------------ extras/tiger_geocoder/geocode/rate_attributes.sql | 45 ++++++-------- extras/tiger_geocoder/normalize/end_soundex.sql | 18 ++---- .../normalize/location_extract_place_exact.sql | 62 ++++--------------- .../pagc_normalize/pagc_normalize_address.sql | 70 +++++++++++----------- .../regress/normalize_address_regress | 9 +++ .../regress/normalize_address_regress.sql | 35 +++++++++++ .../regress/pagc_normalize_address_regress | 10 +++- .../regress/pagc_normalize_address_regress.sql | 4 ++ extras/tiger_geocoder/upgrade_geocode.sql | 2 +- .../utility/nullable_levenshtein.sql | 29 +++------ 19 files changed, 259 insertions(+), 217 deletions(-) hooks/post-receive -- PostGIS From trac at osgeo.org Mon Mar 9 13:27:34 2026 From: trac at osgeo.org (PostGIS) Date: Mon, 09 Mar 2026 20:27:34 -0000 Subject: [PostGIS] #2459: Speed up pagc_normalize_address In-Reply-To: <046.11c0ea620d0afb94afcd80a194f17e79@osgeo.org> References: <046.11c0ea620d0afb94afcd80a194f17e79@osgeo.org> Message-ID: <061.a84653fce734409e49c20aa327e16d8c@osgeo.org> #2459: Speed up pagc_normalize_address ----------------------------------+----------------------------- Reporter: robe | Owner: robe Type: enhancement | Status: closed Priority: medium | Milestone: PostGIS Fund Me Component: pagc_address_parser | Version: master Resolution: fixed | Keywords: ----------------------------------+----------------------------- Changes (by Darafei Praliaskouski ): * resolution: => fixed * status: new => closed Comment: In [changeset:"bd6ef65e8d418d17064225b182347478ebe84b11/git" bd6ef65/git]: {{{#!CommitTicketReference repository="git" revision="bd6ef65e8d418d17064225b182347478ebe84b11" #2459 Improve tiger geocoder wrapper normalization Speed up pagc_normalize_address with a single standardize_address() call while preserving ZIP+4, country, and ZIP-only fallbacks. Convert several expression-only tiger wrappers to SQL where install order allows, preserve extension schema qualifications, and refresh the related docs and regression coverage. Closes #2459 }}} -- Ticket URL: PostGIS The PostGIS Trac is used for bug, enhancement & task tracking, a user and developer wiki, and a view into the subversion code repository of PostGIS project. From git at osgeo.org Tue Mar 10 15:59:28 2026 From: git at osgeo.org (git at osgeo.org) Date: Tue, 10 Mar 2026 15:59:28 -0700 (PDT) Subject: [SCM] PostGIS branch master updated. 3.6.0rc2-384-gda7611d73 Message-ID: <20260310225928.6DB2E1B75A3@trac.osgeo.org> 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 da7611d733bd175a55ca9ce02298650bcb1f8123 (commit) from bd6ef65e8d418d17064225b182347478ebe84b11 (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 da7611d733bd175a55ca9ce02298650bcb1f8123 Author: Darafei Praliaskouski Date: Wed Mar 11 02:56:50 2026 +0400 Optimize PostGIS module self-calls under LTO Detect -fno-semantic-interposition when the compiler supports it and pass it into PostgreSQL extension module builds so LTO can replace same-DSO PLT calls with direct internal calls. Add a NEWS note with the local pgbench ST_Collect benchmark result. diff --git a/NEWS b/NEWS index 6d6847db0..bf6108365 100644 --- a/NEWS +++ b/NEWS @@ -32,6 +32,12 @@ This version requires GEOS 3.10 or higher * Bug Fixes * + - Build PostgreSQL extension modules with `-fno-semantic-interposition` when + available so LTO can optimize same-DSO calls to exported PostGIS + entry points directly instead of routing through the module PLT; in + a local PostgreSQL 18 `pgbench` microbenchmark over 100k four-point + groups this reduced `ST_Collect` aggregate latency by about 4% + (Darafei Praliaskouski) - #5973, Install PostGIS utilities under `pg_config --bindir` by default and document `pg_config`-derived install paths more accurately (Darafei Praliaskouski) diff --git a/configure.ac b/configure.ac index ce0e97a11..9fad2de51 100644 --- a/configure.ac +++ b/configure.ac @@ -81,6 +81,15 @@ dnl PICFLAGS="$lt_prog_compiler_pic" AC_SUBST([PICFLAGS]) +dnl +dnl PostgreSQL extension modules can call exported PostGIS entry points across +dnl translation units. Disable semantic interposition when supported so the +dnl compiler can optimize those same-DSO calls directly. +dnl +MODULE_CFLAGS="" +_LT_COMPILER_OPTION([if $compiler supports -fno-semantic-interposition], [_cv_nosemanticinterposition], [-fno-semantic-interposition], [], [MODULE_CFLAGS="$MODULE_CFLAGS -fno-semantic-interposition"], []) +AC_SUBST([MODULE_CFLAGS]) + _LT_COMPILER_OPTION([if $compiler supports -fno-math-errno], [_cv_nomatherrno], [-fno-math-errno], [], [CFLAGS="$CFLAGS -fno-math-errno"], []) _LT_COMPILER_OPTION([if $compiler supports -fno-signed-zeros], [_cv_nosignedzeros], [-fno-signed-zeros], [], [CFLAGS="$CFLAGS -fno-signed-zeros"], []) _LT_COMPILER_OPTION([if $compiler supports -std=gnu11], [_cv_std], -std=gnu11, [], [CFLAGS="-std=gnu11 $CFLAGS"], []) diff --git a/extensions/address_standardizer/Makefile.in b/extensions/address_standardizer/Makefile.in index f4929b010..78158c87b 100644 --- a/extensions/address_standardizer/Makefile.in +++ b/extensions/address_standardizer/Makefile.in @@ -53,7 +53,7 @@ sql/$(EXTENSION)_data_us--$(EXTVERSION)next--$(EXTVERSION).sql sql/$(EXTENSION)_ sql/test-init-extensions.sql sql/test-parseaddress.sql sql/test-standardize_address_1.sql sql/test-standardize_address_2.sql sql/test-debug_standardize_address.sql DOCS = README.address_standardizer -PG_CPPFLAGS = @CFLAGS@ @CPPFLAGS@ -DPCRE_VERSION=@PCRE_VERSION@ +PG_CPPFLAGS = @CFLAGS@ @MODULE_CFLAGS@ @CPPFLAGS@ -DPCRE_VERSION=@PCRE_VERSION@ SHLIB_LINK = @SHLIB_LINK@ @PCRE_LDFLAGS@ EXTRA_CLEAN = sql/ usps-st-city-name.txt mk-st-regexp mk-city-regex test_main diff --git a/postgis/Makefile.in b/postgis/Makefile.in index 03955ba39..e433d51f6 100644 --- a/postgis/Makefile.in +++ b/postgis/Makefile.in @@ -145,7 +145,7 @@ OBJS=$(PG_OBJS) # to an existing liblwgeom.so in the PostgreSQL $libdir supplied by an # older version of PostGIS, rather than with the static liblwgeom.a # supplied with newer versions of PostGIS -PG_CPPFLAGS += -I at top_srcdir@/liblwgeom -I at top_builddir@/liblwgeom @CFLAGS@ -I at top_srcdir@/libpgcommon $(FLATGEOBUF_INCLUDE) $(WAYGU_INCLUDE) $(UTHASH_INCLUDE) @CPPFLAGS@ @PICFLAGS@ +PG_CPPFLAGS += -I at top_srcdir@/liblwgeom -I at top_builddir@/liblwgeom @CFLAGS@ @MODULE_CFLAGS@ -I at top_srcdir@/libpgcommon $(FLATGEOBUF_INCLUDE) $(WAYGU_INCLUDE) $(UTHASH_INCLUDE) @CPPFLAGS@ @PICFLAGS@ SHLIB_LINK_F = $(WAYGU_LIB) $(FLATGEOBUF_LIB) ../libpgcommon/libpgcommon.a ../liblwgeom/.libs/liblwgeom.a @SHLIB_LINK@ # Extra files to remove during 'make clean' diff --git a/raster/rt_pg/Makefile.in b/raster/rt_pg/Makefile.in index 7b0627fe9..4cac36116 100644 --- a/raster/rt_pg/Makefile.in +++ b/raster/rt_pg/Makefile.in @@ -79,6 +79,7 @@ PG_CPPFLAGS += \ $(LIBLWGEOM_CFLAGS) \ @CPPFLAGS@ \ @CFLAGS@ \ + @MODULE_CFLAGS@ \ $(LIBGDAL_CFLAGS) \ $(LIBPGCOMMON_CFLAGS) \ $(LIBPROJ_CFLAGS) \ diff --git a/sfcgal/Makefile.in b/sfcgal/Makefile.in index 61ebe0842..98bec98ad 100644 --- a/sfcgal/Makefile.in +++ b/sfcgal/Makefile.in @@ -55,7 +55,7 @@ OBJS = lwgeom_sfcgal.o postgis_sfcgal_legacy.o # to an existing liblwgeom.so in the PostgreSQL $libdir supplied by an # older version of PostGIS, rather than with the static liblwgeom.a # supplied with newer versions of PostGIS -PG_CPPFLAGS += -I at top_builddir@/liblwgeom -I at top_srcdir@/liblwgeom -I at top_srcdir@/libpgcommon @CFLAGS@ @CPPFLAGS@ @PICFLAGS@ +PG_CPPFLAGS += -I at top_builddir@/liblwgeom -I at top_srcdir@/liblwgeom -I at top_srcdir@/libpgcommon @CFLAGS@ @MODULE_CFLAGS@ @CPPFLAGS@ @PICFLAGS@ SHLIB_LINK_F = @top_builddir@/libpgcommon/libpgcommon.a @top_builddir@/liblwgeom/.libs/liblwgeom.a @SHLIB_LINK@ # Add SFCGAL Flags if defined diff --git a/topology/Makefile.in b/topology/Makefile.in index 608f5e76a..24f155599 100644 --- a/topology/Makefile.in +++ b/topology/Makefile.in @@ -52,7 +52,7 @@ OBJS = postgis_topology.o # to an existing liblwgeom.so in the PostgreSQL $libdir supplied by an # older version of PostGIS, rather than with the static liblwgeom.a # supplied with newer versions of PostGIS -PG_CPPFLAGS += -I at top_builddir@/liblwgeom -I at top_srcdir@/liblwgeom -I at top_srcdir@/libpgcommon @CFLAGS@ @CPPFLAGS@ @PICFLAGS@ +PG_CPPFLAGS += -I at top_builddir@/liblwgeom -I at top_srcdir@/liblwgeom -I at top_srcdir@/libpgcommon @CFLAGS@ @MODULE_CFLAGS@ @CPPFLAGS@ @PICFLAGS@ SHLIB_LINK_F = @top_builddir@/libpgcommon/libpgcommon.a @top_builddir@/liblwgeom/.libs/liblwgeom.a @SHLIB_LINK@ # Add SFCGAL Flags if defined ----------------------------------------------------------------------- Summary of changes: NEWS | 6 ++++++ configure.ac | 9 +++++++++ extensions/address_standardizer/Makefile.in | 2 +- postgis/Makefile.in | 2 +- raster/rt_pg/Makefile.in | 1 + sfcgal/Makefile.in | 2 +- topology/Makefile.in | 2 +- 7 files changed, 20 insertions(+), 4 deletions(-) hooks/post-receive -- PostGIS From trac at osgeo.org Wed Mar 11 04:30:36 2026 From: trac at osgeo.org (PostGIS) Date: Wed, 11 Mar 2026 11:30:36 -0000 Subject: [PostGIS] #5928: ST_Collect creates invalid result with only valid input In-Reply-To: <050.84e3da0ea6a49235b6bfb1faab70c23d@osgeo.org> References: <050.84e3da0ea6a49235b6bfb1faab70c23d@osgeo.org> Message-ID: <065.2510b3c36ad02de4866f5ffcf8e6a554@osgeo.org> #5928: ST_Collect creates invalid result with only valid input --------------------------------+--------------------------- Reporter: Lars Aksel Opsahl | Owner: pramsey Type: defect | Status: closed Priority: medium | Milestone: PostGIS 3.6.0 Component: postgis | Version: 3.5.x Resolution: worksforme | Keywords: --------------------------------+--------------------------- Comment (by Lars Aksel Opsahl): Here we another case that reports invalid {{{ POSTGIS="3.7.0dev 3.6.0rc2-305-g3b3488ddf" [EXTENSION] PGSQL="160" GEOS="3.12.1-CAPI-1.18.1" PROJ="8.2.1 NETWORK_ENABLED=OFF URL_ENDPOINT=https://cdn.proj.org USER_WRITABLE_DIRECTORY=/tmp/proj DATABASE_PATH=/usr/share/proj/proj.db" (compiled against PROJ 8.2.1) LIBXML="2.9.13" LIBJSON="0.15" LIBPROTOBUF="1.3.3" WAGYU="0.5.0 (Internal)" TOPOLOGY PostgreSQL 16.13 (Ubuntu 16.13-1.pgdg22.04+1) on x86_64-pc-linux-gnu, compiled by gcc POSTGIS="3.7.0dev 3.6.0rc2-305-g3b3488ddf" [EXTENSION] PGSQL="160" GEOS="3.14.0beta3-CAPI-1.20.2" PROJ="9.3.0 NETWORK_ENABLED=OFF URL_ENDPOINT=https://cdn.proj.org USER_WRITABLE_DIRECTORY=/tmp/proj DATABASE_PATH=/usr/local/share/proj/proj.db" (compiled against PROJ 9.3.0) LIBXML="2.9.13" LIBJSON="0.15" LIBPROTOBUF="1.3.3" WAGYU="0.5.0 PostgreSQL 16.4 (Ubuntu 16.4-1.pgdg22.04+1) on x86_64-pc-linux-gnu, compiled by gcc POSTGIS="3.4.2 c19ce56" [EXTENSION] PGSQL="160" GEOS="3.12.1-CAPI-1.18.1" (compiled against GEOS 3.10.2) SFCGAL="SFCGAL 1.4.1, CGAL 5.3.1, BOOST 1.74.0" PROJ="8.2.1 NETWORK_ENABLED=OFF URL_ENDPOINT=https://cdn.proj.org USER_WRITABLE_DIRECTORY=/tmp/proj DATABASE_PATH=/usr/share/proj/proj.db" GDAL="GDAL 3.4.1, released 2021/12/27" LIBXML="2.9.13" LIBJSON="0.15" LIBPROTOBUF="1.3.3" WAGYU="0.5.0 (Internal)" TOPOLOGY RASTER PostgreSQL 16.3 (Ubuntu 16.3-1.pgdg22.04+1) on x86_64-pc-linux-gnu, compiled by gcc }}} with this SQL {{{ SELECT st_isvalid('MULTIPOLYGON(((12.73351507 66.6119868,12.72915463 66.61146327,12.72920119 66.60972247,12.72945039 66.60975288,12.73086236 66.60987212,12.73225836 66.60991913,12.73311671 66.61016498,12.73362813 66.61025306,12.73434255 66.61034415,12.73575726 66.61043645,12.7386931 66.61068521,12.73988777 66.61071138,12.74061663 66.61089232,12.74076635 66.61098432,12.74086396 66.61107749,12.73850885 66.61179694,12.73501412 66.61224321,12.73351507 66.6119868)),((12.72464326 66.6047916,12.72509264 66.60481597,12.72582554 66.60495225,12.72602674 66.60508232,12.72603872 66.60509007,12.7267101 66.60515356,12.72723185 66.60537653,12.72751001 66.60554212,12.72772402 66.60567088,12.72772215 66.60594021,12.72750993 66.60603578,12.72660539 66.60604961,12.7256939 66.6058928,12.72486593 66.60583665,12.72434737 66.60580148,12.72412926 66.60571753,12.72406373 66.60544731,12.72423639 66.60528825,12.72485844 66.60515366,12.72446238 66.60504021,12.72440707 66.60490477,12.72464326 66.6047916)),((12.72785797 66.60865523,12.72763914 66.6085689,12.72730494 66.60851909,12.72522934 66.6084981,12.72489657 66.60843035,12.72482116 66.6082677,12.72545361 66.60777422,12.72573269 66.60768851,12.72640825 66.60770736,12.72721032 66.60782659,12.72845445 66.60805104,12.72886242 66.60817634,12.73007995 66.60855026,12.73013634 66.60867683,12.73098171 66.60881471,12.73148102 66.60903725,12.73154189 66.60911003,12.73164482 66.60921922,12.73188105 66.60959953,12.73180518 66.60968828,12.73114001 66.60955292,12.73062205 66.60953654,12.73041331 66.60959627,12.72956277 66.60951225,12.72923266 66.60941763,12.72906475 66.60928066,12.72921382 66.60913014,12.72950374 66.60917032,12.72956074 66.60928774,12.7297871 66.60928213,12.72984042 66.60919314,12.72968418 66.60917293,12.72921628 66.60910324,12.72877257 66.60901604,12.72785797 66.60865523)),((12.73199805 66.60681972,12.73168389 66.6072327,12.73166897 66.60722696,12.73076767 66.60720496,12.73020794 66.60715199,12.72968801 66.60691102,12.72935792 66.60681648,12.72930011 66.60670794,12.73042939 66.60670632,12.73065902 66.60666476,12.73065123 66.60650308,12.73054584 66.60642087,12.72987666 66.60633032,12.72970714 66.60621119,12.72891063 66.60602913,12.72845286 66.60585196,12.72846291 66.60549317,12.72879506 66.60531837,12.72966186 66.6052232,12.73056228 66.60525417,12.7312749 66.60536321,12.73173701 66.60549555,12.73196047 66.60576814,12.73234428 66.60601602,12.73273465 66.6061922,12.73263215 66.60632527,12.73184734 66.6065114,12.73188898 66.60679922,12.73199805 66.60681972)),((12.73501412 66.61224321,12.73850885 66.61179694,12.74086396 66.61107749,12.7411196 66.6113215,12.74189603 66.61147628,12.74201596 66.61136007,12.74542231 66.61212045,12.74544837 66.61215563,12.74595556 66.61228857,12.74651463 66.61235045,12.74668694 66.61244268,12.74657412 66.61269238,12.74577594 66.61302199,12.74594826 66.61311422,12.74674897 66.61325138,12.74680661 66.61361132,12.74646416 66.61365119,12.74651717 66.61381352,12.74729591 66.61419269,12.74719752 66.61428112,12.74696949 66.61430469,12.74638863 66.61423353,12.74465746 66.61414584,12.74347271 66.61425448,12.74323027 66.61418816,12.74362602 66.61405922,12.74329987 66.61391989,12.7430759 66.61389872,12.74278479 66.61411893,12.74267985 66.61427907,12.74149695 66.61436968,12.73962089 66.61462991,12.73697154 66.61469946,12.73691847 66.61478845,12.73628819 66.61476141,12.73532734 66.61464883,12.73471494 66.61467589,12.73414006 66.61478437,12.73307809 66.614787,12.73229014 66.61475758,12.73069452 66.61491404,12.72969859 66.61493555,12.72935116 66.61502926,12.72901275 66.61502436,12.7287929 66.61495835,12.72827566 66.61493292,12.7277744 66.61497961,12.72755314 66.61493144,12.72743563 66.61473227,12.72720555 66.61453148,12.72715694 66.613337,12.72676485 66.61317874,12.72676635 66.61291847,12.72643597 66.61282393,12.72637662 66.61223964,12.72576027 66.61181783,12.72537679 66.61181228,12.72509342 66.61170046,12.72492742 66.61129415,12.72480995 66.61035897,12.72464185 66.61022181,12.72458651 66.61008646,12.72476333 66.60988249,12.72477142 66.6095506,12.72521703 66.60936847,12.72579405 66.60923331,12.72658184 66.60926258,12.72747089 66.60941907,12.7281996 66.60960024,12.72920119 66.60972247,12.72915463 66.61146327,12.73351507 66.6119868,12.73501412 66.61224321)),((13.22577765 66.67543727,13.22606296 66.67535461,13.22609082 66.67537664,13.22613021 66.67540185,13.22616388 66.67542485,13.22620612 66.67545458,13.2262548 66.67546401,13.22630894 66.67546991,13.22636625 66.67547594,13.22643214 66.6754853,13.22649212 66.67549818,13.22654908 66.6755121,13.22659456 66.67552823,13.22661366 66.67555232,13.22663361 66.67556143,13.22668009 66.67554472,13.22671799 66.67552774,13.22676428 66.67552,13.22677771 66.67554744,13.22675682 66.67557349,13.22671833 66.6756051,13.22669153 66.67563459,13.22667872 66.67567438,13.22667814 66.67569824,13.2266939 66.67574041,13.22671861 66.6757747,13.22672951 66.67579636,13.22671135 66.67582236,13.22667899 66.6758473,13.22664915 66.67588134,13.22663645 66.67591646,13.22663562 66.67594382,13.22666567 66.67598562,13.22661911 66.67600035,13.22620044 66.67583671,13.2262 66.67583652,13.22637713 66.67578494,13.22577765 66.67543727)),((13.23020803 66.67515154,13.23022813 66.67512377,13.23031378 66.67500583,13.23020168 66.67479745,13.22996078 66.67483881,13.22985477 66.6749628,13.22985056 66.67496796,13.22977083 66.67493359,13.22966834 66.67488523,13.2296721 66.6748833,13.22984137 66.67479906,13.22980719 66.67470409,13.22968287 66.67463171,13.22958072 66.67463872,13.22950541 66.67464389,13.2295044 66.67464208,13.22949659 66.67462154,13.2294889 66.67459309,13.22945828 66.67456224,13.22941906 66.67453128,13.22940857 66.67450389,13.22939536 66.67446398,13.22938759 66.6744333,13.2293654 66.6744081,13.22933493 66.67437841,13.22929591 66.67433831,13.2292637 66.67430761,13.22929812 66.67429481,13.22930103 66.67425733,13.2296393 66.67413039,13.23003912 66.67420937,13.23038481 66.67429501,13.23084593 66.67478603,13.23203652 66.67493546,13.23391416 66.67437307,13.23396182 66.67435871,13.23396914 66.67435771,13.23400744 66.67433176,13.23402528 66.67431024,13.2340714 66.67430475,13.23412305 66.67431071,13.23417109 66.67432911,13.23422775 66.67435675,13.2342754 66.67439336,13.2343034 66.6744197,13.23430819 66.67444138,13.23427824 66.67448672,13.23425149 66.6745093,13.23422782 66.6745365,13.23420435 66.67455122,13.23415713 66.67458165,13.23412504 66.67459978,13.23406398 66.67462099,13.23406073 66.674638,13.23408277 66.67466544,13.23411036 66.67469752,13.23413533 66.67472831,13.23416899 66.67475471,13.23420015 66.67476852,13.23424852 66.67478243,13.23430537 66.67480425,13.23433929 66.67482383,13.2343326 66.67484772,13.23430045 66.67486683,13.23425398 66.67488022,13.23419014 66.67489924,13.23412924 66.67491498,13.23403421 66.67492693,13.23398297 66.67491531,13.23391144 66.6749024,13.23386256 66.67490212,13.23381669 66.6749008,13.23375675 66.67489366,13.23370171 66.67490363,13.23363856 66.67490328,13.23359847 66.67489404,13.23354166 66.6748812,13.23348153 66.67486724,13.23340729 66.67485429,13.23330105 66.6748583,13.23327168 66.67487637,13.23326237 66.67489574,13.23324966 66.67493427,13.2332206 66.67495127,13.23318545 66.67496469,13.23311346 66.67496774,13.23305916 66.67496408,13.23303274 66.67498209,13.23299774 66.67499668,13.23299128 66.67502057,13.23297882 66.67505238,13.23296361 66.67507509,13.23295984 66.67510574,13.23298457 66.67513662,13.2330177 66.67517997,13.2329681 66.67519916,13.23293861 66.67522853,13.23293797 66.67525015,13.23293969 66.6752831,13.23295836 66.67533222,13.23296052 66.6753527,13.23294252 66.67537646,13.23289215 66.67541601,13.23283974 66.67543974,13.23281363 66.67545659,13.23276934 66.67548714,13.23271425 66.67550393,13.23265925 66.67551955,13.2325588 66.67551223,13.2325212 66.67551881,13.2325036 66.67553692,13.23247674 66.67556749,13.23244459 66.67558328,13.23238994 66.6755876,13.23233238 66.67558839,13.23228651 66.67558707,13.23226027 66.67559942,13.23225628 66.67562675,13.2322095 66.67565718,13.23215781 66.67565813,13.23210622 66.67565782,13.23203944 66.6756734,13.23199048 66.67567429,13.23195847 66.67569125,13.23190907 66.6757046,13.23184598 66.67570658,13.23178946 66.6756801,13.23176144 66.67565718,13.23173319 66.67563433,13.23167085 66.67561012,13.23160527 66.67559951,13.23157987 66.6755811,13.23155779 66.67556057,13.23152397 66.6755365,13.23150884 66.67555805,13.2314397 66.67556562,13.23138848 66.67555059,13.23132882 66.67553323,13.23127208 66.67550343,13.23121845 66.67547465,13.23116775 66.6754459,13.23108538 66.67541366,13.23103118 66.67540542,13.23095408 66.67539136,13.23088273 66.67537279,13.23078887 66.67534616,13.23068658 66.67531378,13.23058979 66.67528703,13.2304646 66.67524883,13.23041062 66.67522812,13.23032789 66.67520727,13.23029127 66.67518433,13.23024897 66.67516474,13.23020803 66.67515154)),((13.22309161 66.67505241,13.22511523 66.67615246,13.2262 66.67583652,13.22620044 66.67583671,13.22661911 66.67600035,13.22666567 66.67598562,13.22668504 66.67601231,13.22672084 66.67606252,13.22674818 66.676098,13.2268047 66.67613696,13.22686643 66.67617597,13.22691139 66.67620573,13.22695667 66.67623101,13.22703334 66.67625754,13.22705563 66.67627816,13.22706926 66.67629653,13.22709422 66.67632732,13.22711943 66.67635139,13.22717673 66.67636074,13.22723371 66.67637125,13.22726159 66.67638969,13.22728099 66.67641593,13.22732628 66.67644121,13.22738081 66.67644488,13.22743554 66.67643939,13.22748192 66.67642726,13.22754302 66.67640246,13.22760922 66.67639486,13.22766886 66.67641564,13.22775115 66.67644896,13.22782719 66.67649378,13.22787212 66.67652704,13.22790589 66.67654878,13.22794841 66.67656838,13.22800521 66.67658454,13.22805357 66.67659846,13.22808767 66.67661239,13.22811291 66.67663295,13.22812901 66.67667056,13.22814558 66.67668887,13.22812723 66.67672061,13.2280409 66.67672475,13.22798645 66.67671992,13.22793164 66.67672639,13.22791952 66.67675031,13.22791285 66.67677069,13.2279178 66.67680269,13.22791996 66.67682309,13.22795086 66.67684372,13.22801936 66.67685777,13.22806791 66.67686594,13.22814768 66.67689026,13.22817859 66.67690748,13.22822978 66.67692933,13.2282951 66.67694675,13.22837785 66.67696429,13.22842323 66.67698499,13.22844865 66.6769999,13.22848519 66.677024,13.22852461 66.67704581,13.22858129 66.67707004,13.22865818 66.67709657,13.22872939 66.67711398,13.22878635 66.67712799,13.2288003 66.67714511,13.22881407 66.67716456,13.22884161 66.67719421,13.22889827 66.67722186,13.22894376 66.67723798,13.22897164 66.67725975,13.22899932 66.67729057,13.22902381 66.67733742,13.22904314 66.67736474,13.22905953 66.67738879,13.22909276 66.67742425,13.22911757 66.67745728,13.22916852 66.67747922,13.22921461 66.67748063,13.22922104 66.677451,13.22923077 66.67742266,13.22929965 66.67742191,13.22933646 66.67743911,13.22936188 66.67745411,13.22938984 66.67747471,13.22944387 66.67750116,13.22949217 66.67751274,13.2295577 66.67753358,13.22959966 66.67756115,13.22962212 66.67757944,13.22966157 66.67761039,13.22970636 66.67764249,13.22975737 66.67765751,13.22979746 66.67766675,13.22982862 66.67768056,13.22985386 66.67770122,13.22987887 66.67772519,13.22991289 66.6777402,13.23001004 66.67775888,13.2300627 66.67781718,13.23009319 66.67784363,13.22706787 66.67874052,13.22702484 66.67875322,13.22700455 66.6787425,13.22695629 66.67872401,13.2268798 66.67869174,13.22679724 66.67866523,13.22673736 66.67864777,13.22667761 66.67863158,13.22664639 66.67861543,13.22660723 66.67858681,13.22657671 66.67855138,13.22655486 66.67851829,13.226527 66.67849312,13.22648464 66.67847129,13.22643363 66.6784437,13.22637726 66.67841839,13.22632649 66.67838739,13.22628712 66.67835868,13.22623945 66.67832557,13.2262177 66.6782879,13.22620153 66.67825138,13.22617146 66.67820339,13.22613514 66.67816681,13.22609031 66.67814154,13.22602772 66.67812074,13.22595105 66.67809421,13.22588587 66.67806538,13.22583231 66.67803553,13.2257932 66.678,13.22577412 66.67796927,13.22576064 66.67793619,13.22574417 66.6779133,13.22570484 66.67789033,13.22564793 66.67786618,13.22557404 66.67784192,13.22548588 66.67782101,13.22540619 66.67779552,13.22534403 66.67776565,13.22529007 66.67774144,13.2252393 66.67771054,13.22519991 66.67768524,13.22516344 66.67766338,13.22510677 66.67763582,13.22503307 66.67760582,13.22493925 66.67757237,13.22483434 66.67753547,13.22473772 66.67750306,13.22462949 66.67746837,13.22457662 66.67744785,13.22455106 66.67740655,13.22312366 66.67510419,13.22309161 66.67505241)),((13.22489005 66.67378623,13.22435241 66.67356174,13.22297643 66.67341044,13.22247757 66.67401376,13.22256566 66.67419289,13.22244167 66.67399353,13.22121075 66.67201759,13.22096229 66.67172672,13.22468265 66.67217543,13.22724258 66.67246803,13.22695369 66.67338405,13.22613165 66.67339067,13.2257825 66.67324638,13.22546299 66.67340206,13.22567275 66.67356757,13.22628639 66.67362259,13.22655299 66.67376576,13.22723131 66.67356297,13.2272889 66.67359961,13.22728711 66.67359941,13.22717202 66.67363849,13.22709713 66.6736599,13.22701887 66.67368101,13.22694121 66.67370319,13.22687156 66.67372108,13.2267888 66.673745,13.22668548 66.67377462,13.22660735 66.67380021,13.22652309 66.67382923,13.22643595 66.67385723,13.22637838 66.67387722,13.22627906 66.67390787,13.22617426 66.67393909,13.22609788 66.67396865,13.22624118 66.67387415,13.2257688 66.67376545,13.22549691 66.67393262,13.22537784 66.67414377,13.22578962 66.67422308,13.22595816 66.67406067,13.22594648 66.67408145,13.22592065 66.67411328,13.2258961 66.67414944,13.22587371 66.67418382,13.22585783 66.67422214,13.22584436 66.67424891,13.2258066 66.67428294,13.22576626 66.67431829,13.22572935 66.67434668,13.22565375 66.67437491,13.22553395 66.67440703,13.22562304 66.674459,13.22575278 66.67442403,13.22585745 66.6743851,13.22590873 66.67434566,13.22595147 66.67430854,13.22596226 66.67429876,13.2260058 66.67424553,13.22609747 66.67427097,13.22615785 66.6742959,13.22626392 66.6743397,13.2262419 66.6743651,13.22625277 66.67437843,13.22620325 66.67439645,13.22613665 66.6744097,13.22609353 66.67441747,13.22605279 66.67442984,13.22603195 66.67444899,13.22601705 66.67447054,13.22600445 66.67449776,13.22598616 66.67453184,13.22596486 66.67456363,13.22594067 66.67460096,13.22593131 66.67463047,13.22592443 66.67466009,13.22590967 66.67468281,13.22589439 66.67470651,13.22589002 66.67474532,13.2258981 66.67477143,13.22589989 66.67480331,13.2259047 66.67483405,13.22591215 66.67486599,13.22592303 66.67489106,13.22592731 66.67493544,13.22590941 66.67495462,13.22590582 66.6749763,13.22593941 66.67500037,13.22600737 66.67503138,13.22608687 66.67506251,13.22611786 66.67507866,13.22616529 66.67512442,13.2261787 66.67515517,13.22616913 66.67518136,13.22613713 66.67519823,13.22606812 66.6751944,13.22599355 66.67518611,13.22595035 66.67519495,13.22593261 66.67521189,13.22593451 66.67523588,13.22594514 66.67526435,13.22597022 66.67528725,13.22600682 66.6753136,13.22606296 66.67535461,13.22577765 66.67543727,13.22523208 66.6751209,13.22475963 66.67412693,13.22489005 66.67378623)))'); NOTICE: 00000: Self-intersection at or near point 13.226665669999999 66.675985620000006 LOCATION: pg_notice, lwgeom_pg.c:354 st_isvalid ------------ f (1 row) }}} -- Ticket URL: PostGIS The PostGIS Trac is used for bug, enhancement & task tracking, a user and developer wiki, and a view into the subversion code repository of PostGIS project. From trac at osgeo.org Wed Mar 11 04:31:00 2026 From: trac at osgeo.org (PostGIS) Date: Wed, 11 Mar 2026 11:31:00 -0000 Subject: [PostGIS] #5928: ST_Collect creates invalid result with only valid input In-Reply-To: <050.84e3da0ea6a49235b6bfb1faab70c23d@osgeo.org> References: <050.84e3da0ea6a49235b6bfb1faab70c23d@osgeo.org> Message-ID: <065.43455bfccf6aadd11859152860388375@osgeo.org> #5928: ST_Collect creates invalid result with only valid input --------------------------------+--------------------------- Reporter: Lars Aksel Opsahl | Owner: pramsey Type: defect | Status: reopened Priority: medium | Milestone: PostGIS 3.6.0 Component: postgis | Version: 3.5.x Resolution: | Keywords: --------------------------------+--------------------------- Changes (by Lars Aksel Opsahl): * resolution: worksforme => * status: closed => reopened -- Ticket URL: PostGIS The PostGIS Trac is used for bug, enhancement & task tracking, a user and developer wiki, and a view into the subversion code repository of PostGIS project. From trac at osgeo.org Wed Mar 11 14:18:10 2026 From: trac at osgeo.org (PostGIS) Date: Wed, 11 Mar 2026 21:18:10 -0000 Subject: [PostGIS] #6053: Spin off address_standardizer as separate project In-Reply-To: <049.f4d1eb5ea5ce334e1b08e74f1d6e7c99@osgeo.org> References: <049.f4d1eb5ea5ce334e1b08e74f1d6e7c99@osgeo.org> Message-ID: <064.4a7340ec68f608de40ec0c5623a00607@osgeo.org> #6053: Spin off address_standardizer as separate project ----------------------+--------------------------- Reporter: pramsey | Owner: pramsey Type: defect | Status: assigned Priority: medium | Milestone: PostGIS 3.7.0 Component: postgis | Version: master Resolution: | Keywords: ----------------------+--------------------------- Comment (by Paul Ramsey ): In [changeset:"68dde711039986b47eb62feda45bb24b13b0ea37/git" 68dde71/git]: {{{#!CommitTicketReference repository="git" revision="68dde711039986b47eb62feda45bb24b13b0ea37" Remove address_standardizer extension, as it has moved to its own repo at https://github.com/postgis/address_standardizer References #6053 }}} -- Ticket URL: PostGIS The PostGIS Trac is used for bug, enhancement & task tracking, a user and developer wiki, and a view into the subversion code repository of PostGIS project. From trac at osgeo.org Wed Mar 11 14:19:28 2026 From: trac at osgeo.org (PostGIS) Date: Wed, 11 Mar 2026 21:19:28 -0000 Subject: [PostGIS] #5771: address_standardizer_data_us upgrade sql script can be incorrect In-Reply-To: <046.524edd8cd58c25ff7f532911ec4b217b@osgeo.org> References: <046.524edd8cd58c25ff7f532911ec4b217b@osgeo.org> Message-ID: <061.82b604ef281f6f7d53f7611b1deac30d@osgeo.org> #5771: address_standardizer_data_us upgrade sql script can be incorrect ----------------------+--------------------------- Reporter: evsi | Owner: robe Type: defect | Status: closed Priority: medium | Milestone: PostGIS 3.5.5 Component: postgis | Version: 3.4.x Resolution: wontfix | Keywords: ----------------------+--------------------------- Changes (by pramsey): * resolution: => wontfix * status: new => closed Comment: Re-file at https://github.com/postgis/address_standardizer -- Ticket URL: PostGIS The PostGIS Trac is used for bug, enhancement & task tracking, a user and developer wiki, and a view into the subversion code repository of PostGIS project. From trac at osgeo.org Wed Mar 11 14:20:11 2026 From: trac at osgeo.org (PostGIS) Date: Wed, 11 Mar 2026 21:20:11 -0000 Subject: [PostGIS] #6053: Spin off address_standardizer as separate project In-Reply-To: <049.f4d1eb5ea5ce334e1b08e74f1d6e7c99@osgeo.org> References: <049.f4d1eb5ea5ce334e1b08e74f1d6e7c99@osgeo.org> Message-ID: <064.0e43465d9734a120f6ce600841be4e82@osgeo.org> #6053: Spin off address_standardizer as separate project ----------------------+--------------------------- Reporter: pramsey | Owner: pramsey Type: defect | Status: closed Priority: medium | Milestone: PostGIS 3.7.0 Component: postgis | Version: master Resolution: fixed | Keywords: ----------------------+--------------------------- Changes (by pramsey): * resolution: => fixed * status: assigned => closed -- Ticket URL: PostGIS The PostGIS Trac is used for bug, enhancement & task tracking, a user and developer wiki, and a view into the subversion code repository of PostGIS project. From trac at osgeo.org Wed Mar 11 16:20:53 2026 From: trac at osgeo.org (PostGIS) Date: Wed, 11 Mar 2026 23:20:53 -0000 Subject: [PostGIS] #5928: ST_Collect creates invalid result with only valid input In-Reply-To: <050.84e3da0ea6a49235b6bfb1faab70c23d@osgeo.org> References: <050.84e3da0ea6a49235b6bfb1faab70c23d@osgeo.org> Message-ID: <065.4b1cbb9090bfce2b191f7eaea39ef1dd@osgeo.org> #5928: ST_Collect creates invalid result with only valid input --------------------------------+--------------------------- Reporter: Lars Aksel Opsahl | Owner: pramsey Type: defect | Status: reopened Priority: medium | Milestone: PostGIS 3.6.0 Component: postgis | Version: 3.5.x Resolution: | Keywords: --------------------------------+--------------------------- Comment (by mdavis): Replying to [comment:6 Lars Aksel Opsahl]: > Here we another case that reports invalid That is an invalid MultiPolygon, so `ST_ISValid` is working as expected. -- Ticket URL: PostGIS The PostGIS Trac is used for bug, enhancement & task tracking, a user and developer wiki, and a view into the subversion code repository of PostGIS project. From trac at osgeo.org Wed Mar 11 22:09:34 2026 From: trac at osgeo.org (PostGIS) Date: Thu, 12 Mar 2026 05:09:34 -0000 Subject: [PostGIS] #5928: ST_Collect creates invalid result with only valid input In-Reply-To: <050.84e3da0ea6a49235b6bfb1faab70c23d@osgeo.org> References: <050.84e3da0ea6a49235b6bfb1faab70c23d@osgeo.org> Message-ID: <065.00d623837ab99d68967ee40ad4bf7ae7@osgeo.org> #5928: ST_Collect creates invalid result with only valid input --------------------------------+--------------------------- Reporter: Lars Aksel Opsahl | Owner: pramsey Type: defect | Status: closed Priority: medium | Milestone: PostGIS 3.6.0 Component: postgis | Version: 3.5.x Resolution: worksforme | Keywords: --------------------------------+--------------------------- Changes (by Lars Aksel Opsahl): * resolution: => worksforme * status: reopened => closed Comment: Thanks this mean that if we collect many polygons we have to keep it as a collection in cases where we have many shared borders because of cases like this. -- Ticket URL: PostGIS The PostGIS Trac is used for bug, enhancement & task tracking, a user and developer wiki, and a view into the subversion code repository of PostGIS project. From git at osgeo.org Thu Mar 12 10:43:51 2026 From: git at osgeo.org (git at osgeo.org) Date: Thu, 12 Mar 2026 10:43:51 -0700 (PDT) Subject: [SCM] PostGIS branch master updated. 3.6.0rc2-386-g6cf2d9572 Message-ID: <20260312174351.D4F2F1A062C@trac.osgeo.org> 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 6cf2d95722ad8e9ad6247491b6ae2e11bb9438a1 (commit) from 68dde711039986b47eb62feda45bb24b13b0ea37 (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 6cf2d95722ad8e9ad6247491b6ae2e11bb9438a1 Author: Regina Obe Date: Thu Mar 12 13:43:46 2026 -0400 Fix typo in winnie config diff --git a/ci/winnie/regress_postgis.sh b/ci/winnie/regress_postgis.sh index b3ac5bd47..2f5098aa9 100644 --- a/ci/winnie/regress_postgis.sh +++ b/ci/winnie/regress_postgis.sh @@ -160,7 +160,7 @@ for EXTNAME in $extensions_to_install; do done #cp -r ${PGPATH}/share/extension/postgis*${POSTGIS_MICRO_VER}.sql ${PGPATHEDB}/share/extension #cp -r ${PGPATH}/share/extension/postgis*${POSTGIS_MICRO_VER}next.sql ${PGPATHEDB}/share/extension - p -r extensions/*/*.control ${PGPATHEDB}/share/extension +cp -r extensions/*/*.control ${PGPATHEDB}/share/extension cp -r extensions/*/*.dll ${PGPATHEDB}/lib make check RUNTESTFLAGS="--extension -v" ----------------------------------------------------------------------- Summary of changes: ci/winnie/regress_postgis.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) hooks/post-receive -- PostGIS From trac at osgeo.org Thu Mar 12 11:07:56 2026 From: trac at osgeo.org (PostGIS) Date: Thu, 12 Mar 2026 18:07:56 -0000 Subject: [PostGIS] #6056: Woodie will be moved to osgeo10 Message-ID: <046.6b3dd0406746a94e9ebd6d7e910d7486@osgeo.org> #6056: Woodie will be moved to osgeo10 --------------------------+-------------------------------------- Reporter: robe | Owner: robe Type: defect | Status: new Priority: medium | Milestone: Website Management, Bots Component: QA/buildbots | Version: 3.5.x Keywords: | --------------------------+-------------------------------------- Woodie server has not been working today, bu anyway I'll be moving it to osgeo10 and troubleshoot the issue there. -- Ticket URL: PostGIS The PostGIS Trac is used for bug, enhancement & task tracking, a user and developer wiki, and a view into the subversion code repository of PostGIS project. From trac at osgeo.org Thu Mar 12 11:12:58 2026 From: trac at osgeo.org (PostGIS) Date: Thu, 12 Mar 2026 18:12:58 -0000 Subject: [PostGIS] #6056: Woodie will be moved to osgeo10 In-Reply-To: <046.6b3dd0406746a94e9ebd6d7e910d7486@osgeo.org> References: <046.6b3dd0406746a94e9ebd6d7e910d7486@osgeo.org> Message-ID: <061.b95e5bae6e25ed2b3c4c1369f0249b63@osgeo.org> #6056: Woodie will be moved to osgeo10 ---------------------------+-------------------------------------- Reporter: robe | Owner: robe Type: defect | Status: new Priority: medium | Milestone: Website Management, Bots Component: QA/buildbots | Version: 3.5.x Resolution: | Keywords: ---------------------------+-------------------------------------- Comment (by robe): okay got it working again on osgeo8, but will move later tonight to osgeo10 -- Ticket URL: PostGIS The PostGIS Trac is used for bug, enhancement & task tracking, a user and developer wiki, and a view into the subversion code repository of PostGIS project. From git at osgeo.org Thu Mar 12 11:14:19 2026 From: git at osgeo.org (git at osgeo.org) Date: Thu, 12 Mar 2026 11:14:19 -0700 (PDT) Subject: [SCM] PostGIS branch master updated. 3.6.0rc2-387-gaa6812e6c Message-ID: <20260312181419.7B8B21A4DDB@trac.osgeo.org> 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 aa6812e6c38ddbdac6491115f6abbee2a72ad993 (commit) from 6cf2d95722ad8e9ad6247491b6ae2e11bb9438a1 (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 aa6812e6c38ddbdac6491115f6abbee2a72ad993 Author: Paul Ramsey Date: Thu Mar 12 11:13:14 2026 -0700 Fully qualify calls to format in packaging script. Reported by Daniel Bakker diff --git a/utils/create_unpackaged.pl b/utils/create_unpackaged.pl index e7021d87a..e3cc4ba7f 100755 --- a/utils/create_unpackaged.pl +++ b/utils/create_unpackaged.pl @@ -186,10 +186,10 @@ AS \$\$ DECLARE sql text; proc regproc; - obj text := format('%s %s', type, sig); + obj text := pg_catalog.format('%s %s', type, sig); BEGIN - sql := format('ALTER EXTENSION ${extname} ADD %s', obj); + sql := pg_catalog.format('ALTER EXTENSION ${extname} ADD %s', obj); EXECUTE sql; RAISE NOTICE 'newly registered %', obj; @@ -359,7 +359,7 @@ BEGIN 'Changing ownership of function % from % to % to match ext', rec.oid::regprocedure, rec.proowner::regrole, rec.extowner::regrole; - sql := format( + sql := pg_catalog.format( 'ALTER FUNCTION %s OWNER TO %I', rec.oid::regprocedure, rec.extowner::regrole ----------------------------------------------------------------------- Summary of changes: utils/create_unpackaged.pl | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) hooks/post-receive -- PostGIS From git at osgeo.org Thu Mar 12 11:33:42 2026 From: git at osgeo.org (git at osgeo.org) Date: Thu, 12 Mar 2026 11:33:42 -0700 (PDT) Subject: [SCM] PostGIS branch master updated. 3.6.0rc2-388-gcc9117fda Message-ID: <20260312183342.477EF1A56EB@trac.osgeo.org> 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 cc9117fdae5549464c8dd243c3d296f93f2a5a3f (commit) from aa6812e6c38ddbdac6491115f6abbee2a72ad993 (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 cc9117fdae5549464c8dd243c3d296f93f2a5a3f Author: Regina Obe Date: Thu Mar 12 14:33:36 2026 -0400 Winnie: fix no dlls left in extensions folder now that address_standardizer is gone diff --git a/ci/winnie/regress_postgis.sh b/ci/winnie/regress_postgis.sh index 2f5098aa9..d30575c6c 100644 --- a/ci/winnie/regress_postgis.sh +++ b/ci/winnie/regress_postgis.sh @@ -161,7 +161,7 @@ done #cp -r ${PGPATH}/share/extension/postgis*${POSTGIS_MICRO_VER}.sql ${PGPATHEDB}/share/extension #cp -r ${PGPATH}/share/extension/postgis*${POSTGIS_MICRO_VER}next.sql ${PGPATHEDB}/share/extension cp -r extensions/*/*.control ${PGPATHEDB}/share/extension -cp -r extensions/*/*.dll ${PGPATHEDB}/lib +#cp -r extensions/*/*.dll ${PGPATHEDB}/lib make check RUNTESTFLAGS="--extension -v" ----------------------------------------------------------------------- Summary of changes: ci/winnie/regress_postgis.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) hooks/post-receive -- PostGIS From git at osgeo.org Thu Mar 12 11:43:31 2026 From: git at osgeo.org (git at osgeo.org) Date: Thu, 12 Mar 2026 11:43:31 -0700 (PDT) Subject: [SCM] PostGIS branch master updated. 3.6.0rc2-389-g379a6998a Message-ID: <20260312184331.70C8D1A64BE@trac.osgeo.org> 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 379a6998ac744150a7d9fbacaf153b6b951d3903 (commit) from cc9117fdae5549464c8dd243c3d296f93f2a5a3f (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 379a6998ac744150a7d9fbacaf153b6b951d3903 Author: Regina Obe Date: Thu Mar 12 14:43:20 2026 -0400 Put back pagc_tables. postgis_tiger_geocoder will need those if address_standardizer is used for geocoding diff --git a/extensions/postgis_tiger_geocoder/Makefile.in b/extensions/postgis_tiger_geocoder/Makefile.in index 65456e715..ee6875577 100644 --- a/extensions/postgis_tiger_geocoder/Makefile.in +++ b/extensions/postgis_tiger_geocoder/Makefile.in @@ -131,6 +131,8 @@ sql/tiger_geocoder_minor.sql.in: ../../extras/tiger_geocoder/utility/set_search_ ../../extras/tiger_geocoder/normalize/location_extract.sql \ ../../extras/tiger_geocoder/normalize/normalize_address.sql \ ../../extras/tiger_geocoder/normalize/pprint_addy.sql \ + ../../extras/tiger_geocoder/pagc_normalize/pagc_tables.sql \ + ../../extras/tiger_geocoder/pagc_normalize/pagc_normalize_address.sql \ ../../extras/tiger_geocoder/geocode/other_helper_functions.sql \ ../../extras/tiger_geocoder/geocode/rate_attributes.sql \ ../../extras/tiger_geocoder/geocode/includes_address.sql \ ----------------------------------------------------------------------- Summary of changes: extensions/postgis_tiger_geocoder/Makefile.in | 2 ++ 1 file changed, 2 insertions(+) hooks/post-receive -- PostGIS From git at osgeo.org Thu Mar 12 12:05:11 2026 From: git at osgeo.org (git at osgeo.org) Date: Thu, 12 Mar 2026 12:05:11 -0700 (PDT) Subject: [SCM] PostGIS branch stable-3.6 updated. 3.6.2-3-g6d032d7f2 Message-ID: <20260312190512.148D61A63F2@trac.osgeo.org> 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.6 has been updated via 6d032d7f203aca9e77badfcc26e9c84968cd3655 (commit) from 20e9ab6572a45f5264b033fc1414646a7c0d5190 (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 6d032d7f203aca9e77badfcc26e9c84968cd3655 Author: Paul Ramsey Date: Thu Mar 12 11:59:35 2026 -0700 Remove priv escalation scenario. Reported by Daniel Bakker References #6054 diff --git a/NEWS b/NEWS index 701e08eeb..ab8ac0c4e 100644 --- a/NEWS +++ b/NEWS @@ -16,7 +16,8 @@ topogeometry corruption: * Fixes * - #6055, Remove rare extension priv escalation case. - Reported by Sven Klemm (Tiger Data) and Allistair Ishmael Hakim (allistair.sh) + Reported by Sven Klemm (Tiger Data), Allistair Ishmael Hakim (allistair.sh) + and Daniel Bakker PostGIS 3.6.2 diff --git a/utils/create_unpackaged.pl b/utils/create_unpackaged.pl index e7021d87a..e3cc4ba7f 100755 --- a/utils/create_unpackaged.pl +++ b/utils/create_unpackaged.pl @@ -186,10 +186,10 @@ AS \$\$ DECLARE sql text; proc regproc; - obj text := format('%s %s', type, sig); + obj text := pg_catalog.format('%s %s', type, sig); BEGIN - sql := format('ALTER EXTENSION ${extname} ADD %s', obj); + sql := pg_catalog.format('ALTER EXTENSION ${extname} ADD %s', obj); EXECUTE sql; RAISE NOTICE 'newly registered %', obj; @@ -359,7 +359,7 @@ BEGIN 'Changing ownership of function % from % to % to match ext', rec.oid::regprocedure, rec.proowner::regrole, rec.extowner::regrole; - sql := format( + sql := pg_catalog.format( 'ALTER FUNCTION %s OWNER TO %I', rec.oid::regprocedure, rec.extowner::regrole ----------------------------------------------------------------------- Summary of changes: NEWS | 3 ++- utils/create_unpackaged.pl | 6 +++--- 2 files changed, 5 insertions(+), 4 deletions(-) hooks/post-receive -- PostGIS From trac at osgeo.org Thu Mar 12 12:05:16 2026 From: trac at osgeo.org (PostGIS) Date: Thu, 12 Mar 2026 19:05:16 -0000 Subject: [PostGIS] #6054: Lock down search path during install In-Reply-To: <046.d130944804e39b7d3a159db8f685fa61@osgeo.org> References: <046.d130944804e39b7d3a159db8f685fa61@osgeo.org> Message-ID: <061.3108b85104157d4d37c54a2b26de8a56@osgeo.org> #6054: Lock down search path during install ----------------------+---------------------------- Reporter: robe | Owner: robe Type: defect | Status: assigned Priority: medium | Milestone: PostGIS 3.2.10 Component: install | Version: 3.2.x Resolution: | Keywords: ----------------------+---------------------------- Comment (by Paul Ramsey ): In [changeset:"6d032d7f203aca9e77badfcc26e9c84968cd3655/git" 6d032d7/git]: {{{#!CommitTicketReference repository="git" revision="6d032d7f203aca9e77badfcc26e9c84968cd3655" Remove priv escalation scenario. Reported by Daniel Bakker References #6054 }}} -- Ticket URL: PostGIS The PostGIS Trac is used for bug, enhancement & task tracking, a user and developer wiki, and a view into the subversion code repository of PostGIS project. From git at osgeo.org Thu Mar 12 12:06:10 2026 From: git at osgeo.org (git at osgeo.org) Date: Thu, 12 Mar 2026 12:06:10 -0700 (PDT) Subject: [SCM] PostGIS branch stable-3.5 updated. 3.5.5-3-g1bd2c415c Message-ID: <20260312190610.5EFB21A63F3@trac.osgeo.org> 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.5 has been updated via 1bd2c415cd830ec5e67a9c1987cbfb97aeec9c43 (commit) from d1b44c115e202fbec8fb6238f821f38b7efc6ef0 (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 1bd2c415cd830ec5e67a9c1987cbfb97aeec9c43 Author: Paul Ramsey Date: Thu Mar 12 12:01:24 2026 -0700 Remove priv escalation scenario. Reported by Daniel Bakker References #6054 diff --git a/NEWS b/NEWS index a66c75e0d..ff7816473 100644 --- a/NEWS +++ b/NEWS @@ -7,7 +7,8 @@ PostgreSQL 12-18 required. GEOS 3.8+ required. Proj 6.1+ required. * Bug fixes * - #6055, Remove rare extension priv escalation case. - Reported by Sven Klemm (Tiger Data) and Allistair Ishmael Hakim (allistair.sh) + Reported by Sven Klemm (Tiger Data), Allistair Ishmael Hakim (allistair.sh) + and Daniel Bakker PostGIS 3.5.5 diff --git a/utils/create_unpackaged.pl b/utils/create_unpackaged.pl index e7021d87a..e3cc4ba7f 100755 --- a/utils/create_unpackaged.pl +++ b/utils/create_unpackaged.pl @@ -186,10 +186,10 @@ AS \$\$ DECLARE sql text; proc regproc; - obj text := format('%s %s', type, sig); + obj text := pg_catalog.format('%s %s', type, sig); BEGIN - sql := format('ALTER EXTENSION ${extname} ADD %s', obj); + sql := pg_catalog.format('ALTER EXTENSION ${extname} ADD %s', obj); EXECUTE sql; RAISE NOTICE 'newly registered %', obj; @@ -359,7 +359,7 @@ BEGIN 'Changing ownership of function % from % to % to match ext', rec.oid::regprocedure, rec.proowner::regrole, rec.extowner::regrole; - sql := format( + sql := pg_catalog.format( 'ALTER FUNCTION %s OWNER TO %I', rec.oid::regprocedure, rec.extowner::regrole ----------------------------------------------------------------------- Summary of changes: NEWS | 3 ++- utils/create_unpackaged.pl | 6 +++--- 2 files changed, 5 insertions(+), 4 deletions(-) hooks/post-receive -- PostGIS From trac at osgeo.org Thu Mar 12 12:06:12 2026 From: trac at osgeo.org (PostGIS) Date: Thu, 12 Mar 2026 19:06:12 -0000 Subject: [PostGIS] #6054: Lock down search path during install In-Reply-To: <046.d130944804e39b7d3a159db8f685fa61@osgeo.org> References: <046.d130944804e39b7d3a159db8f685fa61@osgeo.org> Message-ID: <061.c6db124448157e68ae928d17832f41e7@osgeo.org> #6054: Lock down search path during install ----------------------+---------------------------- Reporter: robe | Owner: robe Type: defect | Status: assigned Priority: medium | Milestone: PostGIS 3.2.10 Component: install | Version: 3.2.x Resolution: | Keywords: ----------------------+---------------------------- Comment (by Paul Ramsey ): In [changeset:"1bd2c415cd830ec5e67a9c1987cbfb97aeec9c43/git" 1bd2c41/git]: {{{#!CommitTicketReference repository="git" revision="1bd2c415cd830ec5e67a9c1987cbfb97aeec9c43" Remove priv escalation scenario. Reported by Daniel Bakker References #6054 }}} -- Ticket URL: PostGIS The PostGIS Trac is used for bug, enhancement & task tracking, a user and developer wiki, and a view into the subversion code repository of PostGIS project. From git at osgeo.org Thu Mar 12 12:06:12 2026 From: git at osgeo.org (git at osgeo.org) Date: Thu, 12 Mar 2026 12:06:12 -0700 (PDT) Subject: [SCM] PostGIS branch stable-3.4 updated. 3.4.5-6-gcf26d1a4e Message-ID: <20260312190612.90C011A63F4@trac.osgeo.org> 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.4 has been updated via cf26d1a4efc3c886de779335c6662bf682e43daa (commit) via d33ee69b158bcde54ad407b5939c11442f8e2d7c (commit) from 86e45c71c55b00b62c64a51d081ffff0a896222c (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 cf26d1a4efc3c886de779335c6662bf682e43daa Author: Paul Ramsey Date: Thu Mar 12 12:02:44 2026 -0700 Remove priv escalation scenario. Reported by Daniel Bakker References #6054 diff --git a/NEWS b/NEWS index 53c688b01..385b3bd13 100644 --- a/NEWS +++ b/NEWS @@ -7,7 +7,8 @@ Proj 6.1+ required. * Bug Fixes * - #6055, Remove rare extension priv escalation case. - Reported by Sven Klemm (Tiger Data) and Allistair Ishmael Hakim (allistair.sh) + Reported by Sven Klemm (Tiger Data), Allistair Ishmael Hakim (allistair.sh) + and Daniel Bakker PostGIS 3.4.5 diff --git a/utils/create_unpackaged.pl b/utils/create_unpackaged.pl index a50725158..d505ed747 100755 --- a/utils/create_unpackaged.pl +++ b/utils/create_unpackaged.pl @@ -186,10 +186,10 @@ AS \$\$ DECLARE sql text; proc regproc; - obj text := format('%s %s', type, sig); + obj text := pg_catalog.format('%s %s', type, sig); BEGIN - sql := format('ALTER EXTENSION ${extname} ADD %s', obj); + sql := pg_catalog.format('ALTER EXTENSION ${extname} ADD %s', obj); EXECUTE sql; RAISE NOTICE 'newly registered %', obj; commit d33ee69b158bcde54ad407b5939c11442f8e2d7c Author: Paul Ramsey Date: Fri Mar 6 13:12:28 2026 -0800 Remove rare extension priv escalation case, where account with extension create privs can escalate to superuser by piggy backing on an extension creation event. From Sven Klemm (Tiger Data) and Allistair Ishmael Hakim (allistair.sh) References #6055 diff --git a/NEWS b/NEWS index 00e232b57..53c688b01 100644 --- a/NEWS +++ b/NEWS @@ -6,6 +6,8 @@ Proj 6.1+ required. * Bug Fixes * + - #6055, Remove rare extension priv escalation case. + Reported by Sven Klemm (Tiger Data) and Allistair Ishmael Hakim (allistair.sh) PostGIS 3.4.5 diff --git a/libpgcommon/sql/AddToSearchPath.sql.inc b/libpgcommon/sql/AddToSearchPath.sql.inc index a5e02279e..ff313406c 100644 --- a/libpgcommon/sql/AddToSearchPath.sql.inc +++ b/libpgcommon/sql/AddToSearchPath.sql.inc @@ -16,10 +16,10 @@ DECLARE BEGIN WITH settings AS ( SELECT unnest(setconfig) config - FROM pg_db_role_setting + FROM pg_catalog.pg_db_role_setting WHERE setdatabase = ( SELECT oid - FROM pg_database + FROM pg_catalog.pg_database WHERE datname = current_database() ) and setrole = 0 ) @@ -30,10 +30,10 @@ BEGIN RAISE NOTICE 'cur_search_path from pg_db_role_setting is %', var_cur_search_path; -- only run this test if person creating the extension is a super user - IF var_cur_search_path IS NULL AND (SELECT rolsuper FROM pg_roles where rolname = CURRENT_USER) THEN + IF var_cur_search_path IS NULL AND (SELECT rolsuper FROM pg_catalog.pg_roles where rolname = CURRENT_USER) THEN SELECT setting INTO var_cur_search_path - FROM pg_file_settings + FROM pg_catalog.pg_file_settings WHERE name = 'search_path' AND applied; RAISE NOTICE 'cur_search_path from pg_file_settings is %', var_cur_search_path; @@ -42,7 +42,7 @@ BEGIN IF var_cur_search_path IS NULL THEN SELECT boot_val INTO var_cur_search_path - FROM pg_settings + FROM pg_catalog.pg_settings WHERE name = 'search_path'; RAISE NOTICE 'cur_search_path from pg_settings is %', var_cur_search_path; @@ -63,7 +63,8 @@ BEGIN RETURN var_result; END $BODY$ -SET search_path = pg_catalog -- make safe +-- explicitly move pg_temp after pg_catalog in search path +SET search_path = pg_catalog, pg_temp LANGUAGE 'plpgsql' VOLATILE STRICT ; ----------------------------------------------------------------------- Summary of changes: NEWS | 3 +++ libpgcommon/sql/AddToSearchPath.sql.inc | 13 +++++++------ utils/create_unpackaged.pl | 4 ++-- 3 files changed, 12 insertions(+), 8 deletions(-) hooks/post-receive -- PostGIS From git at osgeo.org Thu Mar 12 12:06:13 2026 From: git at osgeo.org (git at osgeo.org) Date: Thu, 12 Mar 2026 12:06:13 -0700 (PDT) Subject: [SCM] PostGIS branch stable-3.3 updated. 3.3.9-5-ge64883525 Message-ID: <20260312190614.02B631A6833@trac.osgeo.org> 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.3 has been updated via e648835255fc4de9e838bb1a4a0fe97423ad1269 (commit) from 9562c2020b0ecac01cec2d7877666425b41e81a8 (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 e648835255fc4de9e838bb1a4a0fe97423ad1269 Author: Paul Ramsey Date: Thu Mar 12 12:03:36 2026 -0700 Remove priv escalation scenario. Reported by Daniel Bakker References #6054 diff --git a/NEWS b/NEWS index 95563125a..f3cfc3eb3 100644 --- a/NEWS +++ b/NEWS @@ -6,7 +6,8 @@ PostGIS 3.3.10 - #5998, [tiger_geododer] Do not create tiger_data as part of postgis_tiger_geocoder extension, create/update (Regina Obe) - #6055, Remove rare extension priv escalation case. - Reported by Sven Klemm (Tiger Data) and Allistair Ishmael Hakim (allistair.sh) + Reported by Sven Klemm (Tiger Data), Allistair Ishmael Hakim (allistair.sh) + and Daniel Bakker PostGIS 3.3.9 diff --git a/utils/create_unpackaged.pl b/utils/create_unpackaged.pl index a50725158..d505ed747 100755 --- a/utils/create_unpackaged.pl +++ b/utils/create_unpackaged.pl @@ -186,10 +186,10 @@ AS \$\$ DECLARE sql text; proc regproc; - obj text := format('%s %s', type, sig); + obj text := pg_catalog.format('%s %s', type, sig); BEGIN - sql := format('ALTER EXTENSION ${extname} ADD %s', obj); + sql := pg_catalog.format('ALTER EXTENSION ${extname} ADD %s', obj); EXECUTE sql; RAISE NOTICE 'newly registered %', obj; ----------------------------------------------------------------------- Summary of changes: NEWS | 3 ++- utils/create_unpackaged.pl | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) hooks/post-receive -- PostGIS From trac at osgeo.org Thu Mar 12 12:06:14 2026 From: trac at osgeo.org (PostGIS) Date: Thu, 12 Mar 2026 19:06:14 -0000 Subject: [PostGIS] #6055: Specify search_path carefully during extension install In-Reply-To: <049.b6be645ea57dbb71051ae75581b93595@osgeo.org> References: <049.b6be645ea57dbb71051ae75581b93595@osgeo.org> Message-ID: <064.15a3a3f6e259263ab4906fa1733ffa09@osgeo.org> #6055: Specify search_path carefully during extension install ----------------------+--------------------------- Reporter: pramsey | Owner: pramsey Type: defect | Status: closed Priority: high | Milestone: PostGIS 3.6.2 Component: postgis | Version: 3.2.x Resolution: fixed | Keywords: ----------------------+--------------------------- Comment (by Paul Ramsey ): In [changeset:"d33ee69b158bcde54ad407b5939c11442f8e2d7c/git" d33ee69b/git]: {{{#!CommitTicketReference repository="git" revision="d33ee69b158bcde54ad407b5939c11442f8e2d7c" Remove rare extension priv escalation case, where account with extension create privs can escalate to superuser by piggy backing on an extension creation event. From Sven Klemm (Tiger Data) and Allistair Ishmael Hakim (allistair.sh) References #6055 }}} -- Ticket URL: PostGIS The PostGIS Trac is used for bug, enhancement & task tracking, a user and developer wiki, and a view into the subversion code repository of PostGIS project. From trac at osgeo.org Thu Mar 12 12:06:14 2026 From: trac at osgeo.org (PostGIS) Date: Thu, 12 Mar 2026 19:06:14 -0000 Subject: [PostGIS] #6054: Lock down search path during install In-Reply-To: <046.d130944804e39b7d3a159db8f685fa61@osgeo.org> References: <046.d130944804e39b7d3a159db8f685fa61@osgeo.org> Message-ID: <061.55150d4ea3aeb880d79b3aa3f915a0c6@osgeo.org> #6054: Lock down search path during install ----------------------+---------------------------- Reporter: robe | Owner: robe Type: defect | Status: assigned Priority: medium | Milestone: PostGIS 3.2.10 Component: install | Version: 3.2.x Resolution: | Keywords: ----------------------+---------------------------- Comment (by Paul Ramsey ): In [changeset:"cf26d1a4efc3c886de779335c6662bf682e43daa/git" cf26d1a/git]: {{{#!CommitTicketReference repository="git" revision="cf26d1a4efc3c886de779335c6662bf682e43daa" Remove priv escalation scenario. Reported by Daniel Bakker References #6054 }}} -- Ticket URL: PostGIS The PostGIS Trac is used for bug, enhancement & task tracking, a user and developer wiki, and a view into the subversion code repository of PostGIS project. From trac at osgeo.org Thu Mar 12 12:06:15 2026 From: trac at osgeo.org (PostGIS) Date: Thu, 12 Mar 2026 19:06:15 -0000 Subject: [PostGIS] #6054: Lock down search path during install In-Reply-To: <046.d130944804e39b7d3a159db8f685fa61@osgeo.org> References: <046.d130944804e39b7d3a159db8f685fa61@osgeo.org> Message-ID: <061.a61a64fef882c38ad404f1785dcd22ff@osgeo.org> #6054: Lock down search path during install ----------------------+---------------------------- Reporter: robe | Owner: robe Type: defect | Status: assigned Priority: medium | Milestone: PostGIS 3.2.10 Component: install | Version: 3.2.x Resolution: | Keywords: ----------------------+---------------------------- Comment (by Paul Ramsey ): In [changeset:"e648835255fc4de9e838bb1a4a0fe97423ad1269/git" e6488352/git]: {{{#!CommitTicketReference repository="git" revision="e648835255fc4de9e838bb1a4a0fe97423ad1269" Remove priv escalation scenario. Reported by Daniel Bakker References #6054 }}} -- Ticket URL: PostGIS The PostGIS Trac is used for bug, enhancement & task tracking, a user and developer wiki, and a view into the subversion code repository of PostGIS project. From git at osgeo.org Thu Mar 12 12:06:15 2026 From: git at osgeo.org (git at osgeo.org) Date: Thu, 12 Mar 2026 12:06:15 -0700 (PDT) Subject: [SCM] PostGIS branch stable-3.2 updated. 3.2.9-3-g2396083a5 Message-ID: <20260312190615.C8A991A6D82@trac.osgeo.org> 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.2 has been updated via 2396083a5445169d4db8095722f23df711e71b19 (commit) from 9bed75f7f186dfa4f60039d68103a73c91a69b8e (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 2396083a5445169d4db8095722f23df711e71b19 Author: Paul Ramsey Date: Thu Mar 12 12:04:34 2026 -0700 Remove priv escalation scenario. Reported by Daniel Bakker References #6054 diff --git a/NEWS b/NEWS index 99442f6b4..04a241768 100644 --- a/NEWS +++ b/NEWS @@ -8,6 +8,8 @@ Proj 4.9+ required. - #5998, [tiger_geododer] Do not create tiger_data as part of postgis_tiger_geocoder extension, create/update (Regina Obe) + - #6054, Remove priv escalation scenario. Reported by Daniel Bakker + PostGIS 3.2.9 2026/02/08 diff --git a/utils/create_unpackaged.pl b/utils/create_unpackaged.pl index a50725158..d505ed747 100755 --- a/utils/create_unpackaged.pl +++ b/utils/create_unpackaged.pl @@ -186,10 +186,10 @@ AS \$\$ DECLARE sql text; proc regproc; - obj text := format('%s %s', type, sig); + obj text := pg_catalog.format('%s %s', type, sig); BEGIN - sql := format('ALTER EXTENSION ${extname} ADD %s', obj); + sql := pg_catalog.format('ALTER EXTENSION ${extname} ADD %s', obj); EXECUTE sql; RAISE NOTICE 'newly registered %', obj; ----------------------------------------------------------------------- Summary of changes: NEWS | 2 ++ utils/create_unpackaged.pl | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) hooks/post-receive -- PostGIS From trac at osgeo.org Thu Mar 12 12:06:17 2026 From: trac at osgeo.org (PostGIS) Date: Thu, 12 Mar 2026 19:06:17 -0000 Subject: [PostGIS] #6054: Lock down search path during install In-Reply-To: <046.d130944804e39b7d3a159db8f685fa61@osgeo.org> References: <046.d130944804e39b7d3a159db8f685fa61@osgeo.org> Message-ID: <061.ced293aa314b09739ad5d5de4d7fc7fb@osgeo.org> #6054: Lock down search path during install ----------------------+---------------------------- Reporter: robe | Owner: robe Type: defect | Status: assigned Priority: medium | Milestone: PostGIS 3.2.10 Component: install | Version: 3.2.x Resolution: | Keywords: ----------------------+---------------------------- Comment (by Paul Ramsey ): In [changeset:"2396083a5445169d4db8095722f23df711e71b19/git" 2396083/git]: {{{#!CommitTicketReference repository="git" revision="2396083a5445169d4db8095722f23df711e71b19" Remove priv escalation scenario. Reported by Daniel Bakker References #6054 }}} -- Ticket URL: PostGIS The PostGIS Trac is used for bug, enhancement & task tracking, a user and developer wiki, and a view into the subversion code repository of PostGIS project. From trac at osgeo.org Thu Mar 12 15:10:15 2026 From: trac at osgeo.org (PostGIS) Date: Thu, 12 Mar 2026 22:10:15 -0000 Subject: [PostGIS] #6057: Remove postgis_extension_AddToSearchPath Message-ID: <049.9ab2c7a5b0db3ab355b4fd09c0bd8107@osgeo.org> #6057: Remove postgis_extension_AddToSearchPath ----------------------------+--------------------------- Reporter: pramsey | Owner: robe Type: defect | Status: assigned Priority: blocker | Milestone: PostGIS 3.7.0 Component: tiger geocoder | Version: master Keywords: | ----------------------------+--------------------------- When the tiger geocoder is extracted from postgis, remove all trace of the postgis_extension_AddToSearchPath function from the build. It is only used by tiger and is the locus of some security concerns. -- Ticket URL: PostGIS The PostGIS Trac is used for bug, enhancement & task tracking, a user and developer wiki, and a view into the subversion code repository of PostGIS project. From git at osgeo.org Thu Mar 12 15:19:58 2026 From: git at osgeo.org (git at osgeo.org) Date: Thu, 12 Mar 2026 15:19:58 -0700 (PDT) Subject: [SCM] PostGIS branch master updated. 3.6.0rc2-390-g419c29443 Message-ID: <20260312221959.1DD561A0875@trac.osgeo.org> 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 419c294431361ab9a15a497c23ab54f1d546aa1b (commit) from 379a6998ac744150a7d9fbacaf153b6b951d3903 (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 419c294431361ab9a15a497c23ab54f1d546aa1b Author: Sandro Santilli Date: Thu Mar 12 23:18:56 2026 +0100 Revert "Disable topology testing on bessie until regressions fixed" This reverts commit 1a44e0fdca9141e7e5c844ec4b537015219b4be9 as the regression could have been fixed by commit 14152529d3f3008be89dbc76505521e819ae78d5 diff --git a/ci/bessie/postgis_regress.sh b/ci/bessie/postgis_regress.sh index 18d5fdf5a..bec7bb73b 100644 --- a/ci/bessie/postgis_regress.sh +++ b/ci/bessie/postgis_regress.sh @@ -8,8 +8,7 @@ sh autogen.sh ./configure \ --with-projdir=/usr/local \ --with-libiconv=/usr/local \ - --with-library-minor-version \ - --without-topology + --with-library-minor-version #make distclean make export PGUSER=postgres ----------------------------------------------------------------------- Summary of changes: ci/bessie/postgis_regress.sh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) hooks/post-receive -- PostGIS From git at osgeo.org Thu Mar 12 21:30:16 2026 From: git at osgeo.org (git at osgeo.org) Date: Thu, 12 Mar 2026 21:30:16 -0700 (PDT) Subject: [SCM] PostGIS branch master updated. 3.6.0rc2-391-gfdb442fb8 Message-ID: <20260313043016.580451A1152@trac.osgeo.org> 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 fdb442fb88c0d413598e090cc00662aa0863efae (commit) from 419c294431361ab9a15a497c23ab54f1d546aa1b (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 fdb442fb88c0d413598e090cc00662aa0863efae Author: Regina Obe Date: Fri Mar 13 00:30:11 2026 -0400 WINNIE packaging fix: Don't search for dlls in extension folder diff --git a/ci/winnie/package_postgis.sh b/ci/winnie/package_postgis.sh index c706d7a75..1c8857626 100644 --- a/ci/winnie/package_postgis.sh +++ b/ci/winnie/package_postgis.sh @@ -187,7 +187,7 @@ done #cp ${PGPATH}/share/extension/postgis*${POSTGIS_MICRO_VER}next.sql ${RELDIR}/${RELVERDIR}/share/extension cp -r extensions/*/*.control ${RELDIR}/${RELVERDIR}/share/extension -cp -r extensions/*/*.dll ${RELDIR}/${RELVERDIR}/lib +#cp -r extensions/*/*.dll ${RELDIR}/${RELVERDIR}/lib #cp extensions/postgis_topology/sql/* ${RELDIR}/${RELVERDIR}/share/extension #cp extensions/postgis_topology/*.control ${RELDIR}/${RELVERDIR}/share/extension cp -r ${RELDIR}/packaging_notes/* ${RELDIR}/${RELVERDIR}/ ----------------------------------------------------------------------- Summary of changes: ci/winnie/package_postgis.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) hooks/post-receive -- PostGIS From git at osgeo.org Thu Mar 12 21:36:47 2026 From: git at osgeo.org (git at osgeo.org) Date: Thu, 12 Mar 2026 21:36:47 -0700 (PDT) Subject: [SCM] PostGIS branch master updated. 3.6.0rc2-392-gcf897cf35 Message-ID: <20260313043647.865481A7BEC@trac.osgeo.org> 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 cf897cf35d100480c80e20e07f2784d5accea5ec (commit) from fdb442fb88c0d413598e090cc00662aa0863efae (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 cf897cf35d100480c80e20e07f2784d5accea5ec Author: Regina Obe Date: Fri Mar 13 00:36:01 2026 -0400 Put back pagc gaz tables and pagc normalize addy function for create extension postgis_tiger_geocoder diff --git a/extensions/postgis_tiger_geocoder/Makefile.in b/extensions/postgis_tiger_geocoder/Makefile.in index ee6875577..e064d6f0b 100644 --- a/extensions/postgis_tiger_geocoder/Makefile.in +++ b/extensions/postgis_tiger_geocoder/Makefile.in @@ -168,6 +168,8 @@ sql/tiger_geocoder.sql.in: sql_bits/norm_addy_create.sql.in \ ../../extras/tiger_geocoder/normalize/location_extract.sql \ ../../extras/tiger_geocoder/normalize/normalize_address.sql \ ../../extras/tiger_geocoder/normalize/pprint_addy.sql \ + ../../extras/tiger_geocoder/pagc_normalize/pagc_tables.sql \ + ../../extras/tiger_geocoder/pagc_normalize/pagc_normalize_address.sql \ ../../extras/tiger_geocoder/geocode/other_helper_functions.sql \ ../../extras/tiger_geocoder/geocode/rate_attributes.sql \ ../../extras/tiger_geocoder/geocode/includes_address.sql \ ----------------------------------------------------------------------- Summary of changes: extensions/postgis_tiger_geocoder/Makefile.in | 2 ++ 1 file changed, 2 insertions(+) hooks/post-receive -- PostGIS From trac at osgeo.org Fri Mar 13 02:14:56 2026 From: trac at osgeo.org (PostGIS) Date: Fri, 13 Mar 2026 09:14:56 -0000 Subject: [PostGIS] #6056: Woodie will be moved to osgeo10 In-Reply-To: <046.6b3dd0406746a94e9ebd6d7e910d7486@osgeo.org> References: <046.6b3dd0406746a94e9ebd6d7e910d7486@osgeo.org> Message-ID: <061.b0a003744e32e1b2e53b8901f0a7191a@osgeo.org> #6056: Woodie will be moved to osgeo10 ---------------------------+-------------------------------------- Reporter: robe | Owner: robe Type: defect | Status: closed Priority: medium | Milestone: Website Management, Bots Component: QA/buildbots | Version: 3.5.x Resolution: fixed | Keywords: ---------------------------+-------------------------------------- Changes (by robe): * resolution: => fixed * status: new => closed -- Ticket URL: PostGIS The PostGIS Trac is used for bug, enhancement & task tracking, a user and developer wiki, and a view into the subversion code repository of PostGIS project. From git at osgeo.org Sat Mar 14 09:58:50 2026 From: git at osgeo.org (git at osgeo.org) Date: Sat, 14 Mar 2026 09:58:50 -0700 (PDT) Subject: [SCM] PostGIS branch master updated. 3.6.0rc2-393-g7c18321e1 Message-ID: <20260314165850.8E9031AF3F7@trac.osgeo.org> 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 7c18321e17bfba6d24600e39d11271616ae71124 (commit) from cf897cf35d100480c80e20e07f2784d5accea5ec (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 7c18321e17bfba6d24600e39d11271616ae71124 Author: Paul Ramsey Date: Fri Mar 13 08:24:55 2026 -0700 Remove unused extension helper functions from topology upgrade scripts diff --git a/extensions/postgis_topology/Makefile.in b/extensions/postgis_topology/Makefile.in index 0bc04fc56..ccd8472b3 100644 --- a/extensions/postgis_topology/Makefile.in +++ b/extensions/postgis_topology/Makefile.in @@ -41,10 +41,8 @@ DATA_built = \ # NOTE: order matters EXTENSION_UPGRADE_SCRIPTS = \ extlock.sql \ - ../postgis_extension_helper.sql \ sql/topology_upgrade.sql \ - sql_bits/mark_editable_objects.sql.in \ - ../postgis_extension_helper_uninstall.sql + sql_bits/mark_editable_objects.sql.in EXTRA_CLEAN = sql/ ----------------------------------------------------------------------- Summary of changes: extensions/postgis_topology/Makefile.in | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) hooks/post-receive -- PostGIS From git at osgeo.org Mon Mar 16 03:09:17 2026 From: git at osgeo.org (git at osgeo.org) Date: Mon, 16 Mar 2026 03:09:17 -0700 (PDT) Subject: [SCM] postgis.net branch website updated. clarity-final-180-g8f687a2 Message-ID: <20260316100917.739A61B5A22@trac.osgeo.org> 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.net". The branch, website has been updated via 8f687a26d24cd29558ab3d159ecf5a675d7e5fae (commit) from 3c223d1bfb08417cca4aefa1b8f565fc7d081237 (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 8f687a26d24cd29558ab3d159ecf5a675d7e5fae Author: Regina Obe Date: Mon Mar 16 06:09:09 2026 -0400 Announce the release of windows PostGIS 3.6.2 bundle diff --git a/content/documentation/getting_started/install_windows/released_versions.md b/content/documentation/getting_started/install_windows/released_versions.md index 73619da..00ed37e 100644 --- a/content/documentation/getting_started/install_windows/released_versions.md +++ b/content/documentation/getting_started/install_windows/released_versions.md @@ -1,23 +1,22 @@ --- title: Latest Released Version -date: 2025-10-05 +date: 2026-03-16 weight: 10 geekdocHidden: true geekdocHiddenTocTree: false --- -PostGIS 3.6.1 came out Nov 13th, 2025. Windows PostGIS Bundle 3.6.1 installers for PostgreSQL 13-18 was last released Nov 20th-22nd 2025. +PostGIS 3.6.2 was released Feb 6th, 2026. Windows PostGIS Bundle 3.6.2 installers for PostgreSQL 14-18 was released Mar 16th, 2026. -Binaries for versions of PostgreSQL 13-18 (64-bit) available in `Unreleased PostGIS Versions` and [OSGeo downloads][5]). Installers for 18(64-bit) available on [OSGeo downloads][5] and application stackbuilder. -Installers for PostgreSQL 13-17 will be available soon. +Binaries for versions of PostgreSQL 13-18 (64-bit) available in `Unreleased PostGIS Versions` and [OSGeo downloads][5]). Installers for 14-18(64-bit) available on [OSGeo downloads][5] and application stackbuilder. Note: This is the first release that includes pgSphere -PostGIS 3.6.1 bundle includes: +PostGIS 3.6.2 bundle includes: - * PostGIS 3.6.1 with MVT support, with raster, [GEOS](https://libgeos.org/posts/2025-08-21-geos-3-14-released/) 3.14.1, [PROJ](https://proj.org/download.html#past-releases) 8.2.1, [SFCGAL](http://sfcgal.org) support (2.2.0), address_standardizer, topology + * PostGIS 3.6.2 with MVT support, with raster, [GEOS](https://libgeos.org/posts/2025-08-21-geos-3-14-released/) 3.14.1, [PROJ](https://proj.org/download.html#past-releases) 8.2.1, [SFCGAL](http://sfcgal.org) support (2.2.0), address_standardizer, topology * PostGIS Tiger geocoder extension - Tiger 2025 - * pgRouting 4.0 [pgRouting 4.0.0](https://docs.pgrouting.org/4.0/en/index.html) + * pgRouting 4.0 [pgRouting 4.0.1](https://docs.pgrouting.org/4.0/en/index.html) * Commandline raster loader (raster2pgsql), shapefile import/export (shp2pgsql,pgsql2shp) * Commandline [osm2pgrouting 3.0.0](https://github.com/pgRouting/osm2pgrouting/tree/v3.0.0) for loading data from .osm files into pgRouting routable format * [ogrfdw 1.1.7](https://github.com/pramsey/pgsql-ogr-fdw/releases/tag/v1.1.7) - spatial foreign data wrapper for @@ -28,7 +27,7 @@ PostGIS 3.6.1 bundle includes: for querying LIDAR point cloud and in/out functions to convert to PostGIS geometry * [h3-pg](https://github.com/zachasme/h3-pg) 4.1.4 for using Uber h3 api and converting h3 index representations to postgis geometry/geography/raster (raster support is new in this release). - * [MobilityDB](https://mobilitydb.com) [v1.3.0-alpha](https://github.com/MobilityDB/MobilityDB/releases/tag/v1.3.0-alpha) + * [MobilityDB](https://mobilitydb.com) [v1.3.0rc1](https://github.com/MobilityDB/MobilityDB/releases/tag/v1.3.0rc1) for managing trajectories. Includes many temporal spatial and non-spatial types and functions and operators for them. Refer to [Enabling PostGIS Extensions: MobilityDb](../enabling_postgis/#mobilitydb) for guidance. * [pgSphere](https://github.com/postgrespro/pgsphere)[1.5.2](https://github.com/postgrespro/pgsphere/releases/tag/1.5.2) for spherical geometries. (NEW in this release) ----------------------------------------------------------------------- Summary of changes: .../getting_started/install_windows/released_versions.md | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) hooks/post-receive -- postgis.net From git at osgeo.org Mon Mar 16 13:19:54 2026 From: git at osgeo.org (git at osgeo.org) Date: Mon, 16 Mar 2026 13:19:54 -0700 (PDT) Subject: [SCM] PostGIS branch master updated. 3.6.0rc2-394-gb2b07453d Message-ID: <20260316201955.23EE21B9011@trac.osgeo.org> 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 b2b07453dcfbe5c99c3e9d841adb8fe8ab44971e (commit) from 7c18321e17bfba6d24600e39d11271616ae71124 (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 b2b07453dcfbe5c99c3e9d841adb8fe8ab44971e Author: Paul Ramsey Date: Mon Mar 16 13:19:48 2026 -0700 Build on latest Pg19 master diff --git a/postgis/flatgeobuf.c b/postgis/flatgeobuf.c index eb29f8920..ae3f8fb53 100644 --- a/postgis/flatgeobuf.c +++ b/postgis/flatgeobuf.c @@ -313,12 +313,12 @@ static void decode_properties(struct flatgeobuf_decode_ctx *ctx, Datum *values, break; } case flatgeobuf_column_type_byte: { - int8_t value; - if (offset + sizeof(int8_t) > size) + char value; + if (offset + sizeof(char) > size) elog(ERROR, "flatgeobuf: decode_properties: Invalid size for byte value"); - memcpy(&value, data + offset, sizeof(int8_t)); - values[ci] = Int8GetDatum(value); - offset += sizeof(int8_t); + memcpy(&value, data + offset, sizeof(char)); + values[ci] = CharGetDatum(value); + offset += sizeof(char); break; } case flatgeobuf_column_type_ubyte: { diff --git a/raster/rt_pg/rtpg_mapalgebra.c b/raster/rt_pg/rtpg_mapalgebra.c index bb173aa29..a97d98f0f 100644 --- a/raster/rt_pg/rtpg_mapalgebra.c +++ b/raster/rt_pg/rtpg_mapalgebra.c @@ -6568,6 +6568,7 @@ Datum RASTER_mapAlgebra2(PG_FUNCTION_ARGS) case ET_FIRST: i = 0; /* fall through */ + __attribute__((fallthrough)); case ET_SECOND: if (i > 1) i = 1; ----------------------------------------------------------------------- Summary of changes: postgis/flatgeobuf.c | 10 +++++----- raster/rt_pg/rtpg_mapalgebra.c | 1 + 2 files changed, 6 insertions(+), 5 deletions(-) hooks/post-receive -- PostGIS From git at osgeo.org Mon Mar 16 13:21:01 2026 From: git at osgeo.org (git at osgeo.org) Date: Mon, 16 Mar 2026 13:21:01 -0700 (PDT) Subject: [SCM] PostGIS branch stable-3.6 updated. 3.6.2-4-gd3171abe3 Message-ID: <20260316202101.BB43D1B972B@trac.osgeo.org> 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.6 has been updated via d3171abe3b30c898bd15e37b072fb34c3b6cc675 (commit) from 6d032d7f203aca9e77badfcc26e9c84968cd3655 (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 d3171abe3b30c898bd15e37b072fb34c3b6cc675 Author: Paul Ramsey Date: Mon Mar 16 13:20:54 2026 -0700 Build on latest Pg19 master diff --git a/postgis/flatgeobuf.c b/postgis/flatgeobuf.c index eb29f8920..ae3f8fb53 100644 --- a/postgis/flatgeobuf.c +++ b/postgis/flatgeobuf.c @@ -313,12 +313,12 @@ static void decode_properties(struct flatgeobuf_decode_ctx *ctx, Datum *values, break; } case flatgeobuf_column_type_byte: { - int8_t value; - if (offset + sizeof(int8_t) > size) + char value; + if (offset + sizeof(char) > size) elog(ERROR, "flatgeobuf: decode_properties: Invalid size for byte value"); - memcpy(&value, data + offset, sizeof(int8_t)); - values[ci] = Int8GetDatum(value); - offset += sizeof(int8_t); + memcpy(&value, data + offset, sizeof(char)); + values[ci] = CharGetDatum(value); + offset += sizeof(char); break; } case flatgeobuf_column_type_ubyte: { diff --git a/raster/rt_pg/rtpg_mapalgebra.c b/raster/rt_pg/rtpg_mapalgebra.c index c1cac17c3..e08c65975 100644 --- a/raster/rt_pg/rtpg_mapalgebra.c +++ b/raster/rt_pg/rtpg_mapalgebra.c @@ -6544,6 +6544,7 @@ Datum RASTER_mapAlgebra2(PG_FUNCTION_ARGS) case ET_FIRST: i = 0; /* fall through */ + __attribute__((fallthrough)); case ET_SECOND: if (i > 1) i = 1; ----------------------------------------------------------------------- Summary of changes: postgis/flatgeobuf.c | 10 +++++----- raster/rt_pg/rtpg_mapalgebra.c | 1 + 2 files changed, 6 insertions(+), 5 deletions(-) hooks/post-receive -- PostGIS From git at osgeo.org Mon Mar 16 18:16:39 2026 From: git at osgeo.org (git at osgeo.org) Date: Mon, 16 Mar 2026 18:16:39 -0700 (PDT) Subject: [SCM] PostGIS branch master updated. 3.6.0rc2-395-ge27a0d0ba Message-ID: <20260317011639.CEAF91B8BA7@trac.osgeo.org> 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 e27a0d0ba496937ed6676ac7e84e76b821a6b172 (commit) from b2b07453dcfbe5c99c3e9d841adb8fe8ab44971e (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 e27a0d0ba496937ed6676ac7e84e76b821a6b172 Author: Teramoto Ikuhiro Date: Tue Mar 17 00:16:44 2026 +0000 Translated PostGIS Manual using Weblate (Japanese) Currently translated at 99.9% (5888 of 5893 strings) Translation: postgis/PostGIS Manual Translate-URL: https://weblate.osgeo.org/projects/postgis/postgis-manual/ja/ diff --git a/doc/po/ja/postgis-manual.po b/doc/po/ja/postgis-manual.po index b512408b0..9815baf0c 100644 --- a/doc/po/ja/postgis-manual.po +++ b/doc/po/ja/postgis-manual.po @@ -10,7 +10,7 @@ msgstr "" "Project-Id-Version: postgis 3.5\n" "Report-Msgid-Bugs-To: https://bugs.kde.org\n" "POT-Creation-Date: 2025-11-13 16:23+0000\n" -"PO-Revision-Date: 2026-03-05 01:51+0000\n" +"PO-Revision-Date: 2026-03-17 01:16+0000\n" "Last-Translator: Teramoto Ikuhiro \n" "Language-Team: Japanese \n" @@ -19,7 +19,7 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=1; plural=0;\n" -"X-Generator: Weblate 5.16.1\n" +"X-Generator: Weblate 5.16.2\n" #. Tag: chapter #, no-c-format @@ -9059,7 +9059,7 @@ msgstr "" "??????????" #. Tag: para -#, fuzzy, no-c-format +#, no-c-format msgid "" "Currently, the make check relies on the PATH " "and PGPORT environment variables when performing the checks - " @@ -9069,12 +9069,12 @@ msgid "" "installation during configuration or be prepared to deal with the impending " "headaches." msgstr "" -"??????make check??????????? ???" -"?PATH?PGPORT????????" -"????????????????--with-pgconfig?????" -"???PostgreSQL????????PATH??????" +"??????make check???????????????" +"PATH?PGPORT??????????????????????" +"??PostgreSQL???????????--with-" +"pgconfig??????????????????PATH??????" "??????????????????PostgreSQL???????????????" -"????????????????????????????" +"????????????????????????????????" #. Tag: para #, no-c-format @@ -34890,14 +34890,15 @@ msgstr "" "Arguments\" (??: ??????????????SQL???)??????????" #. Tag: para -#, fuzzy, no-c-format +#, no-c-format msgid "" "The text[] argument to the callbackfunc is " "required, regardless of whether you choose to pass any arguments to the " "callback function for processing or not." msgstr "" -"callbackfunc??text[]???????????" -"??????????????????????????????????" +"text[]???callbackfunc?????????" +"??????????????????????????????????????" +"????" #. Tag: para #, no-c-format ----------------------------------------------------------------------- Summary of changes: doc/po/ja/postgis-manual.po | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) hooks/post-receive -- PostGIS From git at osgeo.org Tue Mar 17 13:12:18 2026 From: git at osgeo.org (git at osgeo.org) Date: Tue, 17 Mar 2026 13:12:18 -0700 (PDT) Subject: [SCM] PostGIS branch stable-3.6 updated. 3.6.2-5-g4d03e7a84 Message-ID: <20260317201218.EC3371BCEEF@trac.osgeo.org> 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.6 has been updated via 4d03e7a845341dcbc3a2606dc7439d6f9a378b84 (commit) from d3171abe3b30c898bd15e37b072fb34c3b6cc675 (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 4d03e7a845341dcbc3a2606dc7439d6f9a378b84 Author: Paul Ramsey Date: Tue Mar 17 13:12:13 2026 -0700 Fix CI failure on Garden diff --git a/raster/rt_pg/rtpg_geometry.c b/raster/rt_pg/rtpg_geometry.c index a4059a8bc..f17a756b4 100644 --- a/raster/rt_pg/rtpg_geometry.c +++ b/raster/rt_pg/rtpg_geometry.c @@ -1573,8 +1573,8 @@ Datum RASTER_asRaster(PG_FUNCTION_ARGS) /* determine number of bands */ /* MIN macro is from GDAL's cpl_port.h */ - num_bands = MIN(pixtypes_len, values_len); - num_bands = MIN(num_bands, nodatavals_len); + num_bands = Min(pixtypes_len, values_len); + num_bands = Min(num_bands, nodatavals_len); POSTGIS_RT_DEBUGF(3, "RASTER_asRaster: pixtypes_len = %d", pixtypes_len); POSTGIS_RT_DEBUGF(3, "RASTER_asRaster: values_len = %d", values_len); POSTGIS_RT_DEBUGF(3, "RASTER_asRaster: nodatavals_len = %d", nodatavals_len); ----------------------------------------------------------------------- Summary of changes: raster/rt_pg/rtpg_geometry.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) hooks/post-receive -- PostGIS From git at osgeo.org Tue Mar 17 13:13:41 2026 From: git at osgeo.org (git at osgeo.org) Date: Tue, 17 Mar 2026 13:13:41 -0700 (PDT) Subject: [SCM] PostGIS branch stable-3.5 updated. 3.5.5-4-ge4e72fda3 Message-ID: <20260317201341.B80F61B9C59@trac.osgeo.org> 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.5 has been updated via e4e72fda305f5a2aec43908191cb260277c87729 (commit) from 1bd2c415cd830ec5e67a9c1987cbfb97aeec9c43 (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 e4e72fda305f5a2aec43908191cb260277c87729 Author: Paul Ramsey Date: Tue Mar 17 13:13:36 2026 -0700 Fix CI failure in garden diff --git a/raster/rt_pg/rtpg_geometry.c b/raster/rt_pg/rtpg_geometry.c index a4059a8bc..f17a756b4 100644 --- a/raster/rt_pg/rtpg_geometry.c +++ b/raster/rt_pg/rtpg_geometry.c @@ -1573,8 +1573,8 @@ Datum RASTER_asRaster(PG_FUNCTION_ARGS) /* determine number of bands */ /* MIN macro is from GDAL's cpl_port.h */ - num_bands = MIN(pixtypes_len, values_len); - num_bands = MIN(num_bands, nodatavals_len); + num_bands = Min(pixtypes_len, values_len); + num_bands = Min(num_bands, nodatavals_len); POSTGIS_RT_DEBUGF(3, "RASTER_asRaster: pixtypes_len = %d", pixtypes_len); POSTGIS_RT_DEBUGF(3, "RASTER_asRaster: values_len = %d", values_len); POSTGIS_RT_DEBUGF(3, "RASTER_asRaster: nodatavals_len = %d", nodatavals_len); ----------------------------------------------------------------------- Summary of changes: raster/rt_pg/rtpg_geometry.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) hooks/post-receive -- PostGIS From git at osgeo.org Tue Mar 17 13:14:51 2026 From: git at osgeo.org (git at osgeo.org) Date: Tue, 17 Mar 2026 13:14:51 -0700 (PDT) Subject: [SCM] PostGIS branch stable-3.4 updated. 3.4.5-7-gab0fa8f3f Message-ID: <20260317201451.97C031B93F9@trac.osgeo.org> 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.4 has been updated via ab0fa8f3f46eda481a0195fd786932a0fba0e847 (commit) from cf26d1a4efc3c886de779335c6662bf682e43daa (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 ab0fa8f3f46eda481a0195fd786932a0fba0e847 Author: Paul Ramsey Date: Tue Mar 17 13:14:45 2026 -0700 Fix CI failure in garden diff --git a/raster/rt_pg/rtpg_geometry.c b/raster/rt_pg/rtpg_geometry.c index a4059a8bc..5bfd62ad9 100644 --- a/raster/rt_pg/rtpg_geometry.c +++ b/raster/rt_pg/rtpg_geometry.c @@ -1572,9 +1572,8 @@ Datum RASTER_asRaster(PG_FUNCTION_ARGS) srs = NULL; /* determine number of bands */ - /* MIN macro is from GDAL's cpl_port.h */ - num_bands = MIN(pixtypes_len, values_len); - num_bands = MIN(num_bands, nodatavals_len); + num_bands = Min(pixtypes_len, values_len); + num_bands = Min(num_bands, nodatavals_len); POSTGIS_RT_DEBUGF(3, "RASTER_asRaster: pixtypes_len = %d", pixtypes_len); POSTGIS_RT_DEBUGF(3, "RASTER_asRaster: values_len = %d", values_len); POSTGIS_RT_DEBUGF(3, "RASTER_asRaster: nodatavals_len = %d", nodatavals_len); ----------------------------------------------------------------------- Summary of changes: raster/rt_pg/rtpg_geometry.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) hooks/post-receive -- PostGIS From git at osgeo.org Tue Mar 17 13:23:08 2026 From: git at osgeo.org (git at osgeo.org) Date: Tue, 17 Mar 2026 13:23:08 -0700 (PDT) Subject: [SCM] PostGIS branch master updated. 3.6.0rc2-397-g29bd2e10c Message-ID: <20260317202308.B075F1BE240@trac.osgeo.org> 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 29bd2e10c284291fd1fd386131eb88ac7b1975eb (commit) via bd08920ac3685cf31bdcb017dd77aa89dbfe07f6 (commit) from e27a0d0ba496937ed6676ac7e84e76b821a6b172 (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 29bd2e10c284291fd1fd386131eb88ac7b1975eb Merge: e27a0d0ba bd08920ac Author: Paul Ramsey Date: Tue Mar 17 13:22:59 2026 -0700 Merge branch 'a8m-master' commit bd08920ac3685cf31bdcb017dd77aa89dbfe07f6 Author: Ariel Mashraki Date: Tue Mar 17 13:41:59 2026 +0200 Use quote_identifier to build tables in pgis_tablefromflatgeobuf diff --git a/postgis/lwgeom_in_flatgeobuf.c b/postgis/lwgeom_in_flatgeobuf.c index 8435cd14e..97ed26b16 100644 --- a/postgis/lwgeom_in_flatgeobuf.c +++ b/postgis/lwgeom_in_flatgeobuf.c @@ -75,13 +75,9 @@ Datum pgis_tablefromflatgeobuf(PG_FUNCTION_ARGS) char *schema; text *table_input; char *table; - char *format; - char *sql; bytea *data; uint16_t i; - char **column_defs; - size_t column_defs_total_len; - char *column_defs_str; + StringInfoData sql; if (PG_ARGISNULL(0)) PG_RETURN_NULL(); @@ -107,48 +103,34 @@ Datum pgis_tablefromflatgeobuf(PG_FUNCTION_ARGS) flatgeobuf_check_magicbytes(ctx); flatgeobuf_decode_header(ctx->ctx); - column_defs = palloc(sizeof(char *) * ctx->ctx->columns_size); - column_defs_total_len = 0; + initStringInfo(&sql); + appendStringInfo(&sql, "create table %s.%s (id int, geom geometry", + quote_identifier(schema), quote_identifier(table)); + POSTGIS_DEBUGF(2, "found %d columns", ctx->ctx->columns_size); for (i = 0; i < ctx->ctx->columns_size; i++) { flatgeobuf_column *column = ctx->ctx->columns[i]; const char *name = column->name; uint8_t column_type = column->type; char *pgtype = get_pgtype(column_type); - size_t len = strlen(name) + 1 + strlen(pgtype) + 1; - column_defs[i] = palloc0(sizeof(char) * len); - strcat(column_defs[i], name); - strcat(column_defs[i], " "); - strcat(column_defs[i], pgtype); - column_defs_total_len += len; - } - column_defs_str = palloc0(sizeof(char) * column_defs_total_len + (ctx->ctx->columns_size * 2) + 2 + 1); - if (ctx->ctx->columns_size > 0) - strcat(column_defs_str, ", "); - for (i = 0; i < ctx->ctx->columns_size; i++) { - strcat(column_defs_str, column_defs[i]); - if (i < ctx->ctx->columns_size - 1) - strcat(column_defs_str, ", "); + appendStringInfo(&sql, ", %s %s", quote_identifier(name), pgtype); } - POSTGIS_DEBUGF(2, "column_defs_str %s", column_defs_str); + appendStringInfoChar(&sql, ')'); - format = "create table %s.%s (id int, geom geometry%s)"; - sql = palloc0(strlen(format) + strlen(schema) + strlen(table) + strlen(column_defs_str) + 1); - - sprintf(sql, format, schema, table, column_defs_str); - - POSTGIS_DEBUGF(3, "sql: %s", sql); + POSTGIS_DEBUGF(3, "sql: %s", sql.data); if (SPI_connect() != SPI_OK_CONNECT) elog(ERROR, "Failed to connect SPI"); - if (SPI_execute(sql, false, 0) != SPI_OK_UTILITY) + if (SPI_execute(sql.data, false, 0) != SPI_OK_UTILITY) elog(ERROR, "Failed to create table"); if (SPI_finish() != SPI_OK_FINISH) elog(ERROR, "Failed to finish SPI"); + pfree(sql.data); + POSTGIS_DEBUG(3, "finished"); PG_RETURN_NULL(); diff --git a/regress/core/flatgeobuf.sql b/regress/core/flatgeobuf.sql index 10a535bc2..df46eca1e 100644 --- a/regress/core/flatgeobuf.sql +++ b/regress/core/flatgeobuf.sql @@ -158,6 +158,26 @@ select 'E1', id, bool_1, ST_AsText(geom), bool_2 from ST_FromFlatGeobuf(null::fl ) q) ); +select '--- Quoted identifiers ---'; + +-- Verify that special characters in column names are properly quoted +select ST_FromFlatGeobufToTable('public', 'flatgeobuf_qi', ( + select ST_AsFlatGeobuf(q) from ( + select null::geometry, null::text as "col name; with special--chars" + ) q +)); +select 'QI1' where exists ( + select 1 from information_schema.columns + where table_schema = 'public' + and table_name = 'flatgeobuf_qi' + and column_name = 'col name; with special--chars' +); +select 'QI2' where exists ( + select 1 from information_schema.tables + where table_schema = 'public' and table_name = 'flatgeobuf_t1' +); + drop table if exists public.flatgeobuf_t1; drop table if exists public.flatgeobuf_a1; drop table if exists public.flatgeobuf_e1; +drop table if exists public.flatgeobuf_qi; diff --git a/regress/core/flatgeobuf_expected b/regress/core/flatgeobuf_expected index 61c617de3..c93738ff9 100644 --- a/regress/core/flatgeobuf_expected +++ b/regress/core/flatgeobuf_expected @@ -24,3 +24,6 @@ ERROR: mixed geometry type is not supported A1|0||t|1|2|3|4|1.2|1.3|2016-06-23 03:44:52.134125+00|hello --- Exotic roundtrips --- E1|0|t|POINT(1.1 2.1)|f +--- Quoted identifiers --- +QI1 +QI2 ----------------------------------------------------------------------- Summary of changes: postgis/lwgeom_in_flatgeobuf.c | 40 +++++++++++----------------------------- regress/core/flatgeobuf.sql | 20 ++++++++++++++++++++ regress/core/flatgeobuf_expected | 3 +++ 3 files changed, 34 insertions(+), 29 deletions(-) hooks/post-receive -- PostGIS From git at osgeo.org Tue Mar 17 13:25:41 2026 From: git at osgeo.org (git at osgeo.org) Date: Tue, 17 Mar 2026 13:25:41 -0700 (PDT) Subject: [SCM] PostGIS branch stable-3.6 updated. 3.6.2-7-ge5be73640 Message-ID: <20260317202541.7ABB41BEA77@trac.osgeo.org> 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.6 has been updated via e5be73640efdd333ed6358c442233d269f2dbc5f (commit) via 87e77f3e5b78585cb764fe72893ba6a826e4fc1e (commit) from 4d03e7a845341dcbc3a2606dc7439d6f9a378b84 (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 e5be73640efdd333ed6358c442233d269f2dbc5f Author: Paul Ramsey Date: Tue Mar 17 13:25:33 2026 -0700 NEWS item for GH-850 diff --git a/NEWS b/NEWS index ab8ac0c4e..6c776454a 100644 --- a/NEWS +++ b/NEWS @@ -18,6 +18,7 @@ topogeometry corruption: - #6055, Remove rare extension priv escalation case. Reported by Sven Klemm (Tiger Data), Allistair Ishmael Hakim (allistair.sh) and Daniel Bakker +- GH-850 Use quote_identifier to build tables in pgis_tablefromflatgeobuf (Ariel Mashraki) PostGIS 3.6.2 commit 87e77f3e5b78585cb764fe72893ba6a826e4fc1e Author: Ariel Mashraki Date: Tue Mar 17 13:41:59 2026 +0200 Use quote_identifier to build tables in pgis_tablefromflatgeobuf diff --git a/postgis/lwgeom_in_flatgeobuf.c b/postgis/lwgeom_in_flatgeobuf.c index 8435cd14e..97ed26b16 100644 --- a/postgis/lwgeom_in_flatgeobuf.c +++ b/postgis/lwgeom_in_flatgeobuf.c @@ -75,13 +75,9 @@ Datum pgis_tablefromflatgeobuf(PG_FUNCTION_ARGS) char *schema; text *table_input; char *table; - char *format; - char *sql; bytea *data; uint16_t i; - char **column_defs; - size_t column_defs_total_len; - char *column_defs_str; + StringInfoData sql; if (PG_ARGISNULL(0)) PG_RETURN_NULL(); @@ -107,48 +103,34 @@ Datum pgis_tablefromflatgeobuf(PG_FUNCTION_ARGS) flatgeobuf_check_magicbytes(ctx); flatgeobuf_decode_header(ctx->ctx); - column_defs = palloc(sizeof(char *) * ctx->ctx->columns_size); - column_defs_total_len = 0; + initStringInfo(&sql); + appendStringInfo(&sql, "create table %s.%s (id int, geom geometry", + quote_identifier(schema), quote_identifier(table)); + POSTGIS_DEBUGF(2, "found %d columns", ctx->ctx->columns_size); for (i = 0; i < ctx->ctx->columns_size; i++) { flatgeobuf_column *column = ctx->ctx->columns[i]; const char *name = column->name; uint8_t column_type = column->type; char *pgtype = get_pgtype(column_type); - size_t len = strlen(name) + 1 + strlen(pgtype) + 1; - column_defs[i] = palloc0(sizeof(char) * len); - strcat(column_defs[i], name); - strcat(column_defs[i], " "); - strcat(column_defs[i], pgtype); - column_defs_total_len += len; - } - column_defs_str = palloc0(sizeof(char) * column_defs_total_len + (ctx->ctx->columns_size * 2) + 2 + 1); - if (ctx->ctx->columns_size > 0) - strcat(column_defs_str, ", "); - for (i = 0; i < ctx->ctx->columns_size; i++) { - strcat(column_defs_str, column_defs[i]); - if (i < ctx->ctx->columns_size - 1) - strcat(column_defs_str, ", "); + appendStringInfo(&sql, ", %s %s", quote_identifier(name), pgtype); } - POSTGIS_DEBUGF(2, "column_defs_str %s", column_defs_str); + appendStringInfoChar(&sql, ')'); - format = "create table %s.%s (id int, geom geometry%s)"; - sql = palloc0(strlen(format) + strlen(schema) + strlen(table) + strlen(column_defs_str) + 1); - - sprintf(sql, format, schema, table, column_defs_str); - - POSTGIS_DEBUGF(3, "sql: %s", sql); + POSTGIS_DEBUGF(3, "sql: %s", sql.data); if (SPI_connect() != SPI_OK_CONNECT) elog(ERROR, "Failed to connect SPI"); - if (SPI_execute(sql, false, 0) != SPI_OK_UTILITY) + if (SPI_execute(sql.data, false, 0) != SPI_OK_UTILITY) elog(ERROR, "Failed to create table"); if (SPI_finish() != SPI_OK_FINISH) elog(ERROR, "Failed to finish SPI"); + pfree(sql.data); + POSTGIS_DEBUG(3, "finished"); PG_RETURN_NULL(); diff --git a/regress/core/flatgeobuf.sql b/regress/core/flatgeobuf.sql index 10a535bc2..df46eca1e 100644 --- a/regress/core/flatgeobuf.sql +++ b/regress/core/flatgeobuf.sql @@ -158,6 +158,26 @@ select 'E1', id, bool_1, ST_AsText(geom), bool_2 from ST_FromFlatGeobuf(null::fl ) q) ); +select '--- Quoted identifiers ---'; + +-- Verify that special characters in column names are properly quoted +select ST_FromFlatGeobufToTable('public', 'flatgeobuf_qi', ( + select ST_AsFlatGeobuf(q) from ( + select null::geometry, null::text as "col name; with special--chars" + ) q +)); +select 'QI1' where exists ( + select 1 from information_schema.columns + where table_schema = 'public' + and table_name = 'flatgeobuf_qi' + and column_name = 'col name; with special--chars' +); +select 'QI2' where exists ( + select 1 from information_schema.tables + where table_schema = 'public' and table_name = 'flatgeobuf_t1' +); + drop table if exists public.flatgeobuf_t1; drop table if exists public.flatgeobuf_a1; drop table if exists public.flatgeobuf_e1; +drop table if exists public.flatgeobuf_qi; diff --git a/regress/core/flatgeobuf_expected b/regress/core/flatgeobuf_expected index 61c617de3..c93738ff9 100644 --- a/regress/core/flatgeobuf_expected +++ b/regress/core/flatgeobuf_expected @@ -24,3 +24,6 @@ ERROR: mixed geometry type is not supported A1|0||t|1|2|3|4|1.2|1.3|2016-06-23 03:44:52.134125+00|hello --- Exotic roundtrips --- E1|0|t|POINT(1.1 2.1)|f +--- Quoted identifiers --- +QI1 +QI2 ----------------------------------------------------------------------- Summary of changes: NEWS | 1 + postgis/lwgeom_in_flatgeobuf.c | 40 +++++++++++----------------------------- regress/core/flatgeobuf.sql | 20 ++++++++++++++++++++ regress/core/flatgeobuf_expected | 3 +++ 4 files changed, 35 insertions(+), 29 deletions(-) hooks/post-receive -- PostGIS From git at osgeo.org Tue Mar 17 13:26:58 2026 From: git at osgeo.org (git at osgeo.org) Date: Tue, 17 Mar 2026 13:26:58 -0700 (PDT) Subject: [SCM] PostGIS branch stable-3.5 updated. 3.5.5-6-g6bdb14bb6 Message-ID: <20260317202658.B165F1BE731@trac.osgeo.org> 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.5 has been updated via 6bdb14bb6657d23af50057551935aac2d101e901 (commit) via 0141017ea1728864997eccf9995cfca893066e55 (commit) from e4e72fda305f5a2aec43908191cb260277c87729 (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 6bdb14bb6657d23af50057551935aac2d101e901 Author: Paul Ramsey Date: Tue Mar 17 13:26:51 2026 -0700 News item for GH-850 diff --git a/NEWS b/NEWS index ff7816473..b7a5fe7f4 100644 --- a/NEWS +++ b/NEWS @@ -9,6 +9,7 @@ PostgreSQL 12-18 required. GEOS 3.8+ required. Proj 6.1+ required. - #6055, Remove rare extension priv escalation case. Reported by Sven Klemm (Tiger Data), Allistair Ishmael Hakim (allistair.sh) and Daniel Bakker + - GH-850 Use quote_identifier to build tables in pgis_tablefromflatgeobuf (Ariel Mashraki) PostGIS 3.5.5 commit 0141017ea1728864997eccf9995cfca893066e55 Author: Ariel Mashraki Date: Tue Mar 17 13:41:59 2026 +0200 Use quote_identifier to build tables in pgis_tablefromflatgeobuf diff --git a/postgis/lwgeom_in_flatgeobuf.c b/postgis/lwgeom_in_flatgeobuf.c index f0db9253a..ac460ff7a 100644 --- a/postgis/lwgeom_in_flatgeobuf.c +++ b/postgis/lwgeom_in_flatgeobuf.c @@ -75,13 +75,9 @@ Datum pgis_tablefromflatgeobuf(PG_FUNCTION_ARGS) char *schema; text *table_input; char *table; - char *format; - char *sql; bytea *data; uint16_t i; - char **column_defs; - size_t column_defs_total_len; - char *column_defs_str; + StringInfoData sql; if (PG_ARGISNULL(0)) PG_RETURN_NULL(); @@ -107,48 +103,34 @@ Datum pgis_tablefromflatgeobuf(PG_FUNCTION_ARGS) flatgeobuf_check_magicbytes(ctx); flatgeobuf_decode_header(ctx->ctx); - column_defs = palloc(sizeof(char *) * ctx->ctx->columns_size); - column_defs_total_len = 0; + initStringInfo(&sql); + appendStringInfo(&sql, "create table %s.%s (id int, geom geometry", + quote_identifier(schema), quote_identifier(table)); + POSTGIS_DEBUGF(2, "found %d columns", ctx->ctx->columns_size); for (i = 0; i < ctx->ctx->columns_size; i++) { flatgeobuf_column *column = ctx->ctx->columns[i]; const char *name = column->name; uint8_t column_type = column->type; char *pgtype = get_pgtype(column_type); - size_t len = strlen(name) + 1 + strlen(pgtype) + 1; - column_defs[i] = palloc0(sizeof(char) * len); - strcat(column_defs[i], name); - strcat(column_defs[i], " "); - strcat(column_defs[i], pgtype); - column_defs_total_len += len; - } - column_defs_str = palloc0(sizeof(char) * column_defs_total_len + (ctx->ctx->columns_size * 2) + 2 + 1); - if (ctx->ctx->columns_size > 0) - strcat(column_defs_str, ", "); - for (i = 0; i < ctx->ctx->columns_size; i++) { - strcat(column_defs_str, column_defs[i]); - if (i < ctx->ctx->columns_size - 1) - strcat(column_defs_str, ", "); + appendStringInfo(&sql, ", %s %s", quote_identifier(name), pgtype); } - POSTGIS_DEBUGF(2, "column_defs_str %s", column_defs_str); + appendStringInfoChar(&sql, ')'); - format = "create table %s.%s (id int, geom geometry%s)"; - sql = palloc0(strlen(format) + strlen(schema) + strlen(table) + strlen(column_defs_str) + 1); - - sprintf(sql, format, schema, table, column_defs_str); - - POSTGIS_DEBUGF(3, "sql: %s", sql); + POSTGIS_DEBUGF(3, "sql: %s", sql.data); if (SPI_connect() != SPI_OK_CONNECT) elog(ERROR, "Failed to connect SPI"); - if (SPI_execute(sql, false, 0) != SPI_OK_UTILITY) + if (SPI_execute(sql.data, false, 0) != SPI_OK_UTILITY) elog(ERROR, "Failed to create table"); if (SPI_finish() != SPI_OK_FINISH) elog(ERROR, "Failed to finish SPI"); + pfree(sql.data); + POSTGIS_DEBUG(3, "finished"); PG_RETURN_NULL(); diff --git a/regress/core/flatgeobuf.sql b/regress/core/flatgeobuf.sql index 10a535bc2..df46eca1e 100644 --- a/regress/core/flatgeobuf.sql +++ b/regress/core/flatgeobuf.sql @@ -158,6 +158,26 @@ select 'E1', id, bool_1, ST_AsText(geom), bool_2 from ST_FromFlatGeobuf(null::fl ) q) ); +select '--- Quoted identifiers ---'; + +-- Verify that special characters in column names are properly quoted +select ST_FromFlatGeobufToTable('public', 'flatgeobuf_qi', ( + select ST_AsFlatGeobuf(q) from ( + select null::geometry, null::text as "col name; with special--chars" + ) q +)); +select 'QI1' where exists ( + select 1 from information_schema.columns + where table_schema = 'public' + and table_name = 'flatgeobuf_qi' + and column_name = 'col name; with special--chars' +); +select 'QI2' where exists ( + select 1 from information_schema.tables + where table_schema = 'public' and table_name = 'flatgeobuf_t1' +); + drop table if exists public.flatgeobuf_t1; drop table if exists public.flatgeobuf_a1; drop table if exists public.flatgeobuf_e1; +drop table if exists public.flatgeobuf_qi; diff --git a/regress/core/flatgeobuf_expected b/regress/core/flatgeobuf_expected index 61c617de3..c93738ff9 100644 --- a/regress/core/flatgeobuf_expected +++ b/regress/core/flatgeobuf_expected @@ -24,3 +24,6 @@ ERROR: mixed geometry type is not supported A1|0||t|1|2|3|4|1.2|1.3|2016-06-23 03:44:52.134125+00|hello --- Exotic roundtrips --- E1|0|t|POINT(1.1 2.1)|f +--- Quoted identifiers --- +QI1 +QI2 ----------------------------------------------------------------------- Summary of changes: NEWS | 1 + postgis/lwgeom_in_flatgeobuf.c | 40 +++++++++++----------------------------- regress/core/flatgeobuf.sql | 20 ++++++++++++++++++++ regress/core/flatgeobuf_expected | 3 +++ 4 files changed, 35 insertions(+), 29 deletions(-) hooks/post-receive -- PostGIS From git at osgeo.org Tue Mar 17 13:28:01 2026 From: git at osgeo.org (git at osgeo.org) Date: Tue, 17 Mar 2026 13:28:01 -0700 (PDT) Subject: [SCM] PostGIS branch stable-3.4 updated. 3.4.5-9-g3da3457c1 Message-ID: <20260317202801.A6D491BE732@trac.osgeo.org> 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.4 has been updated via 3da3457c1ecd4cfc7cd079eb29dfdcac2d5198a8 (commit) via f788961730a29f108ea8c99a04c0a25c79973d67 (commit) from ab0fa8f3f46eda481a0195fd786932a0fba0e847 (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 3da3457c1ecd4cfc7cd079eb29dfdcac2d5198a8 Author: Paul Ramsey Date: Tue Mar 17 13:27:49 2026 -0700 News item for GH-850 diff --git a/NEWS b/NEWS index 385b3bd13..53bef2aeb 100644 --- a/NEWS +++ b/NEWS @@ -9,6 +9,7 @@ Proj 6.1+ required. - #6055, Remove rare extension priv escalation case. Reported by Sven Klemm (Tiger Data), Allistair Ishmael Hakim (allistair.sh) and Daniel Bakker + - GH-850 Use quote_identifier to build tables in pgis_tablefromflatgeobuf (Ariel Mashraki) PostGIS 3.4.5 commit f788961730a29f108ea8c99a04c0a25c79973d67 Author: Ariel Mashraki Date: Tue Mar 17 13:41:59 2026 +0200 Use quote_identifier to build tables in pgis_tablefromflatgeobuf diff --git a/postgis/lwgeom_in_flatgeobuf.c b/postgis/lwgeom_in_flatgeobuf.c index f0db9253a..ac460ff7a 100644 --- a/postgis/lwgeom_in_flatgeobuf.c +++ b/postgis/lwgeom_in_flatgeobuf.c @@ -75,13 +75,9 @@ Datum pgis_tablefromflatgeobuf(PG_FUNCTION_ARGS) char *schema; text *table_input; char *table; - char *format; - char *sql; bytea *data; uint16_t i; - char **column_defs; - size_t column_defs_total_len; - char *column_defs_str; + StringInfoData sql; if (PG_ARGISNULL(0)) PG_RETURN_NULL(); @@ -107,48 +103,34 @@ Datum pgis_tablefromflatgeobuf(PG_FUNCTION_ARGS) flatgeobuf_check_magicbytes(ctx); flatgeobuf_decode_header(ctx->ctx); - column_defs = palloc(sizeof(char *) * ctx->ctx->columns_size); - column_defs_total_len = 0; + initStringInfo(&sql); + appendStringInfo(&sql, "create table %s.%s (id int, geom geometry", + quote_identifier(schema), quote_identifier(table)); + POSTGIS_DEBUGF(2, "found %d columns", ctx->ctx->columns_size); for (i = 0; i < ctx->ctx->columns_size; i++) { flatgeobuf_column *column = ctx->ctx->columns[i]; const char *name = column->name; uint8_t column_type = column->type; char *pgtype = get_pgtype(column_type); - size_t len = strlen(name) + 1 + strlen(pgtype) + 1; - column_defs[i] = palloc0(sizeof(char) * len); - strcat(column_defs[i], name); - strcat(column_defs[i], " "); - strcat(column_defs[i], pgtype); - column_defs_total_len += len; - } - column_defs_str = palloc0(sizeof(char) * column_defs_total_len + (ctx->ctx->columns_size * 2) + 2 + 1); - if (ctx->ctx->columns_size > 0) - strcat(column_defs_str, ", "); - for (i = 0; i < ctx->ctx->columns_size; i++) { - strcat(column_defs_str, column_defs[i]); - if (i < ctx->ctx->columns_size - 1) - strcat(column_defs_str, ", "); + appendStringInfo(&sql, ", %s %s", quote_identifier(name), pgtype); } - POSTGIS_DEBUGF(2, "column_defs_str %s", column_defs_str); + appendStringInfoChar(&sql, ')'); - format = "create table %s.%s (id int, geom geometry%s)"; - sql = palloc0(strlen(format) + strlen(schema) + strlen(table) + strlen(column_defs_str) + 1); - - sprintf(sql, format, schema, table, column_defs_str); - - POSTGIS_DEBUGF(3, "sql: %s", sql); + POSTGIS_DEBUGF(3, "sql: %s", sql.data); if (SPI_connect() != SPI_OK_CONNECT) elog(ERROR, "Failed to connect SPI"); - if (SPI_execute(sql, false, 0) != SPI_OK_UTILITY) + if (SPI_execute(sql.data, false, 0) != SPI_OK_UTILITY) elog(ERROR, "Failed to create table"); if (SPI_finish() != SPI_OK_FINISH) elog(ERROR, "Failed to finish SPI"); + pfree(sql.data); + POSTGIS_DEBUG(3, "finished"); PG_RETURN_NULL(); diff --git a/regress/core/flatgeobuf.sql b/regress/core/flatgeobuf.sql index 10a535bc2..df46eca1e 100644 --- a/regress/core/flatgeobuf.sql +++ b/regress/core/flatgeobuf.sql @@ -158,6 +158,26 @@ select 'E1', id, bool_1, ST_AsText(geom), bool_2 from ST_FromFlatGeobuf(null::fl ) q) ); +select '--- Quoted identifiers ---'; + +-- Verify that special characters in column names are properly quoted +select ST_FromFlatGeobufToTable('public', 'flatgeobuf_qi', ( + select ST_AsFlatGeobuf(q) from ( + select null::geometry, null::text as "col name; with special--chars" + ) q +)); +select 'QI1' where exists ( + select 1 from information_schema.columns + where table_schema = 'public' + and table_name = 'flatgeobuf_qi' + and column_name = 'col name; with special--chars' +); +select 'QI2' where exists ( + select 1 from information_schema.tables + where table_schema = 'public' and table_name = 'flatgeobuf_t1' +); + drop table if exists public.flatgeobuf_t1; drop table if exists public.flatgeobuf_a1; drop table if exists public.flatgeobuf_e1; +drop table if exists public.flatgeobuf_qi; diff --git a/regress/core/flatgeobuf_expected b/regress/core/flatgeobuf_expected index 61c617de3..c93738ff9 100644 --- a/regress/core/flatgeobuf_expected +++ b/regress/core/flatgeobuf_expected @@ -24,3 +24,6 @@ ERROR: mixed geometry type is not supported A1|0||t|1|2|3|4|1.2|1.3|2016-06-23 03:44:52.134125+00|hello --- Exotic roundtrips --- E1|0|t|POINT(1.1 2.1)|f +--- Quoted identifiers --- +QI1 +QI2 ----------------------------------------------------------------------- Summary of changes: NEWS | 1 + postgis/lwgeom_in_flatgeobuf.c | 40 +++++++++++----------------------------- regress/core/flatgeobuf.sql | 20 ++++++++++++++++++++ regress/core/flatgeobuf_expected | 3 +++ 4 files changed, 35 insertions(+), 29 deletions(-) hooks/post-receive -- PostGIS From git at osgeo.org Tue Mar 17 13:28:46 2026 From: git at osgeo.org (git at osgeo.org) Date: Tue, 17 Mar 2026 13:28:46 -0700 (PDT) Subject: [SCM] PostGIS branch stable-3.3 updated. 3.3.9-7-gad3d8e090 Message-ID: <20260317202846.A41A81BE677@trac.osgeo.org> 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.3 has been updated via ad3d8e090666cf4822e6735c4288e75111aabcef (commit) via 66e93195193bc1fef0d1f551b27764df340b6663 (commit) from e648835255fc4de9e838bb1a4a0fe97423ad1269 (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 ad3d8e090666cf4822e6735c4288e75111aabcef Author: Paul Ramsey Date: Tue Mar 17 13:28:41 2026 -0700 News item for GH-850 diff --git a/NEWS b/NEWS index f3cfc3eb3..d95d911c4 100644 --- a/NEWS +++ b/NEWS @@ -8,6 +8,7 @@ PostGIS 3.3.10 - #6055, Remove rare extension priv escalation case. Reported by Sven Klemm (Tiger Data), Allistair Ishmael Hakim (allistair.sh) and Daniel Bakker + - GH-850 Use quote_identifier to build tables in pgis_tablefromflatgeobuf (Ariel Mashraki) PostGIS 3.3.9 commit 66e93195193bc1fef0d1f551b27764df340b6663 Author: Ariel Mashraki Date: Tue Mar 17 13:41:59 2026 +0200 Use quote_identifier to build tables in pgis_tablefromflatgeobuf diff --git a/postgis/lwgeom_in_flatgeobuf.c b/postgis/lwgeom_in_flatgeobuf.c index f0db9253a..ac460ff7a 100644 --- a/postgis/lwgeom_in_flatgeobuf.c +++ b/postgis/lwgeom_in_flatgeobuf.c @@ -75,13 +75,9 @@ Datum pgis_tablefromflatgeobuf(PG_FUNCTION_ARGS) char *schema; text *table_input; char *table; - char *format; - char *sql; bytea *data; uint16_t i; - char **column_defs; - size_t column_defs_total_len; - char *column_defs_str; + StringInfoData sql; if (PG_ARGISNULL(0)) PG_RETURN_NULL(); @@ -107,48 +103,34 @@ Datum pgis_tablefromflatgeobuf(PG_FUNCTION_ARGS) flatgeobuf_check_magicbytes(ctx); flatgeobuf_decode_header(ctx->ctx); - column_defs = palloc(sizeof(char *) * ctx->ctx->columns_size); - column_defs_total_len = 0; + initStringInfo(&sql); + appendStringInfo(&sql, "create table %s.%s (id int, geom geometry", + quote_identifier(schema), quote_identifier(table)); + POSTGIS_DEBUGF(2, "found %d columns", ctx->ctx->columns_size); for (i = 0; i < ctx->ctx->columns_size; i++) { flatgeobuf_column *column = ctx->ctx->columns[i]; const char *name = column->name; uint8_t column_type = column->type; char *pgtype = get_pgtype(column_type); - size_t len = strlen(name) + 1 + strlen(pgtype) + 1; - column_defs[i] = palloc0(sizeof(char) * len); - strcat(column_defs[i], name); - strcat(column_defs[i], " "); - strcat(column_defs[i], pgtype); - column_defs_total_len += len; - } - column_defs_str = palloc0(sizeof(char) * column_defs_total_len + (ctx->ctx->columns_size * 2) + 2 + 1); - if (ctx->ctx->columns_size > 0) - strcat(column_defs_str, ", "); - for (i = 0; i < ctx->ctx->columns_size; i++) { - strcat(column_defs_str, column_defs[i]); - if (i < ctx->ctx->columns_size - 1) - strcat(column_defs_str, ", "); + appendStringInfo(&sql, ", %s %s", quote_identifier(name), pgtype); } - POSTGIS_DEBUGF(2, "column_defs_str %s", column_defs_str); + appendStringInfoChar(&sql, ')'); - format = "create table %s.%s (id int, geom geometry%s)"; - sql = palloc0(strlen(format) + strlen(schema) + strlen(table) + strlen(column_defs_str) + 1); - - sprintf(sql, format, schema, table, column_defs_str); - - POSTGIS_DEBUGF(3, "sql: %s", sql); + POSTGIS_DEBUGF(3, "sql: %s", sql.data); if (SPI_connect() != SPI_OK_CONNECT) elog(ERROR, "Failed to connect SPI"); - if (SPI_execute(sql, false, 0) != SPI_OK_UTILITY) + if (SPI_execute(sql.data, false, 0) != SPI_OK_UTILITY) elog(ERROR, "Failed to create table"); if (SPI_finish() != SPI_OK_FINISH) elog(ERROR, "Failed to finish SPI"); + pfree(sql.data); + POSTGIS_DEBUG(3, "finished"); PG_RETURN_NULL(); diff --git a/regress/core/flatgeobuf.sql b/regress/core/flatgeobuf.sql index 10a535bc2..df46eca1e 100644 --- a/regress/core/flatgeobuf.sql +++ b/regress/core/flatgeobuf.sql @@ -158,6 +158,26 @@ select 'E1', id, bool_1, ST_AsText(geom), bool_2 from ST_FromFlatGeobuf(null::fl ) q) ); +select '--- Quoted identifiers ---'; + +-- Verify that special characters in column names are properly quoted +select ST_FromFlatGeobufToTable('public', 'flatgeobuf_qi', ( + select ST_AsFlatGeobuf(q) from ( + select null::geometry, null::text as "col name; with special--chars" + ) q +)); +select 'QI1' where exists ( + select 1 from information_schema.columns + where table_schema = 'public' + and table_name = 'flatgeobuf_qi' + and column_name = 'col name; with special--chars' +); +select 'QI2' where exists ( + select 1 from information_schema.tables + where table_schema = 'public' and table_name = 'flatgeobuf_t1' +); + drop table if exists public.flatgeobuf_t1; drop table if exists public.flatgeobuf_a1; drop table if exists public.flatgeobuf_e1; +drop table if exists public.flatgeobuf_qi; diff --git a/regress/core/flatgeobuf_expected b/regress/core/flatgeobuf_expected index 61c617de3..c93738ff9 100644 --- a/regress/core/flatgeobuf_expected +++ b/regress/core/flatgeobuf_expected @@ -24,3 +24,6 @@ ERROR: mixed geometry type is not supported A1|0||t|1|2|3|4|1.2|1.3|2016-06-23 03:44:52.134125+00|hello --- Exotic roundtrips --- E1|0|t|POINT(1.1 2.1)|f +--- Quoted identifiers --- +QI1 +QI2 ----------------------------------------------------------------------- Summary of changes: NEWS | 1 + postgis/lwgeom_in_flatgeobuf.c | 40 +++++++++++----------------------------- regress/core/flatgeobuf.sql | 20 ++++++++++++++++++++ regress/core/flatgeobuf_expected | 3 +++ 4 files changed, 35 insertions(+), 29 deletions(-) hooks/post-receive -- PostGIS From git at osgeo.org Tue Mar 17 13:30:01 2026 From: git at osgeo.org (git at osgeo.org) Date: Tue, 17 Mar 2026 13:30:01 -0700 (PDT) Subject: [SCM] PostGIS branch stable-3.2 updated. 3.2.9-5-gb11c94631 Message-ID: <20260317203002.147401B9C71@trac.osgeo.org> 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.2 has been updated via b11c9463196e52246bc6b425f8bb21a967e1ad00 (commit) via b9fa0d5e1c2c9786045406c228d9bbc7fe97599c (commit) from 2396083a5445169d4db8095722f23df711e71b19 (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 b11c9463196e52246bc6b425f8bb21a967e1ad00 Author: Paul Ramsey Date: Tue Mar 17 13:29:55 2026 -0700 News item for GH-850 diff --git a/NEWS b/NEWS index 04a241768..66227222d 100644 --- a/NEWS +++ b/NEWS @@ -9,6 +9,7 @@ Proj 4.9+ required. - #5998, [tiger_geododer] Do not create tiger_data as part of postgis_tiger_geocoder extension, create/update (Regina Obe) - #6054, Remove priv escalation scenario. Reported by Daniel Bakker + - GH-850 Use quote_identifier to build tables in pgis_tablefromflatgeobuf (Ariel Mashraki) PostGIS 3.2.9 commit b9fa0d5e1c2c9786045406c228d9bbc7fe97599c Author: Ariel Mashraki Date: Tue Mar 17 13:41:59 2026 +0200 Use quote_identifier to build tables in pgis_tablefromflatgeobuf diff --git a/postgis/lwgeom_in_flatgeobuf.c b/postgis/lwgeom_in_flatgeobuf.c index f0db9253a..ac460ff7a 100644 --- a/postgis/lwgeom_in_flatgeobuf.c +++ b/postgis/lwgeom_in_flatgeobuf.c @@ -75,13 +75,9 @@ Datum pgis_tablefromflatgeobuf(PG_FUNCTION_ARGS) char *schema; text *table_input; char *table; - char *format; - char *sql; bytea *data; uint16_t i; - char **column_defs; - size_t column_defs_total_len; - char *column_defs_str; + StringInfoData sql; if (PG_ARGISNULL(0)) PG_RETURN_NULL(); @@ -107,48 +103,34 @@ Datum pgis_tablefromflatgeobuf(PG_FUNCTION_ARGS) flatgeobuf_check_magicbytes(ctx); flatgeobuf_decode_header(ctx->ctx); - column_defs = palloc(sizeof(char *) * ctx->ctx->columns_size); - column_defs_total_len = 0; + initStringInfo(&sql); + appendStringInfo(&sql, "create table %s.%s (id int, geom geometry", + quote_identifier(schema), quote_identifier(table)); + POSTGIS_DEBUGF(2, "found %d columns", ctx->ctx->columns_size); for (i = 0; i < ctx->ctx->columns_size; i++) { flatgeobuf_column *column = ctx->ctx->columns[i]; const char *name = column->name; uint8_t column_type = column->type; char *pgtype = get_pgtype(column_type); - size_t len = strlen(name) + 1 + strlen(pgtype) + 1; - column_defs[i] = palloc0(sizeof(char) * len); - strcat(column_defs[i], name); - strcat(column_defs[i], " "); - strcat(column_defs[i], pgtype); - column_defs_total_len += len; - } - column_defs_str = palloc0(sizeof(char) * column_defs_total_len + (ctx->ctx->columns_size * 2) + 2 + 1); - if (ctx->ctx->columns_size > 0) - strcat(column_defs_str, ", "); - for (i = 0; i < ctx->ctx->columns_size; i++) { - strcat(column_defs_str, column_defs[i]); - if (i < ctx->ctx->columns_size - 1) - strcat(column_defs_str, ", "); + appendStringInfo(&sql, ", %s %s", quote_identifier(name), pgtype); } - POSTGIS_DEBUGF(2, "column_defs_str %s", column_defs_str); + appendStringInfoChar(&sql, ')'); - format = "create table %s.%s (id int, geom geometry%s)"; - sql = palloc0(strlen(format) + strlen(schema) + strlen(table) + strlen(column_defs_str) + 1); - - sprintf(sql, format, schema, table, column_defs_str); - - POSTGIS_DEBUGF(3, "sql: %s", sql); + POSTGIS_DEBUGF(3, "sql: %s", sql.data); if (SPI_connect() != SPI_OK_CONNECT) elog(ERROR, "Failed to connect SPI"); - if (SPI_execute(sql, false, 0) != SPI_OK_UTILITY) + if (SPI_execute(sql.data, false, 0) != SPI_OK_UTILITY) elog(ERROR, "Failed to create table"); if (SPI_finish() != SPI_OK_FINISH) elog(ERROR, "Failed to finish SPI"); + pfree(sql.data); + POSTGIS_DEBUG(3, "finished"); PG_RETURN_NULL(); diff --git a/regress/core/flatgeobuf.sql b/regress/core/flatgeobuf.sql index 10a535bc2..df46eca1e 100644 --- a/regress/core/flatgeobuf.sql +++ b/regress/core/flatgeobuf.sql @@ -158,6 +158,26 @@ select 'E1', id, bool_1, ST_AsText(geom), bool_2 from ST_FromFlatGeobuf(null::fl ) q) ); +select '--- Quoted identifiers ---'; + +-- Verify that special characters in column names are properly quoted +select ST_FromFlatGeobufToTable('public', 'flatgeobuf_qi', ( + select ST_AsFlatGeobuf(q) from ( + select null::geometry, null::text as "col name; with special--chars" + ) q +)); +select 'QI1' where exists ( + select 1 from information_schema.columns + where table_schema = 'public' + and table_name = 'flatgeobuf_qi' + and column_name = 'col name; with special--chars' +); +select 'QI2' where exists ( + select 1 from information_schema.tables + where table_schema = 'public' and table_name = 'flatgeobuf_t1' +); + drop table if exists public.flatgeobuf_t1; drop table if exists public.flatgeobuf_a1; drop table if exists public.flatgeobuf_e1; +drop table if exists public.flatgeobuf_qi; diff --git a/regress/core/flatgeobuf_expected b/regress/core/flatgeobuf_expected index 60f3ab847..0d90e7882 100644 --- a/regress/core/flatgeobuf_expected +++ b/regress/core/flatgeobuf_expected @@ -24,3 +24,6 @@ ERROR: mixed geometry type is not supported A1|0||t|1|2|3|4|1.2|1.3|2016-06-23 03:44:52.134125+00|hello --- Exotic roundtrips --- E1|0|t|POINT(1.1 2.1)|f +--- Quoted identifiers --- +QI1 +QI2 ----------------------------------------------------------------------- Summary of changes: NEWS | 1 + postgis/lwgeom_in_flatgeobuf.c | 40 +++++++++++----------------------------- regress/core/flatgeobuf.sql | 20 ++++++++++++++++++++ regress/core/flatgeobuf_expected | 3 +++ 4 files changed, 35 insertions(+), 29 deletions(-) hooks/post-receive -- PostGIS From git at osgeo.org Tue Mar 17 16:07:09 2026 From: git at osgeo.org (git at osgeo.org) Date: Tue, 17 Mar 2026 16:07:09 -0700 (PDT) Subject: [SCM] PostGIS branch master updated. 3.6.0rc2-398-gcf949fa33 Message-ID: <20260317230709.7D1A31BE748@trac.osgeo.org> 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 cf949fa33a6bd0d5b64136ec518320a4bb237bd0 (commit) from 29bd2e10c284291fd1fd386131eb88ac7b1975eb (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 cf949fa33a6bd0d5b64136ec518320a4bb237bd0 Author: Paul Ramsey Date: Tue Mar 17 16:06:43 2026 -0700 Function qualification improvements to avoid name squatting during upgrades References #6055 diff --git a/extensions/postgis/Makefile.in b/extensions/postgis/Makefile.in index 537a501a7..88ef35afd 100644 --- a/extensions/postgis/Makefile.in +++ b/extensions/postgis/Makefile.in @@ -129,8 +129,10 @@ sql/postgis_for_extension.sql: ../../postgis/postgis.sql.in ../../postgis_revisi rm -f $@.tmp sql/postgis_upgrade.sql: sql/postgis_upgrade_for_extension.sql | sql - $(PERL) -pe "s/BEGIN\;//g ; s/COMMIT\;//g; s/^(DROP .*)\;/SELECT postgis_extension_drop_if_exists('$(EXTENSION)', '\1');\n\1\;/" $< > $@ - + cat $< | \ + $(PERL) -lpe "s/BEGIN\;//g" | \ + $(PERL) -lpe "s/COMMIT\;//g" | \ + $(PERL) -lpe "s/^(DROP .*)\;/SELECT \@extschema\@.postgis_extension_drop_if_exists('$(EXTENSION)', '\1');\n\1\;/" > $@ sql/$(EXTENSION)--ANY--$(EXTVERSION).sql: $(EXTENSION_UPGRADE_SCRIPTS) | sql printf '\\echo Use "CREATE EXTENSION $(EXTENSION)" to load this file. \\quit\n' > $@ diff --git a/extensions/postgis_extension_helper.sql.in b/extensions/postgis_extension_helper.sql.in index 3341f9ef1..4855ea882 100644 --- a/extensions/postgis_extension_helper.sql.in +++ b/extensions/postgis_extension_helper.sql.in @@ -18,7 +18,9 @@ CREATE FUNCTION postgis_extension_drop_if_exists(param_extension text, param_sta RETURNS boolean AS $$ DECLARE - var_sql_ext text := 'ALTER EXTENSION ' OPERATOR(pg_catalog.||) pg_catalog.quote_ident(param_extension) OPERATOR(pg_catalog.||) ' ' OPERATOR(pg_catalog.||) pg_catalog.replace(param_statement, 'IF EXISTS', ''); + var_sql_ext text := pg_catalog.format('ALTER EXTENSION %s %s', + pg_catalog.quote_ident(param_extension), + pg_catalog.replace(param_statement, 'IF EXISTS', '')); var_result boolean := false; BEGIN BEGIN @@ -26,13 +28,13 @@ BEGIN var_result := true; EXCEPTION WHEN OTHERS THEN - --this is to allow ignoring if the object does not exist in extension + -- This is to allow ignoring if the object does not exist in extension var_result := false; END; RETURN var_result; END; $$ -LANGUAGE plpgsql VOLATILE; +LANGUAGE 'plpgsql' VOLATILE; CREATE FUNCTION postgis_extension_AddToSearchPath(a_schema_name text) #include "libpgcommon/sql/AddToSearchPath.sql.inc" diff --git a/extensions/postgis_extension_helper_uninstall.sql b/extensions/postgis_extension_helper_uninstall.sql index 756dc80f8..c582d3511 100644 --- a/extensions/postgis_extension_helper_uninstall.sql +++ b/extensions/postgis_extension_helper_uninstall.sql @@ -13,6 +13,6 @@ -- -- This drops extension helper functions -- and should be called at the end of the extension upgrade file -DROP FUNCTION postgis_extension_drop_if_exists(text, text); +DROP FUNCTION IF EXISTS postgis_extension_drop_if_exists(text, text); DROP FUNCTION IF EXISTS postgis_extension_AddToSearchPath(varchar); DROP FUNCTION IF EXISTS postgis_extension_AddToSearchPath(text); diff --git a/extensions/postgis_raster/Makefile.in b/extensions/postgis_raster/Makefile.in index b174746f9..857ce15de 100644 --- a/extensions/postgis_raster/Makefile.in +++ b/extensions/postgis_raster/Makefile.in @@ -97,7 +97,10 @@ sql/rtpostgis_for_extension.sql: ../../raster/rt_pg/rtpostgis.sql.in ../../postg rm -f $@.tmp sql/rtpostgis_upgrade.sql: sql/rtpostgis_upgrade_for_extension.sql | sql - $(PERL) -pe "s/BEGIN\;//g ; s/COMMIT\;//g; s/^(DROP .*)\;/SELECT postgis_extension_drop_if_exists('$(EXTENSION)', '\1');\n\1\;/" $< > $@ + cat $< | \ + $(PERL) -lpe "s/BEGIN\;//g" | \ + $(PERL) -lpe "s/COMMIT\;//g" | \ + $(PERL) -lpe "s/^(DROP .*)\;/SELECT \@extschema\@.postgis_extension_drop_if_exists('$(EXTENSION)', '\1');\n\1\;/" > $@ #this keeps the @extschema at . in place since extension machinery will replace during install sql/rtpostgis_upgrade_for_extension.sql: ../../postgis/common_before_upgrade.sql ../../raster/rt_pg/rtpostgis_upgrade_cleanup.sql sql/rtpostgis_upgrade_for_extension.sql.in ../../raster/rt_pg/rtpostgis_drop.sql ../../postgis/common_after_upgrade.sql | sql diff --git a/postgis/Makefile.in b/postgis/Makefile.in index e433d51f6..95f5060da 100644 --- a/postgis/Makefile.in +++ b/postgis/Makefile.in @@ -241,14 +241,15 @@ endif # %.sql: %.sql.in $(SQLPP) -I at top_srcdir@/libpgcommon -I at builddir@ $< > $@.tmp - grep -v '^#' $@.tmp | $(PERL) -lpe "s'MODULE_PATHNAME'\$(MODULEPATH)'g;s'@extschema@\.''g" > $@ + grep -v '^#' $@.tmp | \ + $(PERL) -lpe "s'MODULE_PATHNAME'\$(MODULEPATH)'g" | \ + $(PERL) -lpe "s'@extschema@\.''g" > $@ rm -f $@.tmp #this is redundant but trying to fold in with extension just hangs postgis_upgrade.sql.in: postgis.sql ../utils/create_upgrade.pl $(PERL) @top_srcdir@/utils/create_upgrade.pl $< > $@ - postgis_upgrade.sql: common_before_upgrade.sql postgis_before_upgrade.sql postgis_upgrade.sql.in postgis_after_upgrade.sql common_after_upgrade.sql echo "BEGIN;" > $@ cat $^ >> $@ diff --git a/postgis/common_before_upgrade.sql b/postgis/common_before_upgrade.sql index 222b5f1f5..be721bfe9 100644 --- a/postgis/common_before_upgrade.sql +++ b/postgis/common_before_upgrade.sql @@ -42,8 +42,8 @@ DECLARE postgis_namespace OID; matching_function pg_catalog.pg_proc; detail TEXT; - deprecated_suffix TEXT := '_deprecated_by_postgis_' || deprecated_in_version; - deprecated_suffix_len INT := length(deprecated_suffix); + deprecated_suffix TEXT := pg_catalog.concat('_deprecated_by_postgis_', deprecated_in_version); + deprecated_suffix_len INT := pg_catalog.length(deprecated_suffix); BEGIN -- Fetch install namespace for PostGIS @@ -57,15 +57,16 @@ BEGIN SELECT * FROM pg_catalog.pg_proc p WHERE pronamespace = postgis_namespace - AND pg_catalog.LOWER(p.proname) = pg_catalog.LOWER(function_name) + AND p.proname ILIKE function_name AND pg_catalog.pg_function_is_visible(p.oid) - AND pg_catalog.LOWER(pg_catalog.pg_get_function_identity_arguments(p.oid)) = pg_catalog.LOWER(function_arguments) + AND pg_catalog.pg_get_function_identity_arguments(p.oid) ILIKE function_arguments INTO matching_function; IF matching_function.oid IS NOT NULL THEN - sql := format('ALTER FUNCTION %s RENAME TO %I', + sql := pg_catalog.format('ALTER FUNCTION %s RENAME TO %I', matching_function.oid::regprocedure, - SUBSTRING(matching_function.proname,1,63-deprecated_suffix_len) || deprecated_suffix --limit to 63 characters + --limit to 63 characters + pg_catalog.concat(pg_catalog.left(matching_function.proname,63-deprecated_suffix_len), deprecated_suffix) ); RAISE DEBUG 'SQL query: %', sql; BEGIN @@ -99,8 +100,8 @@ BEGIN SELECT castsource::pg_catalog.regtype::text, casttarget::pg_catalog.regtype::text INTO STRICT cast_source, cast_target FROM pg_catalog.pg_cast - WHERE castsource::pg_catalog.regtype::text = lower(sourcetype) - AND casttarget::pg_catalog.regtype::text = lower(targettype); + WHERE castsource::pg_catalog.regtype::text ILIKE sourcetype + AND casttarget::pg_catalog.regtype::text ILIKE targettype; EXCEPTION WHEN NO_DATA_FOUND THEN RAISE DEBUG 'Deprecated cast (topology.% as %) does not exist', sourcetype, targettype; @@ -113,7 +114,7 @@ BEGIN RETURN; END; - new_name := cast_source || '_' || cast_target; + new_name := pg_catalog.concat(cast_source, '_', cast_target); sql := pg_catalog.format( 'DROP CAST IF EXISTS (topology.%s AS %s)', cast_source, @@ -135,7 +136,7 @@ DECLARE newname TEXT; proc RECORD; deprecated_suffix TEXT := '_deprecated_by_postgis_' || deprecated_in_version; - deprecated_suffix_len INT := length(deprecated_suffix); + deprecated_suffix_len INT := pg_catalog.length(deprecated_suffix); BEGIN -- Check if the deprecated function exists @@ -161,7 +162,8 @@ BEGIN sql := pg_catalog.format( 'ALTER FUNCTION %s RENAME TO %I', proc.oid::regprocedure, - SUBSTRING(proc.proname,1,63-deprecated_suffix_len) || deprecated_suffix -- limit to 63 characters + -- limit to 63 characters + pg_catalog.concat(pg_catalog.left(proc.proname,63-deprecated_suffix_len), deprecated_suffix) ); EXECUTE sql; @@ -177,14 +179,14 @@ CREATE OR REPLACE FUNCTION _postgis_topology_upgrade_domain_type( DECLARE detail TEXT; -- We need the base types of the old and new types - if multidimensional (int[][]), we need just one dimension at most - old_base_type TEXT := regexp_replace(old_domain_type, E'(\\[\\])+$', '[]'); - new_base_type TEXT := regexp_replace(new_domain_type, E'(\\[\\])+$', '[]'); - array_dims INT := (SELECT count(*) FROM regexp_matches (old_domain_type, E'\\[\\]', 'g')); + old_base_type TEXT := pg_catalog.regexp_replace(old_domain_type, E'(\\[\\])+$', '[]'); + new_base_type TEXT := pg_catalog.regexp_replace(new_domain_type, E'(\\[\\])+$', '[]'); + array_dims INT := (SELECT count(*) FROM pg_catalog.regexp_matches (old_domain_type, E'\\[\\]', 'g')); BEGIN IF EXISTS (SELECT 1 FROM pg_catalog.pg_type AS t WHERE typnamespace::regnamespace::text = 'topology' - AND typname::text = lower(domain_name) - AND typbasetype::regtype::text = lower(old_base_type) + AND typname::text ILIKE domain_name + AND typbasetype::regtype::text ILIKE old_base_type AND typndims = array_dims) THEN BEGIN @@ -192,8 +194,8 @@ BEGIN UPDATE pg_catalog.pg_type SET typbasetype = new_base_type::regtype::oid, typndims = array_dims WHERE typnamespace::regnamespace::text = 'topology' - AND typname::text = lower(domain_name) - AND typbasetype::regtype::text = lower(old_base_type) + AND typname::text ILIKE domain_name + AND typbasetype::regtype::text ILIKE old_base_type AND typndims = array_dims; RAISE INFO 'Upgraded % from % to %', domain_name, old_domain_type, new_domain_type; @@ -221,6 +223,7 @@ CREATE OR REPLACE FUNCTION _postgis_topology_upgrade_user_type_attribute( DECLARE sql text; detail TEXT; + tmp text; num_updated integer; proc RECORD; temp_attr_name TEXT := attr_name || '_tmp'; @@ -232,13 +235,13 @@ BEGIN -- Get the attribute id and number of attributes (so we can reset relnatts after adding/deleting temp attribute) SELECT pg_type.typrelid attrelid, pg_class.relnatts FROM pg_catalog.pg_type - join pg_class on pg_class.oid = pg_type.typrelid - join pg_attribute on pg_attribute.attrelid = pg_class.oid - join pg_type as pg_attr_type on pg_attr_type.oid = pg_attribute.atttypid - where pg_type.typname::regtype::text = lower(type_name) + join pg_catalog.pg_class on pg_class.oid = pg_type.typrelid + join pg_catalog.pg_attribute on pg_attribute.attrelid = pg_class.oid + join pg_catalog.pg_type as pg_attr_type on pg_attr_type.oid = pg_attribute.atttypid + where pg_type.typname::regtype::text ILIKE type_name and pg_type.typnamespace::regnamespace::text = 'topology' - and attname::text = lower(attr_name) - and pg_attr_type.typname::regtype::text = lower(old_attr_type) + and attname::text ILIKE attr_name + and pg_attr_type.typname::regtype::text ILIKE old_attr_type INTO STRICT proc; EXCEPTION @@ -256,57 +259,57 @@ BEGIN BEGIN -- Add a temporary attribute with the required type -- This is the cleanest way to ensure the type is valid and all constraints are met - sql := format( + sql := pg_catalog.format( 'ALTER TYPE topology.%s ADD ATTRIBUTE %s %s', type_name, temp_attr_name, new_attr_type ); - --RAISE INFO 'SQL: %', sql; + RAISE DEBUG 'SQL: %', sql; EXECUTE sql; -- Copy the attributes from the temp attribute to the existing attribute sql := 'UPDATE pg_attribute AS tgt SET '; BEGIN - FOR colname IN - SELECT column_name - FROM information_schema.columns - WHERE table_name = 'pg_attribute' - AND column_name <> ALL (excluded_columns) - AND column_name NOT LIKE 'oid%' -- Exclude system columns - LOOP - sql := sql || format('%I = src.%I, ', colname, colname); - END LOOP; + -- add in tgt = src assignments for the update + SELECT pg_catalog.string_agg(pg_catalog.format('%I = src.%I', column_name, column_name), ', ') + FROM information_schema.columns + INTO tmp + WHERE table_name = 'pg_attribute' + AND column_name <> ALL (excluded_columns) + AND column_name NOT LIKE 'oid%'; + sql := sql || tmp; - -- remove trailing comma and add FROM/WHERE clause - sql := left(sql, -2) || ' FROM pg_attribute AS src WHERE ' || format('tgt.attrelid = %s AND tgt.attname = %L AND src.attrelid = %s AND src.attname = %L', + -- add FROM/WHERE clause + tmp := pg_catalog.format('tgt.attrelid = %s AND tgt.attname = %L AND src.attrelid = %s AND src.attname = %L', proc.attrelid, attr_name, proc.attrelid, temp_attr_name ); + sql := pg_catalog.concat(sql, ' FROM pg_attribute AS src WHERE ', tmp); - --RAISE INFO 'SQL: %', sql; - EXECUTE sql; + RAISE DEBUG 'SQL: %', sql; + EXECUTE sql; END; -- Delete temp attribute since we cannot alter the type - sql := format( + sql := pg_catalog.format( 'DELETE FROM pg_attribute WHERE attname = %L AND attrelid = %s', temp_attr_name, proc.attrelid ); - --RAISE INFO 'SQL: %', sql; + RAISE DEBUG 'SQL: %', sql; EXECUTE sql; -- Reset the number of attributes in pg_class else postgres will complain - sql := format( + sql := pg_catalog.format( 'UPDATE pg_class SET relnatts = %s WHERE oid = %s', proc.relnatts, proc.attrelid ); - --RAISE INFO 'SQL: %', sql; + RAISE DEBUG 'SQL: %', sql; EXECUTE sql; RAISE INFO 'Upgraded %.% from % to %', type_name, attr_name, old_attr_type, new_attr_type; @@ -319,7 +322,7 @@ BEGIN RETURN; END; END; -$$ LANGUAGE plpgsql; +$$ LANGUAGE 'plpgsql'; -- Add useslargeids to topology CREATE OR REPLACE FUNCTION _postgis_add_column_to_table( @@ -351,7 +354,7 @@ BEGIN null_clause := 'NOT NULL'; END IF; - IF LENGTH(default_value) > 0 THEN + IF pg_catalog.LENGTH(default_value) > 0 THEN default_clause := 'DEFAULT ' || default_value; END IF; @@ -367,7 +370,7 @@ BEGIN default_clause ); - --RAISE INFO 'SQL: %', sql; + -- RAISE INFO 'SQL: %', sql; EXECUTE sql; diff --git a/utils/create_uninstall.pl b/utils/create_uninstall.pl index 86f40041e..fab98cfd8 100755 --- a/utils/create_uninstall.pl +++ b/utils/create_uninstall.pl @@ -287,10 +287,10 @@ DECLARE BEGIN FOR rec IN SELECT n.nspname, c.relname, a.attname, t.typname - FROM pg_attribute a - JOIN pg_class c ON a.attrelid = c.oid - JOIN pg_namespace n ON c.relnamespace = n.oid - JOIN pg_type t ON a.atttypid = t.oid + FROM pg_catalog.pg_attribute a + JOIN pg_catalog.pg_class c ON a.attrelid = c.oid + JOIN pg_catalog.pg_namespace n ON c.relnamespace = n.oid + JOIN pg_catalog.pg_type t ON a.atttypid = t.oid WHERE t.typname = '$type' AND NOT ( -- we exclude complexes defined as types @@ -398,16 +398,16 @@ DECLARE var_result text; var_search_path text; BEGIN - SELECT reset_val INTO var_search_path FROM pg_settings WHERE name = 'search_path'; - IF var_search_path NOT LIKE '%' || quote_ident(a_schema_name) || '%' THEN + SELECT reset_val INTO var_search_path FROM pg_catalog.pg_settings WHERE name = 'search_path'; + IF NOT var_search_path ~ pg_catalog.quote_ident(a_schema_name) THEN var_result := a_schema_name || ' not in database search_path'; ELSE - var_search_path := btrim( regexp_replace( - replace(var_search_path, a_schema_name, ''), ', *,', ','), + var_search_path := pg_catalog.btrim( pg_catalog.regexp_replace( + pg_catalog.replace(var_search_path, a_schema_name, ''), ', *,', ','), ', '); RAISE NOTICE 'New search_path: %', var_search_path; - EXECUTE 'ALTER DATABASE ' || quote_ident(current_database()) || ' SET search_path = ' || var_search_path; - var_result := a_schema_name || ' has been stripped off database search_path '; + EXECUTE pg_catalog.Format('ALTER DATABASE %s SET search_path = %s', pg_catalog.quote_ident(current_database()), var_search_path); + var_result := pg_catalog.Concat(a_schema_name, ' has been stripped off database search_path '); END IF; RETURN var_result; diff --git a/utils/create_upgrade.pl b/utils/create_upgrade.pl index f4bb9adc1..38826cfe6 100644 --- a/utils/create_upgrade.pl +++ b/utils/create_upgrade.pl @@ -125,10 +125,18 @@ while() #last; } + elsif (/CREATE SCHEMA topology/) + { + $module = 'postgis_topology'; + } elsif (/TYPE raster/) { $module = 'postgis_raster'; } + elsif (/FUNCTION postgis_sfcgal_noop/) + { + $module = 'postgis_sfcgal'; + } elsif (m@('\$libdir/[^']*')@) { $soname = $1; ----------------------------------------------------------------------- Summary of changes: extensions/postgis/Makefile.in | 6 +- extensions/postgis_extension_helper.sql.in | 8 +- extensions/postgis_extension_helper_uninstall.sql | 2 +- extensions/postgis_raster/Makefile.in | 5 +- postgis/Makefile.in | 5 +- postgis/common_before_upgrade.sql | 97 ++++++++++++----------- utils/create_uninstall.pl | 20 ++--- utils/create_upgrade.pl | 8 ++ 8 files changed, 85 insertions(+), 66 deletions(-) hooks/post-receive -- PostGIS From trac at osgeo.org Tue Mar 17 16:07:18 2026 From: trac at osgeo.org (PostGIS) Date: Tue, 17 Mar 2026 23:07:18 -0000 Subject: [PostGIS] #6055: Specify search_path carefully during extension install In-Reply-To: <049.b6be645ea57dbb71051ae75581b93595@osgeo.org> References: <049.b6be645ea57dbb71051ae75581b93595@osgeo.org> Message-ID: <064.ade923f2333feb4a38aabf5bfc777832@osgeo.org> #6055: Specify search_path carefully during extension install ----------------------+--------------------------- Reporter: pramsey | Owner: pramsey Type: defect | Status: closed Priority: high | Milestone: PostGIS 3.6.2 Component: postgis | Version: 3.2.x Resolution: fixed | Keywords: ----------------------+--------------------------- Comment (by Paul Ramsey ): In [changeset:"cf949fa33a6bd0d5b64136ec518320a4bb237bd0/git" cf949fa/git]: {{{#!CommitTicketReference repository="git" revision="cf949fa33a6bd0d5b64136ec518320a4bb237bd0" Function qualification improvements to avoid name squatting during upgrades References #6055 }}} -- Ticket URL: PostGIS The PostGIS Trac is used for bug, enhancement & task tracking, a user and developer wiki, and a view into the subversion code repository of PostGIS project. From git at osgeo.org Tue Mar 17 16:07:41 2026 From: git at osgeo.org (git at osgeo.org) Date: Tue, 17 Mar 2026 16:07:41 -0700 (PDT) Subject: [SCM] PostGIS branch stable-3.6 updated. 3.6.2-8-g5ff3eaca5 Message-ID: <20260317230742.00BDC1BF18E@trac.osgeo.org> 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.6 has been updated via 5ff3eaca52ba8db6d45e46c3b40c91b0b9c49248 (commit) from e5be73640efdd333ed6358c442233d269f2dbc5f (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 5ff3eaca52ba8db6d45e46c3b40c91b0b9c49248 Author: Paul Ramsey Date: Tue Mar 17 16:07:28 2026 -0700 Function qualification improvements to avoid name squatting during upgrades References #6055 diff --git a/extensions/postgis/Makefile.in b/extensions/postgis/Makefile.in index 537a501a7..88ef35afd 100644 --- a/extensions/postgis/Makefile.in +++ b/extensions/postgis/Makefile.in @@ -129,8 +129,10 @@ sql/postgis_for_extension.sql: ../../postgis/postgis.sql.in ../../postgis_revisi rm -f $@.tmp sql/postgis_upgrade.sql: sql/postgis_upgrade_for_extension.sql | sql - $(PERL) -pe "s/BEGIN\;//g ; s/COMMIT\;//g; s/^(DROP .*)\;/SELECT postgis_extension_drop_if_exists('$(EXTENSION)', '\1');\n\1\;/" $< > $@ - + cat $< | \ + $(PERL) -lpe "s/BEGIN\;//g" | \ + $(PERL) -lpe "s/COMMIT\;//g" | \ + $(PERL) -lpe "s/^(DROP .*)\;/SELECT \@extschema\@.postgis_extension_drop_if_exists('$(EXTENSION)', '\1');\n\1\;/" > $@ sql/$(EXTENSION)--ANY--$(EXTVERSION).sql: $(EXTENSION_UPGRADE_SCRIPTS) | sql printf '\\echo Use "CREATE EXTENSION $(EXTENSION)" to load this file. \\quit\n' > $@ diff --git a/extensions/postgis_extension_helper.sql.in b/extensions/postgis_extension_helper.sql.in index 3341f9ef1..4855ea882 100644 --- a/extensions/postgis_extension_helper.sql.in +++ b/extensions/postgis_extension_helper.sql.in @@ -18,7 +18,9 @@ CREATE FUNCTION postgis_extension_drop_if_exists(param_extension text, param_sta RETURNS boolean AS $$ DECLARE - var_sql_ext text := 'ALTER EXTENSION ' OPERATOR(pg_catalog.||) pg_catalog.quote_ident(param_extension) OPERATOR(pg_catalog.||) ' ' OPERATOR(pg_catalog.||) pg_catalog.replace(param_statement, 'IF EXISTS', ''); + var_sql_ext text := pg_catalog.format('ALTER EXTENSION %s %s', + pg_catalog.quote_ident(param_extension), + pg_catalog.replace(param_statement, 'IF EXISTS', '')); var_result boolean := false; BEGIN BEGIN @@ -26,13 +28,13 @@ BEGIN var_result := true; EXCEPTION WHEN OTHERS THEN - --this is to allow ignoring if the object does not exist in extension + -- This is to allow ignoring if the object does not exist in extension var_result := false; END; RETURN var_result; END; $$ -LANGUAGE plpgsql VOLATILE; +LANGUAGE 'plpgsql' VOLATILE; CREATE FUNCTION postgis_extension_AddToSearchPath(a_schema_name text) #include "libpgcommon/sql/AddToSearchPath.sql.inc" diff --git a/extensions/postgis_extension_helper_uninstall.sql b/extensions/postgis_extension_helper_uninstall.sql index 756dc80f8..c582d3511 100644 --- a/extensions/postgis_extension_helper_uninstall.sql +++ b/extensions/postgis_extension_helper_uninstall.sql @@ -13,6 +13,6 @@ -- -- This drops extension helper functions -- and should be called at the end of the extension upgrade file -DROP FUNCTION postgis_extension_drop_if_exists(text, text); +DROP FUNCTION IF EXISTS postgis_extension_drop_if_exists(text, text); DROP FUNCTION IF EXISTS postgis_extension_AddToSearchPath(varchar); DROP FUNCTION IF EXISTS postgis_extension_AddToSearchPath(text); diff --git a/extensions/postgis_raster/Makefile.in b/extensions/postgis_raster/Makefile.in index b174746f9..857ce15de 100644 --- a/extensions/postgis_raster/Makefile.in +++ b/extensions/postgis_raster/Makefile.in @@ -97,7 +97,10 @@ sql/rtpostgis_for_extension.sql: ../../raster/rt_pg/rtpostgis.sql.in ../../postg rm -f $@.tmp sql/rtpostgis_upgrade.sql: sql/rtpostgis_upgrade_for_extension.sql | sql - $(PERL) -pe "s/BEGIN\;//g ; s/COMMIT\;//g; s/^(DROP .*)\;/SELECT postgis_extension_drop_if_exists('$(EXTENSION)', '\1');\n\1\;/" $< > $@ + cat $< | \ + $(PERL) -lpe "s/BEGIN\;//g" | \ + $(PERL) -lpe "s/COMMIT\;//g" | \ + $(PERL) -lpe "s/^(DROP .*)\;/SELECT \@extschema\@.postgis_extension_drop_if_exists('$(EXTENSION)', '\1');\n\1\;/" > $@ #this keeps the @extschema at . in place since extension machinery will replace during install sql/rtpostgis_upgrade_for_extension.sql: ../../postgis/common_before_upgrade.sql ../../raster/rt_pg/rtpostgis_upgrade_cleanup.sql sql/rtpostgis_upgrade_for_extension.sql.in ../../raster/rt_pg/rtpostgis_drop.sql ../../postgis/common_after_upgrade.sql | sql diff --git a/postgis/Makefile.in b/postgis/Makefile.in index 03955ba39..887dd5f19 100644 --- a/postgis/Makefile.in +++ b/postgis/Makefile.in @@ -241,14 +241,15 @@ endif # %.sql: %.sql.in $(SQLPP) -I at top_srcdir@/libpgcommon -I at builddir@ $< > $@.tmp - grep -v '^#' $@.tmp | $(PERL) -lpe "s'MODULE_PATHNAME'\$(MODULEPATH)'g;s'@extschema@\.''g" > $@ + grep -v '^#' $@.tmp | \ + $(PERL) -lpe "s'MODULE_PATHNAME'\$(MODULEPATH)'g" | \ + $(PERL) -lpe "s'@extschema@\.''g" > $@ rm -f $@.tmp #this is redundant but trying to fold in with extension just hangs postgis_upgrade.sql.in: postgis.sql ../utils/create_upgrade.pl $(PERL) @top_srcdir@/utils/create_upgrade.pl $< > $@ - postgis_upgrade.sql: common_before_upgrade.sql postgis_before_upgrade.sql postgis_upgrade.sql.in postgis_after_upgrade.sql common_after_upgrade.sql echo "BEGIN;" > $@ cat $^ >> $@ diff --git a/postgis/common_before_upgrade.sql b/postgis/common_before_upgrade.sql index 222b5f1f5..be721bfe9 100644 --- a/postgis/common_before_upgrade.sql +++ b/postgis/common_before_upgrade.sql @@ -42,8 +42,8 @@ DECLARE postgis_namespace OID; matching_function pg_catalog.pg_proc; detail TEXT; - deprecated_suffix TEXT := '_deprecated_by_postgis_' || deprecated_in_version; - deprecated_suffix_len INT := length(deprecated_suffix); + deprecated_suffix TEXT := pg_catalog.concat('_deprecated_by_postgis_', deprecated_in_version); + deprecated_suffix_len INT := pg_catalog.length(deprecated_suffix); BEGIN -- Fetch install namespace for PostGIS @@ -57,15 +57,16 @@ BEGIN SELECT * FROM pg_catalog.pg_proc p WHERE pronamespace = postgis_namespace - AND pg_catalog.LOWER(p.proname) = pg_catalog.LOWER(function_name) + AND p.proname ILIKE function_name AND pg_catalog.pg_function_is_visible(p.oid) - AND pg_catalog.LOWER(pg_catalog.pg_get_function_identity_arguments(p.oid)) = pg_catalog.LOWER(function_arguments) + AND pg_catalog.pg_get_function_identity_arguments(p.oid) ILIKE function_arguments INTO matching_function; IF matching_function.oid IS NOT NULL THEN - sql := format('ALTER FUNCTION %s RENAME TO %I', + sql := pg_catalog.format('ALTER FUNCTION %s RENAME TO %I', matching_function.oid::regprocedure, - SUBSTRING(matching_function.proname,1,63-deprecated_suffix_len) || deprecated_suffix --limit to 63 characters + --limit to 63 characters + pg_catalog.concat(pg_catalog.left(matching_function.proname,63-deprecated_suffix_len), deprecated_suffix) ); RAISE DEBUG 'SQL query: %', sql; BEGIN @@ -99,8 +100,8 @@ BEGIN SELECT castsource::pg_catalog.regtype::text, casttarget::pg_catalog.regtype::text INTO STRICT cast_source, cast_target FROM pg_catalog.pg_cast - WHERE castsource::pg_catalog.regtype::text = lower(sourcetype) - AND casttarget::pg_catalog.regtype::text = lower(targettype); + WHERE castsource::pg_catalog.regtype::text ILIKE sourcetype + AND casttarget::pg_catalog.regtype::text ILIKE targettype; EXCEPTION WHEN NO_DATA_FOUND THEN RAISE DEBUG 'Deprecated cast (topology.% as %) does not exist', sourcetype, targettype; @@ -113,7 +114,7 @@ BEGIN RETURN; END; - new_name := cast_source || '_' || cast_target; + new_name := pg_catalog.concat(cast_source, '_', cast_target); sql := pg_catalog.format( 'DROP CAST IF EXISTS (topology.%s AS %s)', cast_source, @@ -135,7 +136,7 @@ DECLARE newname TEXT; proc RECORD; deprecated_suffix TEXT := '_deprecated_by_postgis_' || deprecated_in_version; - deprecated_suffix_len INT := length(deprecated_suffix); + deprecated_suffix_len INT := pg_catalog.length(deprecated_suffix); BEGIN -- Check if the deprecated function exists @@ -161,7 +162,8 @@ BEGIN sql := pg_catalog.format( 'ALTER FUNCTION %s RENAME TO %I', proc.oid::regprocedure, - SUBSTRING(proc.proname,1,63-deprecated_suffix_len) || deprecated_suffix -- limit to 63 characters + -- limit to 63 characters + pg_catalog.concat(pg_catalog.left(proc.proname,63-deprecated_suffix_len), deprecated_suffix) ); EXECUTE sql; @@ -177,14 +179,14 @@ CREATE OR REPLACE FUNCTION _postgis_topology_upgrade_domain_type( DECLARE detail TEXT; -- We need the base types of the old and new types - if multidimensional (int[][]), we need just one dimension at most - old_base_type TEXT := regexp_replace(old_domain_type, E'(\\[\\])+$', '[]'); - new_base_type TEXT := regexp_replace(new_domain_type, E'(\\[\\])+$', '[]'); - array_dims INT := (SELECT count(*) FROM regexp_matches (old_domain_type, E'\\[\\]', 'g')); + old_base_type TEXT := pg_catalog.regexp_replace(old_domain_type, E'(\\[\\])+$', '[]'); + new_base_type TEXT := pg_catalog.regexp_replace(new_domain_type, E'(\\[\\])+$', '[]'); + array_dims INT := (SELECT count(*) FROM pg_catalog.regexp_matches (old_domain_type, E'\\[\\]', 'g')); BEGIN IF EXISTS (SELECT 1 FROM pg_catalog.pg_type AS t WHERE typnamespace::regnamespace::text = 'topology' - AND typname::text = lower(domain_name) - AND typbasetype::regtype::text = lower(old_base_type) + AND typname::text ILIKE domain_name + AND typbasetype::regtype::text ILIKE old_base_type AND typndims = array_dims) THEN BEGIN @@ -192,8 +194,8 @@ BEGIN UPDATE pg_catalog.pg_type SET typbasetype = new_base_type::regtype::oid, typndims = array_dims WHERE typnamespace::regnamespace::text = 'topology' - AND typname::text = lower(domain_name) - AND typbasetype::regtype::text = lower(old_base_type) + AND typname::text ILIKE domain_name + AND typbasetype::regtype::text ILIKE old_base_type AND typndims = array_dims; RAISE INFO 'Upgraded % from % to %', domain_name, old_domain_type, new_domain_type; @@ -221,6 +223,7 @@ CREATE OR REPLACE FUNCTION _postgis_topology_upgrade_user_type_attribute( DECLARE sql text; detail TEXT; + tmp text; num_updated integer; proc RECORD; temp_attr_name TEXT := attr_name || '_tmp'; @@ -232,13 +235,13 @@ BEGIN -- Get the attribute id and number of attributes (so we can reset relnatts after adding/deleting temp attribute) SELECT pg_type.typrelid attrelid, pg_class.relnatts FROM pg_catalog.pg_type - join pg_class on pg_class.oid = pg_type.typrelid - join pg_attribute on pg_attribute.attrelid = pg_class.oid - join pg_type as pg_attr_type on pg_attr_type.oid = pg_attribute.atttypid - where pg_type.typname::regtype::text = lower(type_name) + join pg_catalog.pg_class on pg_class.oid = pg_type.typrelid + join pg_catalog.pg_attribute on pg_attribute.attrelid = pg_class.oid + join pg_catalog.pg_type as pg_attr_type on pg_attr_type.oid = pg_attribute.atttypid + where pg_type.typname::regtype::text ILIKE type_name and pg_type.typnamespace::regnamespace::text = 'topology' - and attname::text = lower(attr_name) - and pg_attr_type.typname::regtype::text = lower(old_attr_type) + and attname::text ILIKE attr_name + and pg_attr_type.typname::regtype::text ILIKE old_attr_type INTO STRICT proc; EXCEPTION @@ -256,57 +259,57 @@ BEGIN BEGIN -- Add a temporary attribute with the required type -- This is the cleanest way to ensure the type is valid and all constraints are met - sql := format( + sql := pg_catalog.format( 'ALTER TYPE topology.%s ADD ATTRIBUTE %s %s', type_name, temp_attr_name, new_attr_type ); - --RAISE INFO 'SQL: %', sql; + RAISE DEBUG 'SQL: %', sql; EXECUTE sql; -- Copy the attributes from the temp attribute to the existing attribute sql := 'UPDATE pg_attribute AS tgt SET '; BEGIN - FOR colname IN - SELECT column_name - FROM information_schema.columns - WHERE table_name = 'pg_attribute' - AND column_name <> ALL (excluded_columns) - AND column_name NOT LIKE 'oid%' -- Exclude system columns - LOOP - sql := sql || format('%I = src.%I, ', colname, colname); - END LOOP; + -- add in tgt = src assignments for the update + SELECT pg_catalog.string_agg(pg_catalog.format('%I = src.%I', column_name, column_name), ', ') + FROM information_schema.columns + INTO tmp + WHERE table_name = 'pg_attribute' + AND column_name <> ALL (excluded_columns) + AND column_name NOT LIKE 'oid%'; + sql := sql || tmp; - -- remove trailing comma and add FROM/WHERE clause - sql := left(sql, -2) || ' FROM pg_attribute AS src WHERE ' || format('tgt.attrelid = %s AND tgt.attname = %L AND src.attrelid = %s AND src.attname = %L', + -- add FROM/WHERE clause + tmp := pg_catalog.format('tgt.attrelid = %s AND tgt.attname = %L AND src.attrelid = %s AND src.attname = %L', proc.attrelid, attr_name, proc.attrelid, temp_attr_name ); + sql := pg_catalog.concat(sql, ' FROM pg_attribute AS src WHERE ', tmp); - --RAISE INFO 'SQL: %', sql; - EXECUTE sql; + RAISE DEBUG 'SQL: %', sql; + EXECUTE sql; END; -- Delete temp attribute since we cannot alter the type - sql := format( + sql := pg_catalog.format( 'DELETE FROM pg_attribute WHERE attname = %L AND attrelid = %s', temp_attr_name, proc.attrelid ); - --RAISE INFO 'SQL: %', sql; + RAISE DEBUG 'SQL: %', sql; EXECUTE sql; -- Reset the number of attributes in pg_class else postgres will complain - sql := format( + sql := pg_catalog.format( 'UPDATE pg_class SET relnatts = %s WHERE oid = %s', proc.relnatts, proc.attrelid ); - --RAISE INFO 'SQL: %', sql; + RAISE DEBUG 'SQL: %', sql; EXECUTE sql; RAISE INFO 'Upgraded %.% from % to %', type_name, attr_name, old_attr_type, new_attr_type; @@ -319,7 +322,7 @@ BEGIN RETURN; END; END; -$$ LANGUAGE plpgsql; +$$ LANGUAGE 'plpgsql'; -- Add useslargeids to topology CREATE OR REPLACE FUNCTION _postgis_add_column_to_table( @@ -351,7 +354,7 @@ BEGIN null_clause := 'NOT NULL'; END IF; - IF LENGTH(default_value) > 0 THEN + IF pg_catalog.LENGTH(default_value) > 0 THEN default_clause := 'DEFAULT ' || default_value; END IF; @@ -367,7 +370,7 @@ BEGIN default_clause ); - --RAISE INFO 'SQL: %', sql; + -- RAISE INFO 'SQL: %', sql; EXECUTE sql; diff --git a/utils/create_uninstall.pl b/utils/create_uninstall.pl index 86f40041e..fab98cfd8 100755 --- a/utils/create_uninstall.pl +++ b/utils/create_uninstall.pl @@ -287,10 +287,10 @@ DECLARE BEGIN FOR rec IN SELECT n.nspname, c.relname, a.attname, t.typname - FROM pg_attribute a - JOIN pg_class c ON a.attrelid = c.oid - JOIN pg_namespace n ON c.relnamespace = n.oid - JOIN pg_type t ON a.atttypid = t.oid + FROM pg_catalog.pg_attribute a + JOIN pg_catalog.pg_class c ON a.attrelid = c.oid + JOIN pg_catalog.pg_namespace n ON c.relnamespace = n.oid + JOIN pg_catalog.pg_type t ON a.atttypid = t.oid WHERE t.typname = '$type' AND NOT ( -- we exclude complexes defined as types @@ -398,16 +398,16 @@ DECLARE var_result text; var_search_path text; BEGIN - SELECT reset_val INTO var_search_path FROM pg_settings WHERE name = 'search_path'; - IF var_search_path NOT LIKE '%' || quote_ident(a_schema_name) || '%' THEN + SELECT reset_val INTO var_search_path FROM pg_catalog.pg_settings WHERE name = 'search_path'; + IF NOT var_search_path ~ pg_catalog.quote_ident(a_schema_name) THEN var_result := a_schema_name || ' not in database search_path'; ELSE - var_search_path := btrim( regexp_replace( - replace(var_search_path, a_schema_name, ''), ', *,', ','), + var_search_path := pg_catalog.btrim( pg_catalog.regexp_replace( + pg_catalog.replace(var_search_path, a_schema_name, ''), ', *,', ','), ', '); RAISE NOTICE 'New search_path: %', var_search_path; - EXECUTE 'ALTER DATABASE ' || quote_ident(current_database()) || ' SET search_path = ' || var_search_path; - var_result := a_schema_name || ' has been stripped off database search_path '; + EXECUTE pg_catalog.Format('ALTER DATABASE %s SET search_path = %s', pg_catalog.quote_ident(current_database()), var_search_path); + var_result := pg_catalog.Concat(a_schema_name, ' has been stripped off database search_path '); END IF; RETURN var_result; diff --git a/utils/create_upgrade.pl b/utils/create_upgrade.pl index f4bb9adc1..38826cfe6 100644 --- a/utils/create_upgrade.pl +++ b/utils/create_upgrade.pl @@ -125,10 +125,18 @@ while() #last; } + elsif (/CREATE SCHEMA topology/) + { + $module = 'postgis_topology'; + } elsif (/TYPE raster/) { $module = 'postgis_raster'; } + elsif (/FUNCTION postgis_sfcgal_noop/) + { + $module = 'postgis_sfcgal'; + } elsif (m@('\$libdir/[^']*')@) { $soname = $1; ----------------------------------------------------------------------- Summary of changes: extensions/postgis/Makefile.in | 6 +- extensions/postgis_extension_helper.sql.in | 8 +- extensions/postgis_extension_helper_uninstall.sql | 2 +- extensions/postgis_raster/Makefile.in | 5 +- postgis/Makefile.in | 5 +- postgis/common_before_upgrade.sql | 97 ++++++++++++----------- utils/create_uninstall.pl | 20 ++--- utils/create_upgrade.pl | 8 ++ 8 files changed, 85 insertions(+), 66 deletions(-) hooks/post-receive -- PostGIS From trac at osgeo.org Tue Mar 17 16:07:43 2026 From: trac at osgeo.org (PostGIS) Date: Tue, 17 Mar 2026 23:07:43 -0000 Subject: [PostGIS] #6055: Specify search_path carefully during extension install In-Reply-To: <049.b6be645ea57dbb71051ae75581b93595@osgeo.org> References: <049.b6be645ea57dbb71051ae75581b93595@osgeo.org> Message-ID: <064.16b5ffb4aa4e0a30ed62bd2cc87b5cfd@osgeo.org> #6055: Specify search_path carefully during extension install ----------------------+--------------------------- Reporter: pramsey | Owner: pramsey Type: defect | Status: closed Priority: high | Milestone: PostGIS 3.6.2 Component: postgis | Version: 3.2.x Resolution: fixed | Keywords: ----------------------+--------------------------- Comment (by Paul Ramsey ): In [changeset:"5ff3eaca52ba8db6d45e46c3b40c91b0b9c49248/git" 5ff3eac/git]: {{{#!CommitTicketReference repository="git" revision="5ff3eaca52ba8db6d45e46c3b40c91b0b9c49248" Function qualification improvements to avoid name squatting during upgrades References #6055 }}} -- Ticket URL: PostGIS The PostGIS Trac is used for bug, enhancement & task tracking, a user and developer wiki, and a view into the subversion code repository of PostGIS project. From git at osgeo.org Tue Mar 17 16:08:51 2026 From: git at osgeo.org (git at osgeo.org) Date: Tue, 17 Mar 2026 16:08:51 -0700 (PDT) Subject: [SCM] PostGIS branch stable-3.3 updated. 3.3.9-8-gd55c69743 Message-ID: <20260317230851.9EA2D1BF0A7@trac.osgeo.org> 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.3 has been updated via d55c697432e5023d99b9fa30e2b8e67ecfd23a4e (commit) from ad3d8e090666cf4822e6735c4288e75111aabcef (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 d55c697432e5023d99b9fa30e2b8e67ecfd23a4e Author: Paul Ramsey Date: Tue Mar 17 16:08:40 2026 -0700 Function qualification improvements to avoid name squatting during upgrades References #6055 diff --git a/extensions/postgis/Makefile.in b/extensions/postgis/Makefile.in index d79b0dfc3..bc5607010 100644 --- a/extensions/postgis/Makefile.in +++ b/extensions/postgis/Makefile.in @@ -141,8 +141,10 @@ sql/postgis_for_extension.sql: ../../postgis/postgis.sql.in ../../postgis_revisi | $(PERL) -pe 's/BEGIN\;//g ; s/COMMIT\;//g' > $@ sql/postgis_upgrade.sql: sql/postgis_upgrade_for_extension.sql | sql - $(PERL) -pe "s/BEGIN\;//g ; s/COMMIT\;//g; s/^(DROP .*)\;/SELECT postgis_extension_drop_if_exists('$(EXTENSION)', '\1');\n\1\;/" $< > $@ - + cat $< | \ + $(PERL) -lpe "s/BEGIN\;//g" | \ + $(PERL) -lpe "s/COMMIT\;//g" | \ + $(PERL) -lpe "s/^(DROP .*)\;/SELECT \@extschema\@.postgis_extension_drop_if_exists('$(EXTENSION)', '\1');\n\1\;/" > $@ sql/$(EXTENSION)--ANY--$(EXTVERSION).sql: $(EXTENSION_UPGRADE_SCRIPTS) | sql printf '\\echo Use "CREATE EXTENSION $(EXTENSION)" to load this file. \\quit\n' > $@ diff --git a/extensions/postgis_extension_helper.sql.in b/extensions/postgis_extension_helper.sql.in index b0f73015b..0d642fee8 100644 --- a/extensions/postgis_extension_helper.sql.in +++ b/extensions/postgis_extension_helper.sql.in @@ -19,7 +19,9 @@ CREATE FUNCTION postgis_extension_drop_if_exists(param_extension text, param_sta RETURNS boolean AS $$ DECLARE - var_sql_ext text := 'ALTER EXTENSION ' OPERATOR(pg_catalog.||) pg_catalog.quote_ident(param_extension) OPERATOR(pg_catalog.||) ' ' OPERATOR(pg_catalog.||) pg_catalog.replace(param_statement, 'IF EXISTS', ''); + var_sql_ext text := pg_catalog.format('ALTER EXTENSION %s %s', + pg_catalog.quote_ident(param_extension), + pg_catalog.replace(param_statement, 'IF EXISTS', '')); var_result boolean := false; BEGIN BEGIN @@ -27,13 +29,13 @@ BEGIN var_result := true; EXCEPTION WHEN OTHERS THEN - --this is to allow ignoring if the object does not exist in extension + -- This is to allow ignoring if the object does not exist in extension var_result := false; END; RETURN var_result; END; $$ -LANGUAGE plpgsql VOLATILE; +LANGUAGE 'plpgsql' VOLATILE; CREATE FUNCTION postgis_extension_AddToSearchPath(a_schema_name text) #include "libpgcommon/sql/AddToSearchPath.sql.inc" diff --git a/extensions/postgis_extension_helper_uninstall.sql b/extensions/postgis_extension_helper_uninstall.sql index 756dc80f8..c582d3511 100644 --- a/extensions/postgis_extension_helper_uninstall.sql +++ b/extensions/postgis_extension_helper_uninstall.sql @@ -13,6 +13,6 @@ -- -- This drops extension helper functions -- and should be called at the end of the extension upgrade file -DROP FUNCTION postgis_extension_drop_if_exists(text, text); +DROP FUNCTION IF EXISTS postgis_extension_drop_if_exists(text, text); DROP FUNCTION IF EXISTS postgis_extension_AddToSearchPath(varchar); DROP FUNCTION IF EXISTS postgis_extension_AddToSearchPath(text); diff --git a/extensions/postgis_raster/Makefile.in b/extensions/postgis_raster/Makefile.in index 18ff93746..18e87edb4 100644 --- a/extensions/postgis_raster/Makefile.in +++ b/extensions/postgis_raster/Makefile.in @@ -97,7 +97,10 @@ sql/rtpostgis_for_extension.sql: ../../raster/rt_pg/rtpostgis.sql.in ../../postg $(PERL) -lpe "s'MODULE_PATHNAME'\$(MODULEPATH)'g" > $@ sql/rtpostgis_upgrade.sql: sql/rtpostgis_upgrade_for_extension.sql | sql - $(PERL) -pe "s/BEGIN\;//g ; s/COMMIT\;//g; s/^(DROP .*)\;/SELECT postgis_extension_drop_if_exists('$(EXTENSION)', '\1');\n\1\;/" $< > $@ + cat $< | \ + $(PERL) -lpe "s/BEGIN\;//g" | \ + $(PERL) -lpe "s/COMMIT\;//g" | \ + $(PERL) -lpe "s/^(DROP .*)\;/SELECT \@extschema\@.postgis_extension_drop_if_exists('$(EXTENSION)', '\1');\n\1\;/" > $@ #this keeps the @extschema at . in place since extension machinery will replace during install sql/rtpostgis_upgrade_for_extension.sql: ../../raster/rt_pg/rtpostgis_upgrade_cleanup.sql sql/rtpostgis_upgrade_for_extension.sql.in ../../raster/rt_pg/rtpostgis_drop.sql | sql diff --git a/postgis/Makefile.in b/postgis/Makefile.in index 0bcb61b69..b4d77ef99 100644 --- a/postgis/Makefile.in +++ b/postgis/Makefile.in @@ -237,8 +237,10 @@ endif # and adding the version number # replace @extschema at . with nothing, this is only used as placeholder for extension install %.sql: %.sql.in - $(SQLPP) -I at top_srcdir@/libpgcommon -I at builddir@ $< | grep -v '^#' | \ - $(PERL) -lpe "s'MODULE_PATHNAME'\$(MODULEPATH)'g;s'@extschema@\.''g" > $@ + $(SQLPP) -I at top_srcdir@/libpgcommon -I at builddir@ $< | \ + grep -v '^#' | \ + $(PERL) -lpe "s'MODULE_PATHNAME'\$(MODULEPATH)'g" | \ + $(PERL) -lpe "s'@extschema@\.''g" > $@ #this is redundant but trying to fold in with extension just hangs postgis_upgrade.sql.in: postgis.sql ../utils/create_upgrade.pl diff --git a/utils/create_undef.pl b/utils/create_undef.pl index 4036801dc..1e72bdb50 100755 --- a/utils/create_undef.pl +++ b/utils/create_undef.pl @@ -287,10 +287,10 @@ DECLARE BEGIN FOR rec IN SELECT n.nspname, c.relname, a.attname, t.typname - FROM pg_attribute a - JOIN pg_class c ON a.attrelid = c.oid - JOIN pg_namespace n ON c.relnamespace = n.oid - JOIN pg_type t ON a.atttypid = t.oid + FROM pg_catalog.pg_attribute a + JOIN pg_catalog.pg_class c ON a.attrelid = c.oid + JOIN pg_catalog.pg_namespace n ON c.relnamespace = n.oid + JOIN pg_catalog.pg_type t ON a.atttypid = t.oid WHERE t.typname = '$type' AND NOT ( -- we exclude complexes defined as types @@ -398,16 +398,19 @@ DECLARE var_result text; var_search_path text; BEGIN - SELECT reset_val INTO var_search_path FROM pg_settings WHERE name = 'search_path'; - IF var_search_path NOT LIKE '%' || quote_ident(a_schema_name) || '%' THEN - var_result := a_schema_name || ' not in database search_path'; + SELECT reset_val INTO var_search_path FROM pg_catalog.pg_settings WHERE name = 'search_path'; + IF NOT var_search_path ~ pg_catalog.quote_ident(a_schema_name) THEN + var_result := pg_catalog.concat(a_schema_name, ' not in database search_path'); ELSE - var_search_path := btrim( regexp_replace( - replace(var_search_path, a_schema_name, ''), ', *,', ','), + var_search_path := pg_catalog.btrim( pg_catalog.regexp_replace( + pg_catalog.replace(var_search_path, a_schema_name, ''), ', *,', ','), ', '); RAISE NOTICE 'New search_path: %', var_search_path; - EXECUTE 'ALTER DATABASE ' || quote_ident(current_database()) || ' SET search_path = ' || var_search_path; - var_result := a_schema_name || ' has been stripped off database search_path '; + EXECUTE pg_catalog.Format( + 'ALTER DATABASE %s SET search_path = %s', + pg_catalog.quote_ident(current_database()), + var_search_path); + var_result := pg_catalog.concat(a_schema_name, ' has been stripped off database search_path '); END IF; RETURN var_result; diff --git a/utils/create_upgrade.pl b/utils/create_upgrade.pl index d983068d0..f6c702484 100755 --- a/utils/create_upgrade.pl +++ b/utils/create_upgrade.pl @@ -117,10 +117,18 @@ while() #last; } + elsif (/CREATE SCHEMA topology/) + { + $module = 'postgis_topology'; + } elsif (/TYPE raster/) { $module = 'postgis_raster'; } + elsif (/FUNCTION postgis_sfcgal_noop/) + { + $module = 'postgis_sfcgal'; + } elsif (m@('\$libdir/[^']*')@) { $soname = $1; ----------------------------------------------------------------------- Summary of changes: extensions/postgis/Makefile.in | 6 ++++-- extensions/postgis_extension_helper.sql.in | 8 +++++--- extensions/postgis_extension_helper_uninstall.sql | 2 +- extensions/postgis_raster/Makefile.in | 5 ++++- postgis/Makefile.in | 6 ++++-- utils/create_undef.pl | 25 +++++++++++++---------- utils/create_upgrade.pl | 8 ++++++++ 7 files changed, 40 insertions(+), 20 deletions(-) hooks/post-receive -- PostGIS From trac at osgeo.org Tue Mar 17 16:08:53 2026 From: trac at osgeo.org (PostGIS) Date: Tue, 17 Mar 2026 23:08:53 -0000 Subject: [PostGIS] #6055: Specify search_path carefully during extension install In-Reply-To: <049.b6be645ea57dbb71051ae75581b93595@osgeo.org> References: <049.b6be645ea57dbb71051ae75581b93595@osgeo.org> Message-ID: <064.3f5b72bcc6be4121f34f4aec9b81c6a7@osgeo.org> #6055: Specify search_path carefully during extension install ----------------------+--------------------------- Reporter: pramsey | Owner: pramsey Type: defect | Status: closed Priority: high | Milestone: PostGIS 3.6.2 Component: postgis | Version: 3.2.x Resolution: fixed | Keywords: ----------------------+--------------------------- Comment (by Paul Ramsey ): In [changeset:"d55c697432e5023d99b9fa30e2b8e67ecfd23a4e/git" d55c697/git]: {{{#!CommitTicketReference repository="git" revision="d55c697432e5023d99b9fa30e2b8e67ecfd23a4e" Function qualification improvements to avoid name squatting during upgrades References #6055 }}} -- Ticket URL: PostGIS The PostGIS Trac is used for bug, enhancement & task tracking, a user and developer wiki, and a view into the subversion code repository of PostGIS project. From git at osgeo.org Tue Mar 17 16:08:59 2026 From: git at osgeo.org (git at osgeo.org) Date: Tue, 17 Mar 2026 16:08:59 -0700 (PDT) Subject: [SCM] PostGIS branch stable-3.4 updated. 3.4.5-10-g05b736d08 Message-ID: <20260317230859.7B8B71BF0A8@trac.osgeo.org> 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.4 has been updated via 05b736d089ae4bc3bdc148eb4fe58e5764a18cd7 (commit) from 3da3457c1ecd4cfc7cd079eb29dfdcac2d5198a8 (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 05b736d089ae4bc3bdc148eb4fe58e5764a18cd7 Author: Paul Ramsey Date: Tue Mar 17 16:08:19 2026 -0700 Function qualification improvements to avoid name squatting during upgrades References #6055 diff --git a/extensions/postgis/Makefile.in b/extensions/postgis/Makefile.in index 21d072b27..4814afe36 100644 --- a/extensions/postgis/Makefile.in +++ b/extensions/postgis/Makefile.in @@ -134,8 +134,10 @@ sql/postgis_for_extension.sql: ../../postgis/postgis.sql.in ../../postgis_revisi rm -f $@.tmp sql/postgis_upgrade.sql: sql/postgis_upgrade_for_extension.sql | sql - $(PERL) -pe "s/BEGIN\;//g ; s/COMMIT\;//g; s/^(DROP .*)\;/SELECT postgis_extension_drop_if_exists('$(EXTENSION)', '\1');\n\1\;/" $< > $@ - + cat $< | \ + $(PERL) -lpe "s/BEGIN\;//g" | \ + $(PERL) -lpe "s/COMMIT\;//g" | \ + $(PERL) -lpe "s/^(DROP .*)\;/SELECT \@extschema\@.postgis_extension_drop_if_exists('$(EXTENSION)', '\1');\n\1\;/" > $@ sql/$(EXTENSION)--ANY--$(EXTVERSION).sql: $(EXTENSION_UPGRADE_SCRIPTS) | sql printf '\\echo Use "CREATE EXTENSION $(EXTENSION)" to load this file. \\quit\n' > $@ diff --git a/extensions/postgis_extension_helper.sql.in b/extensions/postgis_extension_helper.sql.in index b0f73015b..0d642fee8 100644 --- a/extensions/postgis_extension_helper.sql.in +++ b/extensions/postgis_extension_helper.sql.in @@ -19,7 +19,9 @@ CREATE FUNCTION postgis_extension_drop_if_exists(param_extension text, param_sta RETURNS boolean AS $$ DECLARE - var_sql_ext text := 'ALTER EXTENSION ' OPERATOR(pg_catalog.||) pg_catalog.quote_ident(param_extension) OPERATOR(pg_catalog.||) ' ' OPERATOR(pg_catalog.||) pg_catalog.replace(param_statement, 'IF EXISTS', ''); + var_sql_ext text := pg_catalog.format('ALTER EXTENSION %s %s', + pg_catalog.quote_ident(param_extension), + pg_catalog.replace(param_statement, 'IF EXISTS', '')); var_result boolean := false; BEGIN BEGIN @@ -27,13 +29,13 @@ BEGIN var_result := true; EXCEPTION WHEN OTHERS THEN - --this is to allow ignoring if the object does not exist in extension + -- This is to allow ignoring if the object does not exist in extension var_result := false; END; RETURN var_result; END; $$ -LANGUAGE plpgsql VOLATILE; +LANGUAGE 'plpgsql' VOLATILE; CREATE FUNCTION postgis_extension_AddToSearchPath(a_schema_name text) #include "libpgcommon/sql/AddToSearchPath.sql.inc" diff --git a/extensions/postgis_extension_helper_uninstall.sql b/extensions/postgis_extension_helper_uninstall.sql index 756dc80f8..c582d3511 100644 --- a/extensions/postgis_extension_helper_uninstall.sql +++ b/extensions/postgis_extension_helper_uninstall.sql @@ -13,6 +13,6 @@ -- -- This drops extension helper functions -- and should be called at the end of the extension upgrade file -DROP FUNCTION postgis_extension_drop_if_exists(text, text); +DROP FUNCTION IF EXISTS postgis_extension_drop_if_exists(text, text); DROP FUNCTION IF EXISTS postgis_extension_AddToSearchPath(varchar); DROP FUNCTION IF EXISTS postgis_extension_AddToSearchPath(text); diff --git a/extensions/postgis_raster/Makefile.in b/extensions/postgis_raster/Makefile.in index 25ade7d21..f69f053a7 100644 --- a/extensions/postgis_raster/Makefile.in +++ b/extensions/postgis_raster/Makefile.in @@ -99,7 +99,10 @@ sql/rtpostgis_for_extension.sql: ../../raster/rt_pg/rtpostgis.sql.in ../../postg rm -f $@.tmp sql/rtpostgis_upgrade.sql: sql/rtpostgis_upgrade_for_extension.sql | sql - $(PERL) -pe "s/BEGIN\;//g ; s/COMMIT\;//g; s/^(DROP .*)\;/SELECT postgis_extension_drop_if_exists('$(EXTENSION)', '\1');\n\1\;/" $< > $@ + cat $< | \ + $(PERL) -lpe "s/BEGIN\;//g" | \ + $(PERL) -lpe "s/COMMIT\;//g" | \ + $(PERL) -lpe "s/^(DROP .*)\;/SELECT \@extschema\@.postgis_extension_drop_if_exists('$(EXTENSION)', '\1');\n\1\;/" > $@ #this keeps the @extschema at . in place since extension machinery will replace during install sql/rtpostgis_upgrade_for_extension.sql: ../../postgis/common_before_upgrade.sql ../../raster/rt_pg/rtpostgis_upgrade_cleanup.sql sql/rtpostgis_upgrade_for_extension.sql.in ../../raster/rt_pg/rtpostgis_drop.sql ../../postgis/common_after_upgrade.sql | sql diff --git a/postgis/Makefile.in b/postgis/Makefile.in index 0e972da7e..4f581b626 100644 --- a/postgis/Makefile.in +++ b/postgis/Makefile.in @@ -242,14 +242,15 @@ endif # %.sql: %.sql.in $(SQLPP) -I at top_srcdir@/libpgcommon -I at builddir@ $< > $@.tmp - grep -v '^#' $@.tmp | $(PERL) -lpe "s'MODULE_PATHNAME'\$(MODULEPATH)'g;s'@extschema@\.''g" > $@ + grep -v '^#' $@.tmp | \ + $(PERL) -lpe "s'MODULE_PATHNAME'\$(MODULEPATH)'g" | \ + $(PERL) -lpe "s'@extschema@\.''g" > $@ rm -f $@.tmp #this is redundant but trying to fold in with extension just hangs postgis_upgrade.sql.in: postgis.sql ../utils/create_upgrade.pl $(PERL) @top_srcdir@/utils/create_upgrade.pl $< > $@ - postgis_upgrade.sql: common_before_upgrade.sql postgis_before_upgrade.sql postgis_upgrade.sql.in postgis_after_upgrade.sql common_after_upgrade.sql echo "BEGIN;" > $@ cat $^ >> $@ diff --git a/postgis/common_before_upgrade.sql b/postgis/common_before_upgrade.sql index 6492a5778..9b522e4c5 100644 --- a/postgis/common_before_upgrade.sql +++ b/postgis/common_before_upgrade.sql @@ -42,7 +42,7 @@ DECLARE postgis_namespace OID; matching_function pg_catalog.pg_proc; detail TEXT; - deprecated_suffix TEXT := '_deprecated_by_postgis_' || deprecated_in_version; + deprecated_suffix TEXT := pg_catalog.concat('_deprecated_by_postgis_', deprecated_in_version); BEGIN -- Fetch install namespace for PostGIS @@ -56,15 +56,15 @@ BEGIN SELECT * FROM pg_catalog.pg_proc p WHERE pronamespace = postgis_namespace - AND pg_catalog.LOWER(p.proname) = pg_catalog.LOWER(function_name) + AND p.proname ILIKE function_name AND pg_catalog.pg_function_is_visible(p.oid) - AND pg_catalog.LOWER(pg_catalog.pg_get_function_identity_arguments(p.oid)) = pg_catalog.LOWER(function_arguments) + AND pg_catalog.pg_get_function_identity_arguments(p.oid) ILIKE function_arguments INTO matching_function; IF matching_function.oid IS NOT NULL THEN - sql := format('ALTER FUNCTION %s RENAME TO %I', + sql := pg_catalog.format('ALTER FUNCTION %s RENAME TO %I', matching_function.oid::regprocedure, - matching_function.proname || deprecated_suffix + pg_catalog.concat(matching_function.proname, deprecated_suffix) ); RAISE DEBUG 'SQL query: %', sql; BEGIN @@ -79,7 +79,7 @@ BEGIN END IF; END; -$$ LANGUAGE plpgsql; +$$ LANGUAGE 'plpgsql'; CREATE OR REPLACE FUNCTION _postgis_drop_function_by_signature( function_signature text, @@ -90,7 +90,7 @@ DECLARE detail TEXT; newname TEXT; proc RECORD; - deprecated_suffix TEXT := '_deprecated_by_postgis_' || deprecated_in_version; + deprecated_suffix TEXT := pg_catalog.concat('_deprecated_by_postgis_', deprecated_in_version); BEGIN -- Check if the deprecated function exists @@ -116,7 +116,7 @@ BEGIN sql := pg_catalog.format( 'ALTER FUNCTION %s RENAME TO %I', proc.oid::regprocedure, - proc.proname || deprecated_suffix + pg_catalog.concat(proc.proname, deprecated_suffix) ); EXECUTE sql; diff --git a/utils/create_uninstall.pl b/utils/create_uninstall.pl index 1f351e362..4e3985b65 100755 --- a/utils/create_uninstall.pl +++ b/utils/create_uninstall.pl @@ -287,10 +287,10 @@ DECLARE BEGIN FOR rec IN SELECT n.nspname, c.relname, a.attname, t.typname - FROM pg_attribute a - JOIN pg_class c ON a.attrelid = c.oid - JOIN pg_namespace n ON c.relnamespace = n.oid - JOIN pg_type t ON a.atttypid = t.oid + FROM pg_catalog.pg_attribute a + JOIN pg_catalog.pg_class c ON a.attrelid = c.oid + JOIN pg_catalog.pg_namespace n ON c.relnamespace = n.oid + JOIN pg_catalog.pg_type t ON a.atttypid = t.oid WHERE t.typname = '$type' AND NOT ( -- we exclude complexes defined as types @@ -398,16 +398,16 @@ DECLARE var_result text; var_search_path text; BEGIN - SELECT reset_val INTO var_search_path FROM pg_settings WHERE name = 'search_path'; - IF var_search_path NOT LIKE '%' || quote_ident(a_schema_name) || '%' THEN + SELECT reset_val INTO var_search_path FROM pg_catalog.pg_settings WHERE name = 'search_path'; + IF NOT var_search_path ~ pg_catalog.quote_ident(a_schema_name) THEN var_result := a_schema_name || ' not in database search_path'; ELSE - var_search_path := btrim( regexp_replace( - replace(var_search_path, a_schema_name, ''), ', *,', ','), + var_search_path := pg_catalog.btrim( pg_catalog.regexp_replace( + pg_catalog.replace(var_search_path, a_schema_name, ''), ', *,', ','), ', '); RAISE NOTICE 'New search_path: %', var_search_path; - EXECUTE 'ALTER DATABASE ' || quote_ident(current_database()) || ' SET search_path = ' || var_search_path; - var_result := a_schema_name || ' has been stripped off database search_path '; + EXECUTE pg_catalog.Format('ALTER DATABASE %s SET search_path = %s', pg_catalog.quote_ident(current_database()), var_search_path); + var_result := pg_catalog.Concat(a_schema_name, ' has been stripped off database search_path '); END IF; RETURN var_result; diff --git a/utils/create_upgrade.pl b/utils/create_upgrade.pl index 3920ffaa4..a34183ee9 100755 --- a/utils/create_upgrade.pl +++ b/utils/create_upgrade.pl @@ -117,10 +117,18 @@ while() #last; } + elsif (/CREATE SCHEMA topology/) + { + $module = 'postgis_topology'; + } elsif (/TYPE raster/) { $module = 'postgis_raster'; } + elsif (/FUNCTION postgis_sfcgal_noop/) + { + $module = 'postgis_sfcgal'; + } elsif (m@('\$libdir/[^']*')@) { $soname = $1; ----------------------------------------------------------------------- Summary of changes: extensions/postgis/Makefile.in | 6 ++++-- extensions/postgis_extension_helper.sql.in | 8 +++++--- extensions/postgis_extension_helper_uninstall.sql | 2 +- extensions/postgis_raster/Makefile.in | 5 ++++- postgis/Makefile.in | 5 +++-- postgis/common_before_upgrade.sql | 16 ++++++++-------- utils/create_uninstall.pl | 20 ++++++++++---------- utils/create_upgrade.pl | 8 ++++++++ 8 files changed, 43 insertions(+), 27 deletions(-) hooks/post-receive -- PostGIS From trac at osgeo.org Tue Mar 17 16:09:00 2026 From: trac at osgeo.org (PostGIS) Date: Tue, 17 Mar 2026 23:09:00 -0000 Subject: [PostGIS] #6055: Specify search_path carefully during extension install In-Reply-To: <049.b6be645ea57dbb71051ae75581b93595@osgeo.org> References: <049.b6be645ea57dbb71051ae75581b93595@osgeo.org> Message-ID: <064.069dd74221e9e6b04df3a04a6588d6b5@osgeo.org> #6055: Specify search_path carefully during extension install ----------------------+--------------------------- Reporter: pramsey | Owner: pramsey Type: defect | Status: closed Priority: high | Milestone: PostGIS 3.6.2 Component: postgis | Version: 3.2.x Resolution: fixed | Keywords: ----------------------+--------------------------- Comment (by Paul Ramsey ): In [changeset:"05b736d089ae4bc3bdc148eb4fe58e5764a18cd7/git" 05b736d0/git]: {{{#!CommitTicketReference repository="git" revision="05b736d089ae4bc3bdc148eb4fe58e5764a18cd7" Function qualification improvements to avoid name squatting during upgrades References #6055 }}} -- Ticket URL: PostGIS The PostGIS Trac is used for bug, enhancement & task tracking, a user and developer wiki, and a view into the subversion code repository of PostGIS project. From git at osgeo.org Tue Mar 17 16:09:03 2026 From: git at osgeo.org (git at osgeo.org) Date: Tue, 17 Mar 2026 16:09:03 -0700 (PDT) Subject: [SCM] PostGIS branch stable-3.5 updated. 3.5.5-7-gb4e40c47a Message-ID: <20260317230904.0469E1BF190@trac.osgeo.org> 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.5 has been updated via b4e40c47a3577d09fe455e84d2c330ddd04d273e (commit) from 6bdb14bb6657d23af50057551935aac2d101e901 (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 b4e40c47a3577d09fe455e84d2c330ddd04d273e Author: Paul Ramsey Date: Tue Mar 17 16:07:56 2026 -0700 Function qualification improvements to avoid name squatting during upgrades References #6055 diff --git a/extensions/postgis/Makefile.in b/extensions/postgis/Makefile.in index 537a501a7..88ef35afd 100644 --- a/extensions/postgis/Makefile.in +++ b/extensions/postgis/Makefile.in @@ -129,8 +129,10 @@ sql/postgis_for_extension.sql: ../../postgis/postgis.sql.in ../../postgis_revisi rm -f $@.tmp sql/postgis_upgrade.sql: sql/postgis_upgrade_for_extension.sql | sql - $(PERL) -pe "s/BEGIN\;//g ; s/COMMIT\;//g; s/^(DROP .*)\;/SELECT postgis_extension_drop_if_exists('$(EXTENSION)', '\1');\n\1\;/" $< > $@ - + cat $< | \ + $(PERL) -lpe "s/BEGIN\;//g" | \ + $(PERL) -lpe "s/COMMIT\;//g" | \ + $(PERL) -lpe "s/^(DROP .*)\;/SELECT \@extschema\@.postgis_extension_drop_if_exists('$(EXTENSION)', '\1');\n\1\;/" > $@ sql/$(EXTENSION)--ANY--$(EXTVERSION).sql: $(EXTENSION_UPGRADE_SCRIPTS) | sql printf '\\echo Use "CREATE EXTENSION $(EXTENSION)" to load this file. \\quit\n' > $@ diff --git a/extensions/postgis_extension_helper.sql.in b/extensions/postgis_extension_helper.sql.in index 0a80726ad..bf9265b13 100644 --- a/extensions/postgis_extension_helper.sql.in +++ b/extensions/postgis_extension_helper.sql.in @@ -19,7 +19,9 @@ CREATE FUNCTION postgis_extension_drop_if_exists(param_extension text, param_sta RETURNS boolean AS $$ DECLARE - var_sql_ext text := 'ALTER EXTENSION ' OPERATOR(pg_catalog.||) pg_catalog.quote_ident(param_extension) OPERATOR(pg_catalog.||) ' ' OPERATOR(pg_catalog.||) pg_catalog.replace(param_statement, 'IF EXISTS', ''); + var_sql_ext text := pg_catalog.format('ALTER EXTENSION %s %s', + pg_catalog.quote_ident(param_extension), + pg_catalog.replace(param_statement, 'IF EXISTS', '')); var_result boolean := false; BEGIN BEGIN @@ -27,13 +29,13 @@ BEGIN var_result := true; EXCEPTION WHEN OTHERS THEN - --this is to allow ignoring if the object does not exist in extension + -- This is to allow ignoring if the object does not exist in extension var_result := false; END; RETURN var_result; END; $$ -LANGUAGE plpgsql VOLATILE; +LANGUAGE 'plpgsql' VOLATILE; CREATE FUNCTION postgis_extension_AddToSearchPath(a_schema_name text) #include "libpgcommon/sql/AddToSearchPath.sql.inc" diff --git a/extensions/postgis_extension_helper_uninstall.sql b/extensions/postgis_extension_helper_uninstall.sql index 756dc80f8..c582d3511 100644 --- a/extensions/postgis_extension_helper_uninstall.sql +++ b/extensions/postgis_extension_helper_uninstall.sql @@ -13,6 +13,6 @@ -- -- This drops extension helper functions -- and should be called at the end of the extension upgrade file -DROP FUNCTION postgis_extension_drop_if_exists(text, text); +DROP FUNCTION IF EXISTS postgis_extension_drop_if_exists(text, text); DROP FUNCTION IF EXISTS postgis_extension_AddToSearchPath(varchar); DROP FUNCTION IF EXISTS postgis_extension_AddToSearchPath(text); diff --git a/extensions/postgis_raster/Makefile.in b/extensions/postgis_raster/Makefile.in index b174746f9..857ce15de 100644 --- a/extensions/postgis_raster/Makefile.in +++ b/extensions/postgis_raster/Makefile.in @@ -97,7 +97,10 @@ sql/rtpostgis_for_extension.sql: ../../raster/rt_pg/rtpostgis.sql.in ../../postg rm -f $@.tmp sql/rtpostgis_upgrade.sql: sql/rtpostgis_upgrade_for_extension.sql | sql - $(PERL) -pe "s/BEGIN\;//g ; s/COMMIT\;//g; s/^(DROP .*)\;/SELECT postgis_extension_drop_if_exists('$(EXTENSION)', '\1');\n\1\;/" $< > $@ + cat $< | \ + $(PERL) -lpe "s/BEGIN\;//g" | \ + $(PERL) -lpe "s/COMMIT\;//g" | \ + $(PERL) -lpe "s/^(DROP .*)\;/SELECT \@extschema\@.postgis_extension_drop_if_exists('$(EXTENSION)', '\1');\n\1\;/" > $@ #this keeps the @extschema at . in place since extension machinery will replace during install sql/rtpostgis_upgrade_for_extension.sql: ../../postgis/common_before_upgrade.sql ../../raster/rt_pg/rtpostgis_upgrade_cleanup.sql sql/rtpostgis_upgrade_for_extension.sql.in ../../raster/rt_pg/rtpostgis_drop.sql ../../postgis/common_after_upgrade.sql | sql diff --git a/postgis/Makefile.in b/postgis/Makefile.in index 67feb698d..862d0ee37 100644 --- a/postgis/Makefile.in +++ b/postgis/Makefile.in @@ -241,14 +241,15 @@ endif # %.sql: %.sql.in $(SQLPP) -I at top_srcdir@/libpgcommon -I at builddir@ $< > $@.tmp - grep -v '^#' $@.tmp | $(PERL) -lpe "s'MODULE_PATHNAME'\$(MODULEPATH)'g;s'@extschema@\.''g" > $@ + grep -v '^#' $@.tmp | \ + $(PERL) -lpe "s'MODULE_PATHNAME'\$(MODULEPATH)'g" | \ + $(PERL) -lpe "s'@extschema@\.''g" > $@ rm -f $@.tmp #this is redundant but trying to fold in with extension just hangs postgis_upgrade.sql.in: postgis.sql ../utils/create_upgrade.pl $(PERL) @top_srcdir@/utils/create_upgrade.pl $< > $@ - postgis_upgrade.sql: common_before_upgrade.sql postgis_before_upgrade.sql postgis_upgrade.sql.in postgis_after_upgrade.sql common_after_upgrade.sql echo "BEGIN;" > $@ cat $^ >> $@ diff --git a/postgis/common_before_upgrade.sql b/postgis/common_before_upgrade.sql index e5ca13f26..2beaed910 100644 --- a/postgis/common_before_upgrade.sql +++ b/postgis/common_before_upgrade.sql @@ -42,7 +42,7 @@ DECLARE postgis_namespace OID; matching_function pg_catalog.pg_proc; detail TEXT; - deprecated_suffix TEXT := '_deprecated_by_postgis_' || deprecated_in_version; + deprecated_suffix TEXT := pg_catalog.concat('_deprecated_by_postgis_', deprecated_in_version); BEGIN -- Fetch install namespace for PostGIS @@ -56,15 +56,15 @@ BEGIN SELECT * FROM pg_catalog.pg_proc p WHERE pronamespace = postgis_namespace - AND pg_catalog.LOWER(p.proname) = pg_catalog.LOWER(function_name) + AND p.proname ILIKE function_name AND pg_catalog.pg_function_is_visible(p.oid) - AND pg_catalog.LOWER(pg_catalog.pg_get_function_identity_arguments(p.oid)) = pg_catalog.LOWER(function_arguments) + AND pg_catalog.pg_get_function_identity_arguments(p.oid) ILIKE function_arguments INTO matching_function; IF matching_function.oid IS NOT NULL THEN - sql := format('ALTER FUNCTION %s RENAME TO %I', + sql := pg_catalog.format('ALTER FUNCTION %s RENAME TO %I', matching_function.oid::regprocedure, - matching_function.proname || deprecated_suffix + pg_catalog.concat(matching_function.proname, deprecated_suffix) ); RAISE DEBUG 'SQL query: %', sql; BEGIN @@ -79,7 +79,7 @@ BEGIN END IF; END; -$$ LANGUAGE plpgsql; +$$ LANGUAGE 'plpgsql'; CREATE OR REPLACE FUNCTION _postgis_drop_function_by_signature( function_signature text, @@ -90,7 +90,7 @@ DECLARE detail TEXT; newname TEXT; proc RECORD; - deprecated_suffix TEXT := '_deprecated_by_postgis_' || deprecated_in_version; + deprecated_suffix TEXT := pg_catalog.concat('_deprecated_by_postgis_', deprecated_in_version); BEGIN -- Check if the deprecated function exists @@ -116,7 +116,7 @@ BEGIN sql := pg_catalog.format( 'ALTER FUNCTION %s RENAME TO %I', proc.oid::regprocedure, - proc.proname || deprecated_suffix + pg_catalog.concat(proc.proname, deprecated_suffix) ); EXECUTE sql; diff --git a/utils/create_uninstall.pl b/utils/create_uninstall.pl index 1f351e362..4e3985b65 100755 --- a/utils/create_uninstall.pl +++ b/utils/create_uninstall.pl @@ -287,10 +287,10 @@ DECLARE BEGIN FOR rec IN SELECT n.nspname, c.relname, a.attname, t.typname - FROM pg_attribute a - JOIN pg_class c ON a.attrelid = c.oid - JOIN pg_namespace n ON c.relnamespace = n.oid - JOIN pg_type t ON a.atttypid = t.oid + FROM pg_catalog.pg_attribute a + JOIN pg_catalog.pg_class c ON a.attrelid = c.oid + JOIN pg_catalog.pg_namespace n ON c.relnamespace = n.oid + JOIN pg_catalog.pg_type t ON a.atttypid = t.oid WHERE t.typname = '$type' AND NOT ( -- we exclude complexes defined as types @@ -398,16 +398,16 @@ DECLARE var_result text; var_search_path text; BEGIN - SELECT reset_val INTO var_search_path FROM pg_settings WHERE name = 'search_path'; - IF var_search_path NOT LIKE '%' || quote_ident(a_schema_name) || '%' THEN + SELECT reset_val INTO var_search_path FROM pg_catalog.pg_settings WHERE name = 'search_path'; + IF NOT var_search_path ~ pg_catalog.quote_ident(a_schema_name) THEN var_result := a_schema_name || ' not in database search_path'; ELSE - var_search_path := btrim( regexp_replace( - replace(var_search_path, a_schema_name, ''), ', *,', ','), + var_search_path := pg_catalog.btrim( pg_catalog.regexp_replace( + pg_catalog.replace(var_search_path, a_schema_name, ''), ', *,', ','), ', '); RAISE NOTICE 'New search_path: %', var_search_path; - EXECUTE 'ALTER DATABASE ' || quote_ident(current_database()) || ' SET search_path = ' || var_search_path; - var_result := a_schema_name || ' has been stripped off database search_path '; + EXECUTE pg_catalog.Format('ALTER DATABASE %s SET search_path = %s', pg_catalog.quote_ident(current_database()), var_search_path); + var_result := pg_catalog.Concat(a_schema_name, ' has been stripped off database search_path '); END IF; RETURN var_result; diff --git a/utils/create_upgrade.pl b/utils/create_upgrade.pl index 3920ffaa4..a34183ee9 100755 --- a/utils/create_upgrade.pl +++ b/utils/create_upgrade.pl @@ -117,10 +117,18 @@ while() #last; } + elsif (/CREATE SCHEMA topology/) + { + $module = 'postgis_topology'; + } elsif (/TYPE raster/) { $module = 'postgis_raster'; } + elsif (/FUNCTION postgis_sfcgal_noop/) + { + $module = 'postgis_sfcgal'; + } elsif (m@('\$libdir/[^']*')@) { $soname = $1; ----------------------------------------------------------------------- Summary of changes: extensions/postgis/Makefile.in | 6 ++++-- extensions/postgis_extension_helper.sql.in | 8 +++++--- extensions/postgis_extension_helper_uninstall.sql | 2 +- extensions/postgis_raster/Makefile.in | 5 ++++- postgis/Makefile.in | 5 +++-- postgis/common_before_upgrade.sql | 16 ++++++++-------- utils/create_uninstall.pl | 20 ++++++++++---------- utils/create_upgrade.pl | 8 ++++++++ 8 files changed, 43 insertions(+), 27 deletions(-) hooks/post-receive -- PostGIS From trac at osgeo.org Tue Mar 17 16:09:05 2026 From: trac at osgeo.org (PostGIS) Date: Tue, 17 Mar 2026 23:09:05 -0000 Subject: [PostGIS] #6055: Specify search_path carefully during extension install In-Reply-To: <049.b6be645ea57dbb71051ae75581b93595@osgeo.org> References: <049.b6be645ea57dbb71051ae75581b93595@osgeo.org> Message-ID: <064.0a2e8e068b5f9548709446acdb9951f3@osgeo.org> #6055: Specify search_path carefully during extension install ----------------------+--------------------------- Reporter: pramsey | Owner: pramsey Type: defect | Status: closed Priority: high | Milestone: PostGIS 3.6.2 Component: postgis | Version: 3.2.x Resolution: fixed | Keywords: ----------------------+--------------------------- Comment (by Paul Ramsey ): In [changeset:"b4e40c47a3577d09fe455e84d2c330ddd04d273e/git" b4e40c4/git]: {{{#!CommitTicketReference repository="git" revision="b4e40c47a3577d09fe455e84d2c330ddd04d273e" Function qualification improvements to avoid name squatting during upgrades References #6055 }}} -- Ticket URL: PostGIS The PostGIS Trac is used for bug, enhancement & task tracking, a user and developer wiki, and a view into the subversion code repository of PostGIS project. From git at osgeo.org Wed Mar 18 09:33:29 2026 From: git at osgeo.org (git at osgeo.org) Date: Wed, 18 Mar 2026 09:33:29 -0700 (PDT) Subject: [SCM] PostGIS branch master updated. 3.6.0rc2-400-gc4426d4ba Message-ID: <20260318163330.1AC4B1C0E33@trac.osgeo.org> 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 c4426d4baaaed9a3e8ba6fbab2a05ba962dccdea (commit) via 4fab474e4961ba69d847151133fdfa991414bc58 (commit) from cf949fa33a6bd0d5b64136ec518320a4bb237bd0 (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 c4426d4baaaed9a3e8ba6fbab2a05ba962dccdea Merge: cf949fa33 4fab474e4 Author: Paul Ramsey Date: Wed Mar 18 09:33:25 2026 -0700 Merge branch 'a8m-readonlyspi' commit 4fab474e4961ba69d847151133fdfa991414bc58 Author: Ariel Mashraki Date: Wed Mar 18 13:03:43 2026 +0200 Use read-only SPI execution for user-supplied expressions in ST_MapAlgebraExpr diff --git a/raster/rt_pg/rtpg_mapalgebra.c b/raster/rt_pg/rtpg_mapalgebra.c index a97d98f0f..8a0e0516d 100644 --- a/raster/rt_pg/rtpg_mapalgebra.c +++ b/raster/rt_pg/rtpg_mapalgebra.c @@ -4935,7 +4935,7 @@ Datum RASTER_mapAlgebraExpr(PG_FUNCTION_ARGS) }; /* Execute the expression into newval */ - ret = SPI_execute(initexpr, FALSE, 0); + ret = SPI_execute(initexpr, TRUE, 0); if (ret != SPI_OK_SELECT || SPI_tuptable == NULL || SPI_processed != 1) { @@ -5165,7 +5165,7 @@ Datum RASTER_mapAlgebraExpr(PG_FUNCTION_ARGS) } - ret = SPI_execute_plan(spi_plan, values, nulls, FALSE, 0); + ret = SPI_execute_plan(spi_plan, values, nulls, TRUE, 0); if (ret != SPI_OK_SELECT || SPI_tuptable == NULL || SPI_processed != 1) { if (SPI_tuptable) diff --git a/raster/test/regress/rt_mapalgebra_expr.sql b/raster/test/regress/rt_mapalgebra_expr.sql index 78f90bb21..e1dd3a5a7 100644 --- a/raster/test/regress/rt_mapalgebra_expr.sql +++ b/raster/test/regress/rt_mapalgebra_expr.sql @@ -160,6 +160,39 @@ SELECT 'T12', '[rast.x]' ) AS rast; +-- Test read-only expression (prepared plan path via [rast.val]) +CREATE TABLE _rast_dml_guard (id int); +SELECT 'T13', ST_MapAlgebraExpr( + ST_AddBand(ST_MakeEmptyRaster(1, 1, 0, 0, 1, 1, 0, 0, 0), '8BUI'::text, 1, 0), + 1, '8BUI'::text, + '[rast.val])::double precision; INSERT INTO _rast_dml_guard VALUES(1); SELECT (1'::text, + NULL::double precision +) IS NULL; +DROP TABLE _rast_dml_guard; + +-- Test read-only expression blocks COPY TO PROGRAM (constant expression path) +SELECT 'T14', ST_MapAlgebraExpr( + ST_AddBand(ST_MakeEmptyRaster(1, 1, 0, 0, 1, 1, 0, 0, 0), '8BUI'::text, 1, 0), + 1, '8BUI'::text, + '1)::double precision; COPY (SELECT 1) TO PROGRAM ''touch /tmp/pwned''--'::text, + NULL::double precision +) IS NULL; + +-- Parameterized queries do not prevent injection; expression is concatenated inside SPI_execute. +CREATE TABLE _rast_drop_guard (id int); +PREPARE _rast_safe_query(raster, int, text, text, float8) AS + SELECT ST_MapAlgebraExpr($1, $2, $3, $4, $5); +EXECUTE _rast_safe_query( + ST_AddBand(ST_MakeEmptyRaster(1,1,0,0,1,1,0,0,0), '8BUI'::text, 1, 0), + 1, '8BUI', + '1)::double precision FROM generate_series(1,1); DROP TABLE _rast_drop_guard; SELECT (1', + NULL +); +DEALLOCATE _rast_safe_query; +-- Table must still exist after the blocked DROP +SELECT 'T15', COUNT(*) = 0 FROM _rast_drop_guard; +DROP TABLE _rast_drop_guard; + DROP FUNCTION ST_TestRaster(ulx float8, uly float8, val float8); DROP FUNCTION raster_plus_twenty(pixel FLOAT, VARIADIC args TEXT[]); DROP FUNCTION raster_plus_arg1(pixel FLOAT, VARIADIC args TEXT[]); diff --git a/raster/test/regress/rt_mapalgebra_expr_expected b/raster/test/regress/rt_mapalgebra_expr_expected index dccd7fc46..e6974dfbc 100644 --- a/raster/test/regress/rt_mapalgebra_expr_expected +++ b/raster/test/regress/rt_mapalgebra_expr_expected @@ -22,6 +22,10 @@ ERROR: rtpg_nmapalgebraexpr_callback: rast2 argument specified in single-raster T11.1|10|2 T11.2|10|2 T12|t|t|t|t +ERROR: INSERT is not allowed in a non-volatile function +ERROR: COPY is not allowed in a non-volatile function +ERROR: DROP TABLE is not allowed in a non-volatile function +T15|t 0|1|INTERSECTION|0.000|0.000|2|2|1.000|1.000|0.000|0.000|0|1|32BF|0.000|1.000|1.000 0|2|INTERSECTION|1.000|-1.000|1|2|1.000|1.000|0.000|0.000|0|1|32BF|0.000|1.000|1.000 0|3|INTERSECTION|1.000|1.000|1|1|1.000|1.000|0.000|0.000|0|1|32BF|0.000|1.000|1.000 ----------------------------------------------------------------------- Summary of changes: raster/rt_pg/rtpg_mapalgebra.c | 4 +-- raster/test/regress/rt_mapalgebra_expr.sql | 33 +++++++++++++++++++++++++ raster/test/regress/rt_mapalgebra_expr_expected | 4 +++ 3 files changed, 39 insertions(+), 2 deletions(-) hooks/post-receive -- PostGIS From git at osgeo.org Wed Mar 18 14:39:18 2026 From: git at osgeo.org (git at osgeo.org) Date: Wed, 18 Mar 2026 14:39:18 -0700 (PDT) Subject: [SCM] PostGIS branch stable-3.6 updated. 3.6.2-9-g7a4724254 Message-ID: <20260318213919.0B1611C3CA2@trac.osgeo.org> 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.6 has been updated via 7a47242545554391f0d87e788568a97c2ff5513d (commit) from 5ff3eaca52ba8db6d45e46c3b40c91b0b9c49248 (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 7a47242545554391f0d87e788568a97c2ff5513d Author: Ariel Mashraki Date: Wed Mar 18 13:03:43 2026 +0200 Use read-only SPI execution for user-supplied expressions in ST_MapAlgebraExpr diff --git a/raster/rt_pg/rtpg_mapalgebra.c b/raster/rt_pg/rtpg_mapalgebra.c index e08c65975..6e4b9da38 100644 --- a/raster/rt_pg/rtpg_mapalgebra.c +++ b/raster/rt_pg/rtpg_mapalgebra.c @@ -4911,7 +4911,7 @@ Datum RASTER_mapAlgebraExpr(PG_FUNCTION_ARGS) }; /* Execute the expression into newval */ - ret = SPI_execute(initexpr, FALSE, 0); + ret = SPI_execute(initexpr, TRUE, 0); if (ret != SPI_OK_SELECT || SPI_tuptable == NULL || SPI_processed != 1) { @@ -5141,7 +5141,7 @@ Datum RASTER_mapAlgebraExpr(PG_FUNCTION_ARGS) } - ret = SPI_execute_plan(spi_plan, values, nulls, FALSE, 0); + ret = SPI_execute_plan(spi_plan, values, nulls, TRUE, 0); if (ret != SPI_OK_SELECT || SPI_tuptable == NULL || SPI_processed != 1) { if (SPI_tuptable) diff --git a/raster/test/regress/rt_mapalgebra_expr.sql b/raster/test/regress/rt_mapalgebra_expr.sql index 78f90bb21..e1dd3a5a7 100644 --- a/raster/test/regress/rt_mapalgebra_expr.sql +++ b/raster/test/regress/rt_mapalgebra_expr.sql @@ -160,6 +160,39 @@ SELECT 'T12', '[rast.x]' ) AS rast; +-- Test read-only expression (prepared plan path via [rast.val]) +CREATE TABLE _rast_dml_guard (id int); +SELECT 'T13', ST_MapAlgebraExpr( + ST_AddBand(ST_MakeEmptyRaster(1, 1, 0, 0, 1, 1, 0, 0, 0), '8BUI'::text, 1, 0), + 1, '8BUI'::text, + '[rast.val])::double precision; INSERT INTO _rast_dml_guard VALUES(1); SELECT (1'::text, + NULL::double precision +) IS NULL; +DROP TABLE _rast_dml_guard; + +-- Test read-only expression blocks COPY TO PROGRAM (constant expression path) +SELECT 'T14', ST_MapAlgebraExpr( + ST_AddBand(ST_MakeEmptyRaster(1, 1, 0, 0, 1, 1, 0, 0, 0), '8BUI'::text, 1, 0), + 1, '8BUI'::text, + '1)::double precision; COPY (SELECT 1) TO PROGRAM ''touch /tmp/pwned''--'::text, + NULL::double precision +) IS NULL; + +-- Parameterized queries do not prevent injection; expression is concatenated inside SPI_execute. +CREATE TABLE _rast_drop_guard (id int); +PREPARE _rast_safe_query(raster, int, text, text, float8) AS + SELECT ST_MapAlgebraExpr($1, $2, $3, $4, $5); +EXECUTE _rast_safe_query( + ST_AddBand(ST_MakeEmptyRaster(1,1,0,0,1,1,0,0,0), '8BUI'::text, 1, 0), + 1, '8BUI', + '1)::double precision FROM generate_series(1,1); DROP TABLE _rast_drop_guard; SELECT (1', + NULL +); +DEALLOCATE _rast_safe_query; +-- Table must still exist after the blocked DROP +SELECT 'T15', COUNT(*) = 0 FROM _rast_drop_guard; +DROP TABLE _rast_drop_guard; + DROP FUNCTION ST_TestRaster(ulx float8, uly float8, val float8); DROP FUNCTION raster_plus_twenty(pixel FLOAT, VARIADIC args TEXT[]); DROP FUNCTION raster_plus_arg1(pixel FLOAT, VARIADIC args TEXT[]); diff --git a/raster/test/regress/rt_mapalgebra_expr_expected b/raster/test/regress/rt_mapalgebra_expr_expected index dccd7fc46..e6974dfbc 100644 --- a/raster/test/regress/rt_mapalgebra_expr_expected +++ b/raster/test/regress/rt_mapalgebra_expr_expected @@ -22,6 +22,10 @@ ERROR: rtpg_nmapalgebraexpr_callback: rast2 argument specified in single-raster T11.1|10|2 T11.2|10|2 T12|t|t|t|t +ERROR: INSERT is not allowed in a non-volatile function +ERROR: COPY is not allowed in a non-volatile function +ERROR: DROP TABLE is not allowed in a non-volatile function +T15|t 0|1|INTERSECTION|0.000|0.000|2|2|1.000|1.000|0.000|0.000|0|1|32BF|0.000|1.000|1.000 0|2|INTERSECTION|1.000|-1.000|1|2|1.000|1.000|0.000|0.000|0|1|32BF|0.000|1.000|1.000 0|3|INTERSECTION|1.000|1.000|1|1|1.000|1.000|0.000|0.000|0|1|32BF|0.000|1.000|1.000 ----------------------------------------------------------------------- Summary of changes: raster/rt_pg/rtpg_mapalgebra.c | 4 +-- raster/test/regress/rt_mapalgebra_expr.sql | 33 +++++++++++++++++++++++++ raster/test/regress/rt_mapalgebra_expr_expected | 4 +++ 3 files changed, 39 insertions(+), 2 deletions(-) hooks/post-receive -- PostGIS From git at osgeo.org Wed Mar 18 14:39:35 2026 From: git at osgeo.org (git at osgeo.org) Date: Wed, 18 Mar 2026 14:39:35 -0700 (PDT) Subject: [SCM] PostGIS branch stable-3.5 updated. 3.5.5-8-gab7f1ce70 Message-ID: <20260318213935.AE9D91C3CA4@trac.osgeo.org> 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.5 has been updated via ab7f1ce7030c4ad66a16bd4f7f33972a35bf061b (commit) from b4e40c47a3577d09fe455e84d2c330ddd04d273e (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 ab7f1ce7030c4ad66a16bd4f7f33972a35bf061b Author: Ariel Mashraki Date: Wed Mar 18 13:03:43 2026 +0200 Use read-only SPI execution for user-supplied expressions in ST_MapAlgebraExpr diff --git a/raster/rt_pg/rtpg_mapalgebra.c b/raster/rt_pg/rtpg_mapalgebra.c index d898c63af..6ebbb9343 100644 --- a/raster/rt_pg/rtpg_mapalgebra.c +++ b/raster/rt_pg/rtpg_mapalgebra.c @@ -4773,7 +4773,7 @@ Datum RASTER_mapAlgebraExpr(PG_FUNCTION_ARGS) }; /* Execute the expression into newval */ - ret = SPI_execute(initexpr, FALSE, 0); + ret = SPI_execute(initexpr, TRUE, 0); if (ret != SPI_OK_SELECT || SPI_tuptable == NULL || SPI_processed != 1) { @@ -5003,7 +5003,7 @@ Datum RASTER_mapAlgebraExpr(PG_FUNCTION_ARGS) } - ret = SPI_execute_plan(spi_plan, values, nulls, FALSE, 0); + ret = SPI_execute_plan(spi_plan, values, nulls, TRUE, 0); if (ret != SPI_OK_SELECT || SPI_tuptable == NULL || SPI_processed != 1) { if (SPI_tuptable) diff --git a/raster/test/regress/rt_mapalgebra_expr.sql b/raster/test/regress/rt_mapalgebra_expr.sql index 78f90bb21..e1dd3a5a7 100644 --- a/raster/test/regress/rt_mapalgebra_expr.sql +++ b/raster/test/regress/rt_mapalgebra_expr.sql @@ -160,6 +160,39 @@ SELECT 'T12', '[rast.x]' ) AS rast; +-- Test read-only expression (prepared plan path via [rast.val]) +CREATE TABLE _rast_dml_guard (id int); +SELECT 'T13', ST_MapAlgebraExpr( + ST_AddBand(ST_MakeEmptyRaster(1, 1, 0, 0, 1, 1, 0, 0, 0), '8BUI'::text, 1, 0), + 1, '8BUI'::text, + '[rast.val])::double precision; INSERT INTO _rast_dml_guard VALUES(1); SELECT (1'::text, + NULL::double precision +) IS NULL; +DROP TABLE _rast_dml_guard; + +-- Test read-only expression blocks COPY TO PROGRAM (constant expression path) +SELECT 'T14', ST_MapAlgebraExpr( + ST_AddBand(ST_MakeEmptyRaster(1, 1, 0, 0, 1, 1, 0, 0, 0), '8BUI'::text, 1, 0), + 1, '8BUI'::text, + '1)::double precision; COPY (SELECT 1) TO PROGRAM ''touch /tmp/pwned''--'::text, + NULL::double precision +) IS NULL; + +-- Parameterized queries do not prevent injection; expression is concatenated inside SPI_execute. +CREATE TABLE _rast_drop_guard (id int); +PREPARE _rast_safe_query(raster, int, text, text, float8) AS + SELECT ST_MapAlgebraExpr($1, $2, $3, $4, $5); +EXECUTE _rast_safe_query( + ST_AddBand(ST_MakeEmptyRaster(1,1,0,0,1,1,0,0,0), '8BUI'::text, 1, 0), + 1, '8BUI', + '1)::double precision FROM generate_series(1,1); DROP TABLE _rast_drop_guard; SELECT (1', + NULL +); +DEALLOCATE _rast_safe_query; +-- Table must still exist after the blocked DROP +SELECT 'T15', COUNT(*) = 0 FROM _rast_drop_guard; +DROP TABLE _rast_drop_guard; + DROP FUNCTION ST_TestRaster(ulx float8, uly float8, val float8); DROP FUNCTION raster_plus_twenty(pixel FLOAT, VARIADIC args TEXT[]); DROP FUNCTION raster_plus_arg1(pixel FLOAT, VARIADIC args TEXT[]); diff --git a/raster/test/regress/rt_mapalgebra_expr_expected b/raster/test/regress/rt_mapalgebra_expr_expected index dccd7fc46..e6974dfbc 100644 --- a/raster/test/regress/rt_mapalgebra_expr_expected +++ b/raster/test/regress/rt_mapalgebra_expr_expected @@ -22,6 +22,10 @@ ERROR: rtpg_nmapalgebraexpr_callback: rast2 argument specified in single-raster T11.1|10|2 T11.2|10|2 T12|t|t|t|t +ERROR: INSERT is not allowed in a non-volatile function +ERROR: COPY is not allowed in a non-volatile function +ERROR: DROP TABLE is not allowed in a non-volatile function +T15|t 0|1|INTERSECTION|0.000|0.000|2|2|1.000|1.000|0.000|0.000|0|1|32BF|0.000|1.000|1.000 0|2|INTERSECTION|1.000|-1.000|1|2|1.000|1.000|0.000|0.000|0|1|32BF|0.000|1.000|1.000 0|3|INTERSECTION|1.000|1.000|1|1|1.000|1.000|0.000|0.000|0|1|32BF|0.000|1.000|1.000 ----------------------------------------------------------------------- Summary of changes: raster/rt_pg/rtpg_mapalgebra.c | 4 +-- raster/test/regress/rt_mapalgebra_expr.sql | 33 +++++++++++++++++++++++++ raster/test/regress/rt_mapalgebra_expr_expected | 4 +++ 3 files changed, 39 insertions(+), 2 deletions(-) hooks/post-receive -- PostGIS From git at osgeo.org Wed Mar 18 14:42:17 2026 From: git at osgeo.org (git at osgeo.org) Date: Wed, 18 Mar 2026 14:42:17 -0700 (PDT) Subject: [SCM] PostGIS branch stable-3.4 updated. 3.4.5-11-gc8f4d72ea Message-ID: <20260318214217.D834F1C38D1@trac.osgeo.org> 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.4 has been updated via c8f4d72ea474b30b6e2b6271d26c3eed8c3e2ef9 (commit) from 05b736d089ae4bc3bdc148eb4fe58e5764a18cd7 (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 c8f4d72ea474b30b6e2b6271d26c3eed8c3e2ef9 Author: Ariel Mashraki Date: Wed Mar 18 13:03:43 2026 +0200 Use read-only SPI execution for user-supplied expressions in ST_MapAlgebraExpr diff --git a/raster/rt_pg/rtpg_mapalgebra.c b/raster/rt_pg/rtpg_mapalgebra.c index a9b7152d7..66d8c9d34 100644 --- a/raster/rt_pg/rtpg_mapalgebra.c +++ b/raster/rt_pg/rtpg_mapalgebra.c @@ -4751,8 +4751,8 @@ Datum RASTER_mapAlgebraExpr(PG_FUNCTION_ARGS) PG_RETURN_NULL(); }; - /* Execute the expresion into newval */ - ret = SPI_execute(initexpr, FALSE, 0); + /* Execute the expression into newval */ + ret = SPI_execute(initexpr, TRUE, 0); if (ret != SPI_OK_SELECT || SPI_tuptable == NULL || SPI_processed != 1) { @@ -4982,7 +4982,7 @@ Datum RASTER_mapAlgebraExpr(PG_FUNCTION_ARGS) } - ret = SPI_execute_plan(spi_plan, values, nulls, FALSE, 0); + ret = SPI_execute_plan(spi_plan, values, nulls, TRUE, 0); if (ret != SPI_OK_SELECT || SPI_tuptable == NULL || SPI_processed != 1) { if (SPI_tuptable) diff --git a/raster/test/regress/rt_mapalgebra_expr.sql b/raster/test/regress/rt_mapalgebra_expr.sql index 78f90bb21..e1dd3a5a7 100644 --- a/raster/test/regress/rt_mapalgebra_expr.sql +++ b/raster/test/regress/rt_mapalgebra_expr.sql @@ -160,6 +160,39 @@ SELECT 'T12', '[rast.x]' ) AS rast; +-- Test read-only expression (prepared plan path via [rast.val]) +CREATE TABLE _rast_dml_guard (id int); +SELECT 'T13', ST_MapAlgebraExpr( + ST_AddBand(ST_MakeEmptyRaster(1, 1, 0, 0, 1, 1, 0, 0, 0), '8BUI'::text, 1, 0), + 1, '8BUI'::text, + '[rast.val])::double precision; INSERT INTO _rast_dml_guard VALUES(1); SELECT (1'::text, + NULL::double precision +) IS NULL; +DROP TABLE _rast_dml_guard; + +-- Test read-only expression blocks COPY TO PROGRAM (constant expression path) +SELECT 'T14', ST_MapAlgebraExpr( + ST_AddBand(ST_MakeEmptyRaster(1, 1, 0, 0, 1, 1, 0, 0, 0), '8BUI'::text, 1, 0), + 1, '8BUI'::text, + '1)::double precision; COPY (SELECT 1) TO PROGRAM ''touch /tmp/pwned''--'::text, + NULL::double precision +) IS NULL; + +-- Parameterized queries do not prevent injection; expression is concatenated inside SPI_execute. +CREATE TABLE _rast_drop_guard (id int); +PREPARE _rast_safe_query(raster, int, text, text, float8) AS + SELECT ST_MapAlgebraExpr($1, $2, $3, $4, $5); +EXECUTE _rast_safe_query( + ST_AddBand(ST_MakeEmptyRaster(1,1,0,0,1,1,0,0,0), '8BUI'::text, 1, 0), + 1, '8BUI', + '1)::double precision FROM generate_series(1,1); DROP TABLE _rast_drop_guard; SELECT (1', + NULL +); +DEALLOCATE _rast_safe_query; +-- Table must still exist after the blocked DROP +SELECT 'T15', COUNT(*) = 0 FROM _rast_drop_guard; +DROP TABLE _rast_drop_guard; + DROP FUNCTION ST_TestRaster(ulx float8, uly float8, val float8); DROP FUNCTION raster_plus_twenty(pixel FLOAT, VARIADIC args TEXT[]); DROP FUNCTION raster_plus_arg1(pixel FLOAT, VARIADIC args TEXT[]); diff --git a/raster/test/regress/rt_mapalgebra_expr_expected b/raster/test/regress/rt_mapalgebra_expr_expected index dccd7fc46..e6974dfbc 100644 --- a/raster/test/regress/rt_mapalgebra_expr_expected +++ b/raster/test/regress/rt_mapalgebra_expr_expected @@ -22,6 +22,10 @@ ERROR: rtpg_nmapalgebraexpr_callback: rast2 argument specified in single-raster T11.1|10|2 T11.2|10|2 T12|t|t|t|t +ERROR: INSERT is not allowed in a non-volatile function +ERROR: COPY is not allowed in a non-volatile function +ERROR: DROP TABLE is not allowed in a non-volatile function +T15|t 0|1|INTERSECTION|0.000|0.000|2|2|1.000|1.000|0.000|0.000|0|1|32BF|0.000|1.000|1.000 0|2|INTERSECTION|1.000|-1.000|1|2|1.000|1.000|0.000|0.000|0|1|32BF|0.000|1.000|1.000 0|3|INTERSECTION|1.000|1.000|1|1|1.000|1.000|0.000|0.000|0|1|32BF|0.000|1.000|1.000 ----------------------------------------------------------------------- Summary of changes: raster/rt_pg/rtpg_mapalgebra.c | 6 ++--- raster/test/regress/rt_mapalgebra_expr.sql | 33 +++++++++++++++++++++++++ raster/test/regress/rt_mapalgebra_expr_expected | 4 +++ 3 files changed, 40 insertions(+), 3 deletions(-) hooks/post-receive -- PostGIS From git at osgeo.org Wed Mar 18 14:42:51 2026 From: git at osgeo.org (git at osgeo.org) Date: Wed, 18 Mar 2026 14:42:51 -0700 (PDT) Subject: [SCM] PostGIS branch stable-3.3 updated. 3.3.9-9-g0d4f9dce4 Message-ID: <20260318214251.81ACF1C38D2@trac.osgeo.org> 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.3 has been updated via 0d4f9dce49d14a996500cc3acc6d04d771496cf9 (commit) from d55c697432e5023d99b9fa30e2b8e67ecfd23a4e (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 0d4f9dce49d14a996500cc3acc6d04d771496cf9 Author: Ariel Mashraki Date: Wed Mar 18 13:03:43 2026 +0200 Use read-only SPI execution for user-supplied expressions in ST_MapAlgebraExpr diff --git a/raster/rt_pg/rtpg_mapalgebra.c b/raster/rt_pg/rtpg_mapalgebra.c index 87df4c9dd..251689598 100644 --- a/raster/rt_pg/rtpg_mapalgebra.c +++ b/raster/rt_pg/rtpg_mapalgebra.c @@ -4792,8 +4792,8 @@ Datum RASTER_mapAlgebraExpr(PG_FUNCTION_ARGS) PG_RETURN_NULL(); }; - /* Execute the expresion into newval */ - ret = SPI_execute(initexpr, FALSE, 0); + /* Execute the expression into newval */ + ret = SPI_execute(initexpr, TRUE, 0); if (ret != SPI_OK_SELECT || SPI_tuptable == NULL || SPI_processed != 1) { @@ -5023,7 +5023,7 @@ Datum RASTER_mapAlgebraExpr(PG_FUNCTION_ARGS) } - ret = SPI_execute_plan(spi_plan, values, nulls, FALSE, 0); + ret = SPI_execute_plan(spi_plan, values, nulls, TRUE, 0); if (ret != SPI_OK_SELECT || SPI_tuptable == NULL || SPI_processed != 1) { if (SPI_tuptable) diff --git a/raster/test/regress/rt_mapalgebra_expr.sql b/raster/test/regress/rt_mapalgebra_expr.sql index 78f90bb21..e1dd3a5a7 100644 --- a/raster/test/regress/rt_mapalgebra_expr.sql +++ b/raster/test/regress/rt_mapalgebra_expr.sql @@ -160,6 +160,39 @@ SELECT 'T12', '[rast.x]' ) AS rast; +-- Test read-only expression (prepared plan path via [rast.val]) +CREATE TABLE _rast_dml_guard (id int); +SELECT 'T13', ST_MapAlgebraExpr( + ST_AddBand(ST_MakeEmptyRaster(1, 1, 0, 0, 1, 1, 0, 0, 0), '8BUI'::text, 1, 0), + 1, '8BUI'::text, + '[rast.val])::double precision; INSERT INTO _rast_dml_guard VALUES(1); SELECT (1'::text, + NULL::double precision +) IS NULL; +DROP TABLE _rast_dml_guard; + +-- Test read-only expression blocks COPY TO PROGRAM (constant expression path) +SELECT 'T14', ST_MapAlgebraExpr( + ST_AddBand(ST_MakeEmptyRaster(1, 1, 0, 0, 1, 1, 0, 0, 0), '8BUI'::text, 1, 0), + 1, '8BUI'::text, + '1)::double precision; COPY (SELECT 1) TO PROGRAM ''touch /tmp/pwned''--'::text, + NULL::double precision +) IS NULL; + +-- Parameterized queries do not prevent injection; expression is concatenated inside SPI_execute. +CREATE TABLE _rast_drop_guard (id int); +PREPARE _rast_safe_query(raster, int, text, text, float8) AS + SELECT ST_MapAlgebraExpr($1, $2, $3, $4, $5); +EXECUTE _rast_safe_query( + ST_AddBand(ST_MakeEmptyRaster(1,1,0,0,1,1,0,0,0), '8BUI'::text, 1, 0), + 1, '8BUI', + '1)::double precision FROM generate_series(1,1); DROP TABLE _rast_drop_guard; SELECT (1', + NULL +); +DEALLOCATE _rast_safe_query; +-- Table must still exist after the blocked DROP +SELECT 'T15', COUNT(*) = 0 FROM _rast_drop_guard; +DROP TABLE _rast_drop_guard; + DROP FUNCTION ST_TestRaster(ulx float8, uly float8, val float8); DROP FUNCTION raster_plus_twenty(pixel FLOAT, VARIADIC args TEXT[]); DROP FUNCTION raster_plus_arg1(pixel FLOAT, VARIADIC args TEXT[]); diff --git a/raster/test/regress/rt_mapalgebra_expr_expected b/raster/test/regress/rt_mapalgebra_expr_expected index dccd7fc46..e6974dfbc 100644 --- a/raster/test/regress/rt_mapalgebra_expr_expected +++ b/raster/test/regress/rt_mapalgebra_expr_expected @@ -22,6 +22,10 @@ ERROR: rtpg_nmapalgebraexpr_callback: rast2 argument specified in single-raster T11.1|10|2 T11.2|10|2 T12|t|t|t|t +ERROR: INSERT is not allowed in a non-volatile function +ERROR: COPY is not allowed in a non-volatile function +ERROR: DROP TABLE is not allowed in a non-volatile function +T15|t 0|1|INTERSECTION|0.000|0.000|2|2|1.000|1.000|0.000|0.000|0|1|32BF|0.000|1.000|1.000 0|2|INTERSECTION|1.000|-1.000|1|2|1.000|1.000|0.000|0.000|0|1|32BF|0.000|1.000|1.000 0|3|INTERSECTION|1.000|1.000|1|1|1.000|1.000|0.000|0.000|0|1|32BF|0.000|1.000|1.000 ----------------------------------------------------------------------- Summary of changes: raster/rt_pg/rtpg_mapalgebra.c | 6 ++--- raster/test/regress/rt_mapalgebra_expr.sql | 33 +++++++++++++++++++++++++ raster/test/regress/rt_mapalgebra_expr_expected | 4 +++ 3 files changed, 40 insertions(+), 3 deletions(-) hooks/post-receive -- PostGIS From trac at osgeo.org Fri Mar 20 14:53:00 2026 From: trac at osgeo.org (PostGIS) Date: Fri, 20 Mar 2026 21:53:00 -0000 Subject: [PostGIS] #6058: Pg19 Build Support Message-ID: <049.3f3afcff628e64e2d67aa11907874f6c@osgeo.org> #6058: Pg19 Build Support ---------------------+--------------------------- Reporter: pramsey | Owner: pramsey Type: defect | Status: new Priority: medium | Milestone: PostGIS 3.5.6 Component: postgis | Version: master Keywords: | ---------------------+--------------------------- The formerly private composite_to_json() in Postgres has been exposed externally so we can make use of it in Pg19+ -- Ticket URL: PostGIS The PostGIS Trac is used for bug, enhancement & task tracking, a user and developer wiki, and a view into the subversion code repository of PostGIS project. From git at osgeo.org Fri Mar 20 14:54:37 2026 From: git at osgeo.org (git at osgeo.org) Date: Fri, 20 Mar 2026 14:54:37 -0700 (PDT) Subject: [SCM] PostGIS branch master updated. 3.6.0rc2-401-ga197e6b1f Message-ID: <20260320215437.53EFA8878@trac.osgeo.org> 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 a197e6b1f2bc7ff75fb1d34b806d4a80a4060d77 (commit) from c4426d4baaaed9a3e8ba6fbab2a05ba962dccdea (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 a197e6b1f2bc7ff75fb1d34b806d4a80a4060d77 Author: Paul Ramsey Date: Fri Mar 20 14:54:06 2026 -0700 Use Pg composite_to_json() function in 19+ (Paul Ramsey) References #6058 diff --git a/postgis/lwgeom_out_geojson.c b/postgis/lwgeom_out_geojson.c index 5e0a6f589..293d68ef0 100644 --- a/postgis/lwgeom_out_geojson.c +++ b/postgis/lwgeom_out_geojson.c @@ -69,8 +69,12 @@ static void composite_to_geojson(FunctionCallInfo fcinfo, bool use_line_feeds, Oid geom_oid, Oid geog_oid); + +#if POSTGIS_PGSQL_VERSION < 190 static void composite_to_json(Datum composite, StringInfo result, bool use_line_feeds); +#endif + static void datum_to_json(Datum val, bool is_null, StringInfo result, JsonTypeCategory tcategory, Oid outfuncoid, bool key_scalar); @@ -570,6 +574,7 @@ array_to_json_internal(Datum array, StringInfo result, bool use_line_feeds) /* * Turn a composite / record into JSON. */ +#if POSTGIS_PGSQL_VERSION < 190 static void composite_to_json(Datum composite, StringInfo result, bool use_line_feeds) { @@ -635,6 +640,7 @@ composite_to_json(Datum composite, StringInfo result, bool use_line_feeds) appendStringInfoChar(result, '}'); ReleaseTupleDesc(tupdesc); } +#endif /* * Process a single dimension of an array. ----------------------------------------------------------------------- Summary of changes: postgis/lwgeom_out_geojson.c | 6 ++++++ 1 file changed, 6 insertions(+) hooks/post-receive -- PostGIS From trac at osgeo.org Fri Mar 20 14:54:39 2026 From: trac at osgeo.org (PostGIS) Date: Fri, 20 Mar 2026 21:54:39 -0000 Subject: [PostGIS] #6058: Pg19 Build Support In-Reply-To: <049.3f3afcff628e64e2d67aa11907874f6c@osgeo.org> References: <049.3f3afcff628e64e2d67aa11907874f6c@osgeo.org> Message-ID: <064.d4020a40ee1f38c41ab3e2d34bca92b6@osgeo.org> #6058: Pg19 Build Support ----------------------+--------------------------- Reporter: pramsey | Owner: pramsey Type: defect | Status: new Priority: medium | Milestone: PostGIS 3.5.6 Component: postgis | Version: master Resolution: | Keywords: ----------------------+--------------------------- Comment (by Paul Ramsey ): In [changeset:"a197e6b1f2bc7ff75fb1d34b806d4a80a4060d77/git" a197e6b/git]: {{{#!CommitTicketReference repository="git" revision="a197e6b1f2bc7ff75fb1d34b806d4a80a4060d77" Use Pg composite_to_json() function in 19+ (Paul Ramsey) References #6058 }}} -- Ticket URL: PostGIS The PostGIS Trac is used for bug, enhancement & task tracking, a user and developer wiki, and a view into the subversion code repository of PostGIS project. From git at osgeo.org Fri Mar 20 14:55:28 2026 From: git at osgeo.org (git at osgeo.org) Date: Fri, 20 Mar 2026 14:55:28 -0700 (PDT) Subject: [SCM] PostGIS branch stable-3.6 updated. 3.6.2-10-g4728189d6 Message-ID: <20260320215528.DC2C51C6A76@trac.osgeo.org> 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.6 has been updated via 4728189d613fa7f0b7d8edd8534d02c3a82683bd (commit) from 7a47242545554391f0d87e788568a97c2ff5513d (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 4728189d613fa7f0b7d8edd8534d02c3a82683bd Author: Paul Ramsey Date: Fri Mar 20 14:54:56 2026 -0700 Use Pg composite_to_json() function in 19+ References #6058 diff --git a/NEWS b/NEWS index 6c776454a..e8519f017 100644 --- a/NEWS +++ b/NEWS @@ -19,6 +19,8 @@ topogeometry corruption: Reported by Sven Klemm (Tiger Data), Allistair Ishmael Hakim (allistair.sh) and Daniel Bakker - GH-850 Use quote_identifier to build tables in pgis_tablefromflatgeobuf (Ariel Mashraki) +- #6058, Use Pg composite_to_json() function in 19+ (Paul Ramsey) + PostGIS 3.6.2 diff --git a/postgis/lwgeom_out_geojson.c b/postgis/lwgeom_out_geojson.c index 0338cdf18..3e74708bd 100644 --- a/postgis/lwgeom_out_geojson.c +++ b/postgis/lwgeom_out_geojson.c @@ -62,8 +62,12 @@ static void composite_to_geojson(FunctionCallInfo fcinfo, bool use_line_feeds, Oid geom_oid, Oid geog_oid); + +#if POSTGIS_PGSQL_VERSION < 190 static void composite_to_json(Datum composite, StringInfo result, bool use_line_feeds); +#endif + static void datum_to_json(Datum val, bool is_null, StringInfo result, JsonTypeCategory tcategory, Oid outfuncoid, bool key_scalar); @@ -533,6 +537,7 @@ array_to_json_internal(Datum array, StringInfo result, bool use_line_feeds) /* * Turn a composite / record into JSON. */ +#if POSTGIS_PGSQL_VERSION < 190 static void composite_to_json(Datum composite, StringInfo result, bool use_line_feeds) { @@ -598,6 +603,7 @@ composite_to_json(Datum composite, StringInfo result, bool use_line_feeds) appendStringInfoChar(result, '}'); ReleaseTupleDesc(tupdesc); } +#endif /* * Process a single dimension of an array. ----------------------------------------------------------------------- Summary of changes: NEWS | 2 ++ postgis/lwgeom_out_geojson.c | 6 ++++++ 2 files changed, 8 insertions(+) hooks/post-receive -- PostGIS From trac at osgeo.org Fri Mar 20 14:55:30 2026 From: trac at osgeo.org (PostGIS) Date: Fri, 20 Mar 2026 21:55:30 -0000 Subject: [PostGIS] #6058: Pg19 Build Support In-Reply-To: <049.3f3afcff628e64e2d67aa11907874f6c@osgeo.org> References: <049.3f3afcff628e64e2d67aa11907874f6c@osgeo.org> Message-ID: <064.97e0495031f5bd155bf03a0f5b15df7c@osgeo.org> #6058: Pg19 Build Support ----------------------+--------------------------- Reporter: pramsey | Owner: pramsey Type: defect | Status: new Priority: medium | Milestone: PostGIS 3.5.6 Component: postgis | Version: master Resolution: | Keywords: ----------------------+--------------------------- Comment (by Paul Ramsey ): In [changeset:"4728189d613fa7f0b7d8edd8534d02c3a82683bd/git" 4728189/git]: {{{#!CommitTicketReference repository="git" revision="4728189d613fa7f0b7d8edd8534d02c3a82683bd" Use Pg composite_to_json() function in 19+ References #6058 }}} -- Ticket URL: PostGIS The PostGIS Trac is used for bug, enhancement & task tracking, a user and developer wiki, and a view into the subversion code repository of PostGIS project. From git at osgeo.org Fri Mar 20 14:55:56 2026 From: git at osgeo.org (git at osgeo.org) Date: Fri, 20 Mar 2026 14:55:56 -0700 (PDT) Subject: [SCM] PostGIS branch stable-3.5 updated. 3.5.5-9-g8316e53d0 Message-ID: <20260320215557.222E1F0B7@trac.osgeo.org> 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.5 has been updated via 8316e53d03ea6e5d20dddc579060ab4948de6219 (commit) from ab7f1ce7030c4ad66a16bd4f7f33972a35bf061b (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 8316e53d03ea6e5d20dddc579060ab4948de6219 Author: Paul Ramsey Date: Fri Mar 20 14:55:37 2026 -0700 Use Pg composite_to_json() function in 19+ (Paul Ramsey) Closes #6058 diff --git a/NEWS b/NEWS index b7a5fe7f4..1368fcc02 100644 --- a/NEWS +++ b/NEWS @@ -10,6 +10,7 @@ PostgreSQL 12-18 required. GEOS 3.8+ required. Proj 6.1+ required. Reported by Sven Klemm (Tiger Data), Allistair Ishmael Hakim (allistair.sh) and Daniel Bakker - GH-850 Use quote_identifier to build tables in pgis_tablefromflatgeobuf (Ariel Mashraki) + - #6058, Use Pg composite_to_json() function in 19+ (Paul Ramsey) PostGIS 3.5.5 diff --git a/postgis/lwgeom_out_geojson.c b/postgis/lwgeom_out_geojson.c index 931344c1c..7a6e89bb8 100644 --- a/postgis/lwgeom_out_geojson.c +++ b/postgis/lwgeom_out_geojson.c @@ -62,8 +62,12 @@ static void composite_to_geojson(FunctionCallInfo fcinfo, bool use_line_feeds, Oid geom_oid, Oid geog_oid); + +#if POSTGIS_PGSQL_VERSION < 190 static void composite_to_json(Datum composite, StringInfo result, bool use_line_feeds); +#endif + static void datum_to_json(Datum val, bool is_null, StringInfo result, JsonTypeCategory tcategory, Oid outfuncoid, bool key_scalar); @@ -534,6 +538,7 @@ array_to_json_internal(Datum array, StringInfo result, bool use_line_feeds) /* * Turn a composite / record into JSON. */ +#if POSTGIS_PGSQL_VERSION < 190 static void composite_to_json(Datum composite, StringInfo result, bool use_line_feeds) { @@ -599,6 +604,7 @@ composite_to_json(Datum composite, StringInfo result, bool use_line_feeds) appendStringInfoChar(result, '}'); ReleaseTupleDesc(tupdesc); } +#endif /* * Process a single dimension of an array. ----------------------------------------------------------------------- Summary of changes: NEWS | 1 + postgis/lwgeom_out_geojson.c | 6 ++++++ 2 files changed, 7 insertions(+) hooks/post-receive -- PostGIS From trac at osgeo.org Fri Mar 20 14:55:58 2026 From: trac at osgeo.org (PostGIS) Date: Fri, 20 Mar 2026 21:55:58 -0000 Subject: [PostGIS] #6058: Pg19 Build Support In-Reply-To: <049.3f3afcff628e64e2d67aa11907874f6c@osgeo.org> References: <049.3f3afcff628e64e2d67aa11907874f6c@osgeo.org> Message-ID: <064.5b45871d256678b036ea1193a998f0f9@osgeo.org> #6058: Pg19 Build Support ----------------------+--------------------------- Reporter: pramsey | Owner: pramsey Type: defect | Status: closed Priority: medium | Milestone: PostGIS 3.5.6 Component: postgis | Version: master Resolution: fixed | Keywords: ----------------------+--------------------------- Changes (by Paul Ramsey ): * resolution: => fixed * status: new => closed Comment: In [changeset:"8316e53d03ea6e5d20dddc579060ab4948de6219/git" 8316e53/git]: {{{#!CommitTicketReference repository="git" revision="8316e53d03ea6e5d20dddc579060ab4948de6219" Use Pg composite_to_json() function in 19+ (Paul Ramsey) Closes #6058 }}} -- Ticket URL: PostGIS The PostGIS Trac is used for bug, enhancement & task tracking, a user and developer wiki, and a view into the subversion code repository of PostGIS project. From git at osgeo.org Fri Mar 20 14:57:17 2026 From: git at osgeo.org (git at osgeo.org) Date: Fri, 20 Mar 2026 14:57:17 -0700 (PDT) Subject: [SCM] PostGIS branch master updated. 3.6.0rc2-402-gd63430387 Message-ID: <20260320215717.45C21854D@trac.osgeo.org> 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 d63430387663f34c6edccac1bff47a5cf484d4c8 (commit) from a197e6b1f2bc7ff75fb1d34b806d4a80a4060d77 (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 d63430387663f34c6edccac1bff47a5cf484d4c8 Author: Paul Ramsey Date: Fri Mar 20 14:56:33 2026 -0700 Replace func() with func(void) for zero-parameter functions. Add in explicit fallthroughs to case statements, all per recent clang code warnings. diff --git a/deps/uthash/include/uthash.h b/deps/uthash/include/uthash.h index af0546472..7ce3f1982 100644 --- a/deps/uthash/include/uthash.h +++ b/deps/uthash/include/uthash.h @@ -114,6 +114,22 @@ typedef unsigned char uint8_t; #define HASH_NONFATAL_OOM 0 #endif +#ifndef FALLTHROUGH + #if defined(__cplusplus) && __cplusplus >= 201703L + #define FALLTHROUGH [[fallthrough]] + #elif defined(__STDC_VERSION__) && __STDC_VERSION__ >= 202311L + #define FALLTHROUGH [[fallthrough]] + #elif defined(__clang__) + #define FALLTHROUGH __attribute__((fallthrough)) + #elif defined(__GNUC__) && __GNUC__ >= 7 + #define FALLTHROUGH __attribute__((fallthrough)) + #elif defined(_MSC_VER) && _MSC_VER >= 1910 + #define FALLTHROUGH [[fallthrough]] + #else + #define FALLTHROUGH ((void)0) + #endif +#endif + #if HASH_NONFATAL_OOM /* malloc failures can be recovered from */ @@ -681,16 +697,16 @@ do { } \ hashv += (unsigned)(keylen); \ switch ( _hj_k ) { \ - case 11: hashv += ( (unsigned)_hj_key[10] << 24 ); /* FALLTHROUGH */ \ - case 10: hashv += ( (unsigned)_hj_key[9] << 16 ); /* FALLTHROUGH */ \ - case 9: hashv += ( (unsigned)_hj_key[8] << 8 ); /* FALLTHROUGH */ \ - case 8: _hj_j += ( (unsigned)_hj_key[7] << 24 ); /* FALLTHROUGH */ \ - case 7: _hj_j += ( (unsigned)_hj_key[6] << 16 ); /* FALLTHROUGH */ \ - case 6: _hj_j += ( (unsigned)_hj_key[5] << 8 ); /* FALLTHROUGH */ \ - case 5: _hj_j += _hj_key[4]; /* FALLTHROUGH */ \ - case 4: _hj_i += ( (unsigned)_hj_key[3] << 24 ); /* FALLTHROUGH */ \ - case 3: _hj_i += ( (unsigned)_hj_key[2] << 16 ); /* FALLTHROUGH */ \ - case 2: _hj_i += ( (unsigned)_hj_key[1] << 8 ); /* FALLTHROUGH */ \ + case 11: hashv += ( (unsigned)_hj_key[10] << 24 ); FALLTHROUGH; \ + case 10: hashv += ( (unsigned)_hj_key[9] << 16 ); FALLTHROUGH; \ + case 9: hashv += ( (unsigned)_hj_key[8] << 8 ); FALLTHROUGH; \ + case 8: _hj_j += ( (unsigned)_hj_key[7] << 24 ); FALLTHROUGH; \ + case 7: _hj_j += ( (unsigned)_hj_key[6] << 16 ); FALLTHROUGH; \ + case 6: _hj_j += ( (unsigned)_hj_key[5] << 8 ); FALLTHROUGH; \ + case 5: _hj_j += _hj_key[4]; FALLTHROUGH; \ + case 4: _hj_i += ( (unsigned)_hj_key[3] << 24 ); FALLTHROUGH; \ + case 3: _hj_i += ( (unsigned)_hj_key[2] << 16 ); FALLTHROUGH; \ + case 2: _hj_i += ( (unsigned)_hj_key[1] << 8 ); FALLTHROUGH; \ case 1: _hj_i += _hj_key[0]; \ } \ HASH_JEN_MIX(_hj_i, _hj_j, hashv); \ @@ -1224,4 +1240,4 @@ typedef struct UT_hash_handle { unsigned hashv; /* result of hash-fcn(key) */ } UT_hash_handle; -#endif /* UTHASH_H */ \ No newline at end of file +#endif /* UTHASH_H */ diff --git a/deps/wagyu/lwgeom_wagyu.cpp b/deps/wagyu/lwgeom_wagyu.cpp index 0afbd144b..fc6e359c6 100644 --- a/deps/wagyu/lwgeom_wagyu.cpp +++ b/deps/wagyu/lwgeom_wagyu.cpp @@ -250,7 +250,7 @@ lwgeom_wagyu_clip_by_box(const LWGEOM *geom, const GBOX *bbox) } const char * -libwagyu_version() +libwagyu_version(void) { static char str[50] = {0}; snprintf( @@ -260,13 +260,13 @@ libwagyu_version() } void -lwgeom_wagyu_interruptRequest() +lwgeom_wagyu_interruptRequest(void) { mapbox::geometry::wagyu::interrupt_request(); } void -lwgeom_wagyu_interruptReset() +lwgeom_wagyu_interruptReset(void) { mapbox::geometry::wagyu::interrupt_reset(); } diff --git a/deps/wagyu/lwgeom_wagyu.h b/deps/wagyu/lwgeom_wagyu.h index 9e557f679..52963e23a 100644 --- a/deps/wagyu/lwgeom_wagyu.h +++ b/deps/wagyu/lwgeom_wagyu.h @@ -52,17 +52,17 @@ LWGEOM *lwgeom_wagyu_clip_by_box(const LWGEOM *geom, const GBOX *bbox); * Returns a pointer to the static string representing the Wagyu release * being used (Should not be freed) */ -const char *libwagyu_version(); +const char *libwagyu_version(void); /** * Requests wagyu to stop processing. In this case it will return NULL */ -void lwgeom_wagyu_interruptRequest(); +void lwgeom_wagyu_interruptRequest(void); /** * Cancels request to stop processing. */ -void lwgeom_wagyu_interruptReset(); +void lwgeom_wagyu_interruptReset(void); #ifdef __cplusplus } diff --git a/libpgcommon/lwgeom_transform.c b/libpgcommon/lwgeom_transform.c index 61975dc0f..53fe0a5d3 100644 --- a/libpgcommon/lwgeom_transform.c +++ b/libpgcommon/lwgeom_transform.c @@ -96,7 +96,7 @@ PROJSRSDestroyPortalCache(void *portalCache) * If it doesn't exist, make a new blank one and return it. */ PROJSRSCache * -GetPROJSRSCache() +GetPROJSRSCache(void) { PROJSRSCache* cache = PROJ_CACHE; if (!cache) diff --git a/libpgcommon/lwgeom_transform.h b/libpgcommon/lwgeom_transform.h index be0ae1978..c42d21530 100644 --- a/libpgcommon/lwgeom_transform.h +++ b/libpgcommon/lwgeom_transform.h @@ -57,7 +57,7 @@ typedef struct srs_precision } srs_precision; /* Prototypes */ -PROJSRSCache* GetPROJSRSCache(); +PROJSRSCache* GetPROJSRSCache(void); int lwproj_lookup(int32_t srid_from, int32_t srid_to, LWPROJ **pj); int lwproj_is_latlong(const LWPROJ *pj); int spheroid_init_from_srid(int32_t srid, SPHEROID *s); diff --git a/postgis/lwgeom_functions_basic.c b/postgis/lwgeom_functions_basic.c index 0cfa08da7..7806f6ccb 100644 --- a/postgis/lwgeom_functions_basic.c +++ b/postgis/lwgeom_functions_basic.c @@ -2744,7 +2744,8 @@ Datum LWGEOM_angle(PG_FUNCTION_ARGS) default: /*always executed*/ for (j = 0; j <= i; j++) PG_FREE_IF_COPY(seri_geoms[j], j); - /*FALLTHROUGH*/ + pg_fallthrough; /* FALLTHROUGH */ + case 1: lwpgerror("Empty geometry"); PG_RETURN_NULL(); diff --git a/postgis/lwgeom_geos_prepared.c b/postgis/lwgeom_geos_prepared.c index 2f971a64c..79dafad7e 100644 --- a/postgis/lwgeom_geos_prepared.c +++ b/postgis/lwgeom_geos_prepared.c @@ -336,7 +336,7 @@ PrepGeomCacheCleaner(GeomCache *cache) } static GeomCache* -PrepGeomCacheAllocator() +PrepGeomCacheAllocator(void) { PrepGeomCache* prepcache = palloc(sizeof(PrepGeomCache)); memset(prepcache, 0, sizeof(PrepGeomCache)); diff --git a/postgis/lwgeom_transform.c b/postgis/lwgeom_transform.c index 4a23fe3fc..16a32fc54 100644 --- a/postgis/lwgeom_transform.c +++ b/postgis/lwgeom_transform.c @@ -409,7 +409,7 @@ srs_tuple_from_entry(const struct srs_entry* entry, TupleDesc tuple_desc) } static struct srs_data * -srs_state_init() +srs_state_init(void) { struct srs_data *state = palloc0(sizeof(*state)); state->capacity = 8192; diff --git a/postgis/postgis_module.c b/postgis/postgis_module.c index 8c420ac53..8d79254ab 100644 --- a/postgis/postgis_module.c +++ b/postgis/postgis_module.c @@ -53,7 +53,7 @@ PG_MODULE_MAGIC; #endif -static void interrupt_geos_callback() +static void interrupt_geos_callback(void) { #ifdef WIN32 if (UNBLOCKED_SIGNAL_QUEUE()) @@ -72,7 +72,7 @@ static void interrupt_geos_callback() } } -static void interrupt_liblwgeom_callback() +static void interrupt_liblwgeom_callback(void) { #ifdef WIN32 if (UNBLOCKED_SIGNAL_QUEUE()) diff --git a/raster/rt_pg/rtpg_mapalgebra.c b/raster/rt_pg/rtpg_mapalgebra.c index 8a0e0516d..0e355ebe3 100644 --- a/raster/rt_pg/rtpg_mapalgebra.c +++ b/raster/rt_pg/rtpg_mapalgebra.c @@ -6567,8 +6567,8 @@ Datum RASTER_mapAlgebra2(PG_FUNCTION_ARGS) switch (extenttype) { case ET_FIRST: i = 0; - /* fall through */ - __attribute__((fallthrough)); + pg_fallthrough; /* FALLTHROUGH */ + case ET_SECOND: if (i > 1) i = 1; ----------------------------------------------------------------------- Summary of changes: deps/uthash/include/uthash.h | 38 +++++++++++++++++++++++++++----------- deps/wagyu/lwgeom_wagyu.cpp | 6 +++--- deps/wagyu/lwgeom_wagyu.h | 6 +++--- libpgcommon/lwgeom_transform.c | 2 +- libpgcommon/lwgeom_transform.h | 2 +- postgis/lwgeom_functions_basic.c | 3 ++- postgis/lwgeom_geos_prepared.c | 2 +- postgis/lwgeom_transform.c | 2 +- postgis/postgis_module.c | 4 ++-- raster/rt_pg/rtpg_mapalgebra.c | 4 ++-- 10 files changed, 43 insertions(+), 26 deletions(-) hooks/post-receive -- PostGIS From trac at osgeo.org Mon Mar 23 03:45:25 2026 From: trac at osgeo.org (PostGIS) Date: Mon, 23 Mar 2026 10:45:25 -0000 Subject: [PostGIS] #6059: AddGeometryColumn calls postgis_type_name without @extschema@ prefix Message-ID: <049.53e6f5bd167d0c7df5c745e96eec6194@osgeo.org> #6059: AddGeometryColumn calls postgis_type_name without @extschema@ prefix ---------------------+--------------------- Reporter: fthomas | Owner: pramsey Type: defect | Status: new Priority: medium | Milestone: Component: postgis | Version: 3.6.x Keywords: | ---------------------+--------------------- [https://gitea.osgeo.org/postgis/postgis/src/commit/d63430387663f34c6edccac1bff47a5cf484d4c8/postgis/postgis.sql.in#L2363-L2530 AddGeometryColumn] calls postgis_type_name without the @extschema@ prefix in [https://gitea.osgeo.org/postgis/postgis/src/commit/d63430387663f34c6edccac1bff47a5cf484d4c8/postgis/postgis.sql.in#L2393 postgis.sql.in#L2393]. Other PostGIS function calls are qualified with the @extschema@ prefix, like ST_SRID in [https://gitea.osgeo.org/postgis/postgis/src/commit/d63430387663f34c6edccac1bff47a5cf484d4c8/postgis/postgis.sql.in#L2435 postgis.sql.in#L2435] or even postgis_type_name in [https://gitea.osgeo.org/postgis/postgis/src/commit/d63430387663f34c6edccac1bff47a5cf484d4c8/postgis/postgis.sql.in#L2478 postgis.sql.in#L2478]. Now, if !AddGeometryColumn is used qualified with the schema it is installed in but this schema is not on the [https://www.postgresql.org/docs/current/ddl-schemas.html#DDL-SCHEMAS-PATH search path], it fails because of the unqualified postgis_type_name call: {{{ERROR: function postgis_type_name(character varying, integer) does not exist}}} I guess prefixing postgis_type_name with @extschema@ would fix this error. -- Ticket URL: PostGIS The PostGIS Trac is used for bug, enhancement & task tracking, a user and developer wiki, and a view into the subversion code repository of PostGIS project. From trac at osgeo.org Mon Mar 23 08:22:25 2026 From: trac at osgeo.org (PostGIS) Date: Mon, 23 Mar 2026 15:22:25 -0000 Subject: [PostGIS] #6059: AddGeometryColumn calls postgis_type_name without @extschema@ prefix In-Reply-To: <049.53e6f5bd167d0c7df5c745e96eec6194@osgeo.org> References: <049.53e6f5bd167d0c7df5c745e96eec6194@osgeo.org> Message-ID: <064.0ec307fe7cf9a4829ddab10bf11d56b6@osgeo.org> #6059: AddGeometryColumn calls postgis_type_name without @extschema@ prefix ----------------------+--------------------- Reporter: fthomas | Owner: pramsey Type: defect | Status: new Priority: medium | Milestone: Component: postgis | Version: 3.6.x Resolution: | Keywords: ----------------------+--------------------- Comment (by pramsey): I imagine you're right. Is there a reason you're using AddGeometryColumn and just just `ALTER COLUMN` as has been supported for 15 years? -- Ticket URL: PostGIS The PostGIS Trac is used for bug, enhancement & task tracking, a user and developer wiki, and a view into the subversion code repository of PostGIS project. From git at osgeo.org Mon Mar 23 09:41:20 2026 From: git at osgeo.org (git at osgeo.org) Date: Mon, 23 Mar 2026 09:41:20 -0700 (PDT) Subject: [SCM] PostGIS branch master updated. 3.6.0rc2-403-gc52110c83 Message-ID: <20260323164121.39330226E5@trac.osgeo.org> 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 c52110c83f015716df310dd94d48ff76abdd7620 (commit) from d63430387663f34c6edccac1bff47a5cf484d4c8 (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 c52110c83f015716df310dd94d48ff76abdd7620 Author: Paul Ramsey Date: Mon Mar 23 09:41:10 2026 -0700 Build updates for new compilers, fully qualify some calls to postgis functions diff --git a/liblwgeom/liblwgeom_internal.h b/liblwgeom/liblwgeom_internal.h index 39baf8032..828c81eeb 100644 --- a/liblwgeom/liblwgeom_internal.h +++ b/liblwgeom/liblwgeom_internal.h @@ -72,6 +72,21 @@ #define STR_IEQUALS(A, B) (strcasecmp((A), (B)) == 0) #define STR_ISTARTS(A, B) (strncasecmp((A), (B), strlen((B))) == 0) +#ifndef FALLTHROUGH + #if defined(__cplusplus) && __cplusplus >= 201703L + #define FALLTHROUGH [[fallthrough]] + #elif defined(__STDC_VERSION__) && __STDC_VERSION__ >= 202311L + #define FALLTHROUGH [[fallthrough]] + #elif defined(__clang__) + #define FALLTHROUGH __attribute__((fallthrough)) + #elif defined(__GNUC__) && __GNUC__ >= 7 + #define FALLTHROUGH __attribute__((fallthrough)) + #elif defined(_MSC_VER) && _MSC_VER >= 1910 + #define FALLTHROUGH [[fallthrough]] + #else + #define FALLTHROUGH ((void)0) + #endif +#endif /* * this will change to NaN when I figure out how to diff --git a/postgis/lwgeom_functions_basic.c b/postgis/lwgeom_functions_basic.c index 7806f6ccb..055375099 100644 --- a/postgis/lwgeom_functions_basic.c +++ b/postgis/lwgeom_functions_basic.c @@ -2744,7 +2744,7 @@ Datum LWGEOM_angle(PG_FUNCTION_ARGS) default: /*always executed*/ for (j = 0; j <= i; j++) PG_FREE_IF_COPY(seri_geoms[j], j); - pg_fallthrough; /* FALLTHROUGH */ + FALLTHROUGH; case 1: lwpgerror("Empty geometry"); diff --git a/postgis/postgis.sql.in b/postgis/postgis.sql.in index 118a6499e..2a51d7352 100644 --- a/postgis/postgis.sql.in +++ b/postgis/postgis.sql.in @@ -2294,18 +2294,18 @@ BEGIN IF use_typmod THEN BEGIN EXECUTE 'ALTER TABLE ' || quote_ident(gcs.nspname) || '.' || quote_ident(gcs.relname) || ' ALTER COLUMN ' || quote_ident(gcs.attname) || - ' TYPE geometry(' || postgis_type_name(gtype, gndims, true) || ', ' || gsrid::text || ') '; + ' TYPE geometry(' || @extschema at .postgis_type_name(gtype, gndims, true) || ', ' || gsrid::text || ') '; inserted := inserted + 1; EXCEPTION WHEN invalid_parameter_value OR feature_not_supported THEN - RAISE WARNING 'Could not convert ''%'' in ''%.%'' to use typmod with srid %, type %: %', quote_ident(gcs.attname), quote_ident(gcs.nspname), quote_ident(gcs.relname), gsrid, postgis_type_name(gtype, gndims, true), SQLERRM; + RAISE WARNING 'Could not convert ''%'' in ''%.%'' to use typmod with srid %, type %: %', quote_ident(gcs.attname), quote_ident(gcs.nspname), quote_ident(gcs.relname), gsrid, @extschema at .postgis_type_name(gtype, gndims, true), SQLERRM; gc_is_valid := false; END; ELSE -- Try to apply srid check to column constraint_successful = false; - IF (gsrid > 0 AND postgis_constraint_srid(gcs.nspname, gcs.relname,gcs.attname) IS NULL ) THEN + IF (gsrid > 0 AND @extschema at .postgis_constraint_srid(gcs.nspname, gcs.relname,gcs.attname) IS NULL ) THEN BEGIN EXECUTE 'ALTER TABLE ONLY ' || quote_ident(gcs.nspname) || '.' || quote_ident(gcs.relname) || ' ADD CONSTRAINT ' || quote_ident('enforce_srid_' || gcs.attname) || @@ -2319,7 +2319,7 @@ BEGIN END IF; -- Try to apply ndims check to column - IF (gndims IS NOT NULL AND postgis_constraint_dims(gcs.nspname, gcs.relname,gcs.attname) IS NULL ) THEN + IF (gndims IS NOT NULL AND @extschema at .postgis_constraint_dims(gcs.nspname, gcs.relname,gcs.attname) IS NULL ) THEN BEGIN EXECUTE 'ALTER TABLE ONLY ' || quote_ident(gcs.nspname) || '.' || quote_ident(gcs.relname) || ' ADD CONSTRAINT ' || quote_ident('enforce_dims_' || gcs.attname) || ' @@ -2333,7 +2333,7 @@ BEGIN END IF; -- Try to apply geometrytype check to column - IF (gtype IS NOT NULL AND postgis_constraint_type(gcs.nspname, gcs.relname,gcs.attname) IS NULL ) THEN + IF (gtype IS NOT NULL AND @extschema at .postgis_constraint_type(gcs.nspname, gcs.relname,gcs.attname) IS NULL ) THEN BEGIN EXECUTE 'ALTER TABLE ONLY ' || quote_ident(gcs.nspname) || '.' || quote_ident(gcs.relname) || ' ADD CONSTRAINT ' || quote_ident('enforce_geotype_' || gcs.attname) || ' @@ -2390,7 +2390,7 @@ DECLARE BEGIN -- Verify geometry type - IF (postgis_type_name(new_type,new_dim) IS NULL ) + IF (@extschema at .postgis_type_name(new_type,new_dim) IS NULL ) THEN RAISE EXCEPTION 'Invalid type name "%(%)" - valid ones are: POINT, MULTIPOINT, @@ -2795,7 +2795,7 @@ BEGIN END IF; END IF; - IF postgis_constraint_srid(real_schema, table_name, column_name) IS NOT NULL THEN + IF @extschema at .postgis_constraint_srid(real_schema, table_name, column_name) IS NOT NULL THEN -- srid was enforced with constraints before, keep it that way. -- Make up constraint name cname = 'enforce_srid_' || column_name; diff --git a/raster/rt_pg/rtpg_mapalgebra.c b/raster/rt_pg/rtpg_mapalgebra.c index 0e355ebe3..57ce89a52 100644 --- a/raster/rt_pg/rtpg_mapalgebra.c +++ b/raster/rt_pg/rtpg_mapalgebra.c @@ -6567,7 +6567,7 @@ Datum RASTER_mapAlgebra2(PG_FUNCTION_ARGS) switch (extenttype) { case ET_FIRST: i = 0; - pg_fallthrough; /* FALLTHROUGH */ + FALLTHROUGH; case ET_SECOND: if (i > 1) ----------------------------------------------------------------------- Summary of changes: liblwgeom/liblwgeom_internal.h | 15 +++++++++++++++ postgis/lwgeom_functions_basic.c | 2 +- postgis/postgis.sql.in | 14 +++++++------- raster/rt_pg/rtpg_mapalgebra.c | 2 +- 4 files changed, 24 insertions(+), 9 deletions(-) hooks/post-receive -- PostGIS From trac at osgeo.org Mon Mar 23 09:42:23 2026 From: trac at osgeo.org (PostGIS) Date: Mon, 23 Mar 2026 16:42:23 -0000 Subject: [PostGIS] #6060: Fully quality calls to postgis functions in plpgsql Message-ID: <049.6b4e7fe4a1fc19f1fbe2f0abe6bf0708@osgeo.org> #6060: Fully quality calls to postgis functions in plpgsql ---------------------+--------------------------- Reporter: pramsey | Owner: pramsey Type: defect | Status: assigned Priority: medium | Milestone: PostGIS 3.6.2 Component: postgis | Version: 3.6.x Keywords: | ---------------------+--------------------------- Some calls to postgis_* helper functions in plpgsql based functions are still not fully qualified with @extschema@ -- Ticket URL: PostGIS The PostGIS Trac is used for bug, enhancement & task tracking, a user and developer wiki, and a view into the subversion code repository of PostGIS project. From git at osgeo.org Mon Mar 23 09:43:37 2026 From: git at osgeo.org (git at osgeo.org) Date: Mon, 23 Mar 2026 09:43:37 -0700 (PDT) Subject: [SCM] PostGIS branch stable-3.6 updated. 3.6.2-11-gdaf6a4fd2 Message-ID: <20260323164338.154AD2660A@trac.osgeo.org> 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.6 has been updated via daf6a4fd267c0ba50598de359789ef7296dc1c1d (commit) from 4728189d613fa7f0b7d8edd8534d02c3a82683bd (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 daf6a4fd267c0ba50598de359789ef7296dc1c1d Author: Paul Ramsey Date: Mon Mar 23 09:43:16 2026 -0700 Fully quality calls to helper functions references #6060 diff --git a/NEWS b/NEWS index e8519f017..5078062b0 100644 --- a/NEWS +++ b/NEWS @@ -20,6 +20,7 @@ topogeometry corruption: and Daniel Bakker - GH-850 Use quote_identifier to build tables in pgis_tablefromflatgeobuf (Ariel Mashraki) - #6058, Use Pg composite_to_json() function in 19+ (Paul Ramsey) +- #6060, fully quality calls to helper functions (Paul Ramsey) diff --git a/postgis/postgis.sql.in b/postgis/postgis.sql.in index 398031528..1df639e7c 100644 --- a/postgis/postgis.sql.in +++ b/postgis/postgis.sql.in @@ -2251,18 +2251,18 @@ BEGIN IF use_typmod THEN BEGIN EXECUTE 'ALTER TABLE ' || quote_ident(gcs.nspname) || '.' || quote_ident(gcs.relname) || ' ALTER COLUMN ' || quote_ident(gcs.attname) || - ' TYPE geometry(' || postgis_type_name(gtype, gndims, true) || ', ' || gsrid::text || ') '; + ' TYPE geometry(' || @extschema at .postgis_type_name(gtype, gndims, true) || ', ' || gsrid::text || ') '; inserted := inserted + 1; EXCEPTION WHEN invalid_parameter_value OR feature_not_supported THEN - RAISE WARNING 'Could not convert ''%'' in ''%.%'' to use typmod with srid %, type %: %', quote_ident(gcs.attname), quote_ident(gcs.nspname), quote_ident(gcs.relname), gsrid, postgis_type_name(gtype, gndims, true), SQLERRM; + RAISE WARNING 'Could not convert ''%'' in ''%.%'' to use typmod with srid %, type %: %', quote_ident(gcs.attname), quote_ident(gcs.nspname), quote_ident(gcs.relname), gsrid, @extschema at .postgis_type_name(gtype, gndims, true), SQLERRM; gc_is_valid := false; END; ELSE -- Try to apply srid check to column constraint_successful = false; - IF (gsrid > 0 AND postgis_constraint_srid(gcs.nspname, gcs.relname,gcs.attname) IS NULL ) THEN + IF (gsrid > 0 AND @extschema at .postgis_constraint_srid(gcs.nspname, gcs.relname,gcs.attname) IS NULL ) THEN BEGIN EXECUTE 'ALTER TABLE ONLY ' || quote_ident(gcs.nspname) || '.' || quote_ident(gcs.relname) || ' ADD CONSTRAINT ' || quote_ident('enforce_srid_' || gcs.attname) || @@ -2276,7 +2276,7 @@ BEGIN END IF; -- Try to apply ndims check to column - IF (gndims IS NOT NULL AND postgis_constraint_dims(gcs.nspname, gcs.relname,gcs.attname) IS NULL ) THEN + IF (gndims IS NOT NULL AND @extschema at .postgis_constraint_dims(gcs.nspname, gcs.relname,gcs.attname) IS NULL ) THEN BEGIN EXECUTE 'ALTER TABLE ONLY ' || quote_ident(gcs.nspname) || '.' || quote_ident(gcs.relname) || ' ADD CONSTRAINT ' || quote_ident('enforce_dims_' || gcs.attname) || ' @@ -2290,7 +2290,7 @@ BEGIN END IF; -- Try to apply geometrytype check to column - IF (gtype IS NOT NULL AND postgis_constraint_type(gcs.nspname, gcs.relname,gcs.attname) IS NULL ) THEN + IF (gtype IS NOT NULL AND @extschema at .postgis_constraint_type(gcs.nspname, gcs.relname,gcs.attname) IS NULL ) THEN BEGIN EXECUTE 'ALTER TABLE ONLY ' || quote_ident(gcs.nspname) || '.' || quote_ident(gcs.relname) || ' ADD CONSTRAINT ' || quote_ident('enforce_geotype_' || gcs.attname) || ' @@ -2347,7 +2347,7 @@ DECLARE BEGIN -- Verify geometry type - IF (postgis_type_name(new_type,new_dim) IS NULL ) + IF (@extschema at .postgis_type_name(new_type,new_dim) IS NULL ) THEN RAISE EXCEPTION 'Invalid type name "%(%)" - valid ones are: POINT, MULTIPOINT, @@ -2752,7 +2752,7 @@ BEGIN END IF; END IF; - IF postgis_constraint_srid(real_schema, table_name, column_name) IS NOT NULL THEN + IF @extschema at .postgis_constraint_srid(real_schema, table_name, column_name) IS NOT NULL THEN -- srid was enforced with constraints before, keep it that way. -- Make up constraint name cname = 'enforce_srid_' || column_name; ----------------------------------------------------------------------- Summary of changes: NEWS | 1 + postgis/postgis.sql.in | 14 +++++++------- 2 files changed, 8 insertions(+), 7 deletions(-) hooks/post-receive -- PostGIS From trac at osgeo.org Mon Mar 23 09:43:39 2026 From: trac at osgeo.org (PostGIS) Date: Mon, 23 Mar 2026 16:43:39 -0000 Subject: [PostGIS] #6060: Fully quality calls to postgis functions in plpgsql In-Reply-To: <049.6b4e7fe4a1fc19f1fbe2f0abe6bf0708@osgeo.org> References: <049.6b4e7fe4a1fc19f1fbe2f0abe6bf0708@osgeo.org> Message-ID: <064.3dbb844138ac242e4d0fe5b3377bad2b@osgeo.org> #6060: Fully quality calls to postgis functions in plpgsql ----------------------+--------------------------- Reporter: pramsey | Owner: pramsey Type: defect | Status: assigned Priority: medium | Milestone: PostGIS 3.6.2 Component: postgis | Version: 3.6.x Resolution: | Keywords: ----------------------+--------------------------- Comment (by Paul Ramsey ): In [changeset:"daf6a4fd267c0ba50598de359789ef7296dc1c1d/git" daf6a4f/git]: {{{#!CommitTicketReference repository="git" revision="daf6a4fd267c0ba50598de359789ef7296dc1c1d" Fully quality calls to helper functions references #6060 }}} -- Ticket URL: PostGIS The PostGIS Trac is used for bug, enhancement & task tracking, a user and developer wiki, and a view into the subversion code repository of PostGIS project. From git at osgeo.org Mon Mar 23 09:44:28 2026 From: git at osgeo.org (git at osgeo.org) Date: Mon, 23 Mar 2026 09:44:28 -0700 (PDT) Subject: [SCM] PostGIS branch stable-3.5 updated. 3.5.5-10-g6eed59846 Message-ID: <20260323164429.25AF42184F@trac.osgeo.org> 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.5 has been updated via 6eed59846d005a297a0986a5aa20a1d108bfe231 (commit) from 8316e53d03ea6e5d20dddc579060ab4948de6219 (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 6eed59846d005a297a0986a5aa20a1d108bfe231 Author: Paul Ramsey Date: Mon Mar 23 09:44:06 2026 -0700 Fully quality calls to helper functions references #6060 diff --git a/NEWS b/NEWS index 1368fcc02..58e7e8bf4 100644 --- a/NEWS +++ b/NEWS @@ -11,6 +11,7 @@ PostgreSQL 12-18 required. GEOS 3.8+ required. Proj 6.1+ required. and Daniel Bakker - GH-850 Use quote_identifier to build tables in pgis_tablefromflatgeobuf (Ariel Mashraki) - #6058, Use Pg composite_to_json() function in 19+ (Paul Ramsey) + - #6060, fully quality calls to helper functions (Paul Ramsey) PostGIS 3.5.5 diff --git a/postgis/postgis.sql.in b/postgis/postgis.sql.in index 2b9a8fe76..f210096a8 100644 --- a/postgis/postgis.sql.in +++ b/postgis/postgis.sql.in @@ -2251,18 +2251,18 @@ BEGIN IF use_typmod THEN BEGIN EXECUTE 'ALTER TABLE ' || quote_ident(gcs.nspname) || '.' || quote_ident(gcs.relname) || ' ALTER COLUMN ' || quote_ident(gcs.attname) || - ' TYPE geometry(' || postgis_type_name(gtype, gndims, true) || ', ' || gsrid::text || ') '; + ' TYPE geometry(' || @extschema at .postgis_type_name(gtype, gndims, true) || ', ' || gsrid::text || ') '; inserted := inserted + 1; EXCEPTION WHEN invalid_parameter_value OR feature_not_supported THEN - RAISE WARNING 'Could not convert ''%'' in ''%.%'' to use typmod with srid %, type %: %', quote_ident(gcs.attname), quote_ident(gcs.nspname), quote_ident(gcs.relname), gsrid, postgis_type_name(gtype, gndims, true), SQLERRM; + RAISE WARNING 'Could not convert ''%'' in ''%.%'' to use typmod with srid %, type %: %', quote_ident(gcs.attname), quote_ident(gcs.nspname), quote_ident(gcs.relname), gsrid, @extschema at .postgis_type_name(gtype, gndims, true), SQLERRM; gc_is_valid := false; END; ELSE -- Try to apply srid check to column constraint_successful = false; - IF (gsrid > 0 AND postgis_constraint_srid(gcs.nspname, gcs.relname,gcs.attname) IS NULL ) THEN + IF (gsrid > 0 AND @extschema at .postgis_constraint_srid(gcs.nspname, gcs.relname,gcs.attname) IS NULL ) THEN BEGIN EXECUTE 'ALTER TABLE ONLY ' || quote_ident(gcs.nspname) || '.' || quote_ident(gcs.relname) || ' ADD CONSTRAINT ' || quote_ident('enforce_srid_' || gcs.attname) || @@ -2276,7 +2276,7 @@ BEGIN END IF; -- Try to apply ndims check to column - IF (gndims IS NOT NULL AND postgis_constraint_dims(gcs.nspname, gcs.relname,gcs.attname) IS NULL ) THEN + IF (gndims IS NOT NULL AND @extschema at .postgis_constraint_dims(gcs.nspname, gcs.relname,gcs.attname) IS NULL ) THEN BEGIN EXECUTE 'ALTER TABLE ONLY ' || quote_ident(gcs.nspname) || '.' || quote_ident(gcs.relname) || ' ADD CONSTRAINT ' || quote_ident('enforce_dims_' || gcs.attname) || ' @@ -2290,7 +2290,7 @@ BEGIN END IF; -- Try to apply geometrytype check to column - IF (gtype IS NOT NULL AND postgis_constraint_type(gcs.nspname, gcs.relname,gcs.attname) IS NULL ) THEN + IF (gtype IS NOT NULL AND @extschema at .postgis_constraint_type(gcs.nspname, gcs.relname,gcs.attname) IS NULL ) THEN BEGIN EXECUTE 'ALTER TABLE ONLY ' || quote_ident(gcs.nspname) || '.' || quote_ident(gcs.relname) || ' ADD CONSTRAINT ' || quote_ident('enforce_geotype_' || gcs.attname) || ' @@ -2347,7 +2347,7 @@ DECLARE BEGIN -- Verify geometry type - IF (postgis_type_name(new_type,new_dim) IS NULL ) + IF (@extschema at .postgis_type_name(new_type,new_dim) IS NULL ) THEN RAISE EXCEPTION 'Invalid type name "%(%)" - valid ones are: POINT, MULTIPOINT, @@ -2752,7 +2752,7 @@ BEGIN END IF; END IF; - IF postgis_constraint_srid(real_schema, table_name, column_name) IS NOT NULL THEN + IF @extschema at .postgis_constraint_srid(real_schema, table_name, column_name) IS NOT NULL THEN -- srid was enforced with constraints before, keep it that way. -- Make up constraint name cname = 'enforce_srid_' || column_name; ----------------------------------------------------------------------- Summary of changes: NEWS | 1 + postgis/postgis.sql.in | 14 +++++++------- 2 files changed, 8 insertions(+), 7 deletions(-) hooks/post-receive -- PostGIS From trac at osgeo.org Mon Mar 23 09:44:31 2026 From: trac at osgeo.org (PostGIS) Date: Mon, 23 Mar 2026 16:44:31 -0000 Subject: [PostGIS] #6060: Fully quality calls to postgis functions in plpgsql In-Reply-To: <049.6b4e7fe4a1fc19f1fbe2f0abe6bf0708@osgeo.org> References: <049.6b4e7fe4a1fc19f1fbe2f0abe6bf0708@osgeo.org> Message-ID: <064.bdf7390c8d06cb2d4b92317ce2e9f4db@osgeo.org> #6060: Fully quality calls to postgis functions in plpgsql ----------------------+--------------------------- Reporter: pramsey | Owner: pramsey Type: defect | Status: assigned Priority: medium | Milestone: PostGIS 3.6.2 Component: postgis | Version: 3.6.x Resolution: | Keywords: ----------------------+--------------------------- Comment (by Paul Ramsey ): In [changeset:"6eed59846d005a297a0986a5aa20a1d108bfe231/git" 6eed598/git]: {{{#!CommitTicketReference repository="git" revision="6eed59846d005a297a0986a5aa20a1d108bfe231" Fully quality calls to helper functions references #6060 }}} -- Ticket URL: PostGIS The PostGIS Trac is used for bug, enhancement & task tracking, a user and developer wiki, and a view into the subversion code repository of PostGIS project. From git at osgeo.org Mon Mar 23 09:45:22 2026 From: git at osgeo.org (git at osgeo.org) Date: Mon, 23 Mar 2026 09:45:22 -0700 (PDT) Subject: [SCM] PostGIS branch stable-3.4 updated. 3.4.5-12-g082500dfb Message-ID: <20260323164522.A41FB26493@trac.osgeo.org> 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.4 has been updated via 082500dfb81518dd16746e34fba4c2ca81d4bac4 (commit) from c8f4d72ea474b30b6e2b6271d26c3eed8c3e2ef9 (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 082500dfb81518dd16746e34fba4c2ca81d4bac4 Author: Paul Ramsey Date: Mon Mar 23 09:45:01 2026 -0700 Fully quality calls to helper functions References #6060 diff --git a/NEWS b/NEWS index 53bef2aeb..941b52c53 100644 --- a/NEWS +++ b/NEWS @@ -10,6 +10,7 @@ Proj 6.1+ required. Reported by Sven Klemm (Tiger Data), Allistair Ishmael Hakim (allistair.sh) and Daniel Bakker - GH-850 Use quote_identifier to build tables in pgis_tablefromflatgeobuf (Ariel Mashraki) + - #6060, fully quality calls to helper functions (Paul Ramsey) PostGIS 3.4.5 diff --git a/postgis/postgis.sql.in b/postgis/postgis.sql.in index f1175e101..27656e07c 100644 --- a/postgis/postgis.sql.in +++ b/postgis/postgis.sql.in @@ -2278,18 +2278,18 @@ BEGIN IF use_typmod THEN BEGIN EXECUTE 'ALTER TABLE ' || quote_ident(gcs.nspname) || '.' || quote_ident(gcs.relname) || ' ALTER COLUMN ' || quote_ident(gcs.attname) || - ' TYPE geometry(' || postgis_type_name(gtype, gndims, true) || ', ' || gsrid::text || ') '; + ' TYPE geometry(' || @extschema at .postgis_type_name(gtype, gndims, true) || ', ' || gsrid::text || ') '; inserted := inserted + 1; EXCEPTION WHEN invalid_parameter_value OR feature_not_supported THEN - RAISE WARNING 'Could not convert ''%'' in ''%.%'' to use typmod with srid %, type %: %', quote_ident(gcs.attname), quote_ident(gcs.nspname), quote_ident(gcs.relname), gsrid, postgis_type_name(gtype, gndims, true), SQLERRM; + RAISE WARNING 'Could not convert ''%'' in ''%.%'' to use typmod with srid %, type %: %', quote_ident(gcs.attname), quote_ident(gcs.nspname), quote_ident(gcs.relname), gsrid, @extschema at .postgis_type_name(gtype, gndims, true), SQLERRM; gc_is_valid := false; END; ELSE -- Try to apply srid check to column constraint_successful = false; - IF (gsrid > 0 AND postgis_constraint_srid(gcs.nspname, gcs.relname,gcs.attname) IS NULL ) THEN + IF (gsrid > 0 AND @extschema at .postgis_constraint_srid(gcs.nspname, gcs.relname,gcs.attname) IS NULL ) THEN BEGIN EXECUTE 'ALTER TABLE ONLY ' || quote_ident(gcs.nspname) || '.' || quote_ident(gcs.relname) || ' ADD CONSTRAINT ' || quote_ident('enforce_srid_' || gcs.attname) || @@ -2303,7 +2303,7 @@ BEGIN END IF; -- Try to apply ndims check to column - IF (gndims IS NOT NULL AND postgis_constraint_dims(gcs.nspname, gcs.relname,gcs.attname) IS NULL ) THEN + IF (gndims IS NOT NULL AND @extschema at .postgis_constraint_dims(gcs.nspname, gcs.relname,gcs.attname) IS NULL ) THEN BEGIN EXECUTE 'ALTER TABLE ONLY ' || quote_ident(gcs.nspname) || '.' || quote_ident(gcs.relname) || ' ADD CONSTRAINT ' || quote_ident('enforce_dims_' || gcs.attname) || ' @@ -2317,7 +2317,7 @@ BEGIN END IF; -- Try to apply geometrytype check to column - IF (gtype IS NOT NULL AND postgis_constraint_type(gcs.nspname, gcs.relname,gcs.attname) IS NULL ) THEN + IF (gtype IS NOT NULL AND @extschema at .postgis_constraint_type(gcs.nspname, gcs.relname,gcs.attname) IS NULL ) THEN BEGIN EXECUTE 'ALTER TABLE ONLY ' || quote_ident(gcs.nspname) || '.' || quote_ident(gcs.relname) || ' ADD CONSTRAINT ' || quote_ident('enforce_geotype_' || gcs.attname) || ' @@ -2374,7 +2374,7 @@ DECLARE BEGIN -- Verify geometry type - IF (postgis_type_name(new_type,new_dim) IS NULL ) + IF (@extschema at .postgis_type_name(new_type,new_dim) IS NULL ) THEN RAISE EXCEPTION 'Invalid type name "%(%)" - valid ones are: POINT, MULTIPOINT, @@ -2779,7 +2779,7 @@ BEGIN END IF; END IF; - IF postgis_constraint_srid(real_schema, table_name, column_name) IS NOT NULL THEN + IF @extschema at .postgis_constraint_srid(real_schema, table_name, column_name) IS NOT NULL THEN -- srid was enforced with constraints before, keep it that way. -- Make up constraint name cname = 'enforce_srid_' || column_name; ----------------------------------------------------------------------- Summary of changes: NEWS | 1 + postgis/postgis.sql.in | 14 +++++++------- 2 files changed, 8 insertions(+), 7 deletions(-) hooks/post-receive -- PostGIS From trac at osgeo.org Mon Mar 23 09:45:24 2026 From: trac at osgeo.org (PostGIS) Date: Mon, 23 Mar 2026 16:45:24 -0000 Subject: [PostGIS] #6060: Fully quality calls to postgis functions in plpgsql In-Reply-To: <049.6b4e7fe4a1fc19f1fbe2f0abe6bf0708@osgeo.org> References: <049.6b4e7fe4a1fc19f1fbe2f0abe6bf0708@osgeo.org> Message-ID: <064.ef197fde3faa815b6a4baebd4a81ef32@osgeo.org> #6060: Fully quality calls to postgis functions in plpgsql ----------------------+--------------------------- Reporter: pramsey | Owner: pramsey Type: defect | Status: assigned Priority: medium | Milestone: PostGIS 3.6.2 Component: postgis | Version: 3.6.x Resolution: | Keywords: ----------------------+--------------------------- Comment (by Paul Ramsey ): In [changeset:"082500dfb81518dd16746e34fba4c2ca81d4bac4/git" 082500d/git]: {{{#!CommitTicketReference repository="git" revision="082500dfb81518dd16746e34fba4c2ca81d4bac4" Fully quality calls to helper functions References #6060 }}} -- Ticket URL: PostGIS The PostGIS Trac is used for bug, enhancement & task tracking, a user and developer wiki, and a view into the subversion code repository of PostGIS project. From git at osgeo.org Mon Mar 23 09:46:12 2026 From: git at osgeo.org (git at osgeo.org) Date: Mon, 23 Mar 2026 09:46:12 -0700 (PDT) Subject: [SCM] PostGIS branch stable-3.2 updated. 3.2.9-6-g458f75030 Message-ID: <20260323164613.00BFE26495@trac.osgeo.org> 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.2 has been updated via 458f750305a0986d7aac6ab47d4a6fa576d153eb (commit) from b11c9463196e52246bc6b425f8bb21a967e1ad00 (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 458f750305a0986d7aac6ab47d4a6fa576d153eb Author: Paul Ramsey Date: Mon Mar 23 09:45:52 2026 -0700 Fully quality calls to helper functions references #6060 diff --git a/NEWS b/NEWS index 66227222d..5c95631e9 100644 --- a/NEWS +++ b/NEWS @@ -10,6 +10,7 @@ Proj 4.9+ required. of postgis_tiger_geocoder extension, create/update (Regina Obe) - #6054, Remove priv escalation scenario. Reported by Daniel Bakker - GH-850 Use quote_identifier to build tables in pgis_tablefromflatgeobuf (Ariel Mashraki) + - #6060, fully quality calls to helper functions (Paul Ramsey) PostGIS 3.2.9 diff --git a/postgis/postgis.sql.in b/postgis/postgis.sql.in index 23cf2bcee..d28756e8d 100644 --- a/postgis/postgis.sql.in +++ b/postgis/postgis.sql.in @@ -2200,18 +2200,18 @@ BEGIN IF use_typmod THEN BEGIN EXECUTE 'ALTER TABLE ' || quote_ident(gcs.nspname) || '.' || quote_ident(gcs.relname) || ' ALTER COLUMN ' || quote_ident(gcs.attname) || - ' TYPE geometry(' || postgis_type_name(gtype, gndims, true) || ', ' || gsrid::text || ') '; + ' TYPE geometry(' || @extschema at .postgis_type_name(gtype, gndims, true) || ', ' || gsrid::text || ') '; inserted := inserted + 1; EXCEPTION WHEN invalid_parameter_value OR feature_not_supported THEN - RAISE WARNING 'Could not convert ''%'' in ''%.%'' to use typmod with srid %, type %: %', quote_ident(gcs.attname), quote_ident(gcs.nspname), quote_ident(gcs.relname), gsrid, postgis_type_name(gtype, gndims, true), SQLERRM; + RAISE WARNING 'Could not convert ''%'' in ''%.%'' to use typmod with srid %, type %: %', quote_ident(gcs.attname), quote_ident(gcs.nspname), quote_ident(gcs.relname), gsrid, @extschema at .postgis_type_name(gtype, gndims, true), SQLERRM; gc_is_valid := false; END; ELSE -- Try to apply srid check to column constraint_successful = false; - IF (gsrid > 0 AND postgis_constraint_srid(gcs.nspname, gcs.relname,gcs.attname) IS NULL ) THEN + IF (gsrid > 0 AND @extschema at .postgis_constraint_srid(gcs.nspname, gcs.relname,gcs.attname) IS NULL ) THEN BEGIN EXECUTE 'ALTER TABLE ONLY ' || quote_ident(gcs.nspname) || '.' || quote_ident(gcs.relname) || ' ADD CONSTRAINT ' || quote_ident('enforce_srid_' || gcs.attname) || @@ -2225,7 +2225,7 @@ BEGIN END IF; -- Try to apply ndims check to column - IF (gndims IS NOT NULL AND postgis_constraint_dims(gcs.nspname, gcs.relname,gcs.attname) IS NULL ) THEN + IF (gndims IS NOT NULL AND @extschema at .postgis_constraint_dims(gcs.nspname, gcs.relname,gcs.attname) IS NULL ) THEN BEGIN EXECUTE 'ALTER TABLE ONLY ' || quote_ident(gcs.nspname) || '.' || quote_ident(gcs.relname) || ' ADD CONSTRAINT ' || quote_ident('enforce_dims_' || gcs.attname) || ' @@ -2239,7 +2239,7 @@ BEGIN END IF; -- Try to apply geometrytype check to column - IF (gtype IS NOT NULL AND postgis_constraint_type(gcs.nspname, gcs.relname,gcs.attname) IS NULL ) THEN + IF (gtype IS NOT NULL AND @extschema at .postgis_constraint_type(gcs.nspname, gcs.relname,gcs.attname) IS NULL ) THEN BEGIN EXECUTE 'ALTER TABLE ONLY ' || quote_ident(gcs.nspname) || '.' || quote_ident(gcs.relname) || ' ADD CONSTRAINT ' || quote_ident('enforce_geotype_' || gcs.attname) || ' @@ -2296,7 +2296,7 @@ DECLARE BEGIN -- Verify geometry type - IF (postgis_type_name(new_type,new_dim) IS NULL ) + IF (@extschema at .postgis_type_name(new_type,new_dim) IS NULL ) THEN RAISE EXCEPTION 'Invalid type name "%(%)" - valid ones are: POINT, MULTIPOINT, @@ -2701,7 +2701,7 @@ BEGIN END IF; END IF; - IF postgis_constraint_srid(real_schema, table_name, column_name) IS NOT NULL THEN + IF @extschema at .postgis_constraint_srid(real_schema, table_name, column_name) IS NOT NULL THEN -- srid was enforced with constraints before, keep it that way. -- Make up constraint name cname = 'enforce_srid_' || column_name; ----------------------------------------------------------------------- Summary of changes: NEWS | 1 + postgis/postgis.sql.in | 14 +++++++------- 2 files changed, 8 insertions(+), 7 deletions(-) hooks/post-receive -- PostGIS From trac at osgeo.org Mon Mar 23 09:46:14 2026 From: trac at osgeo.org (PostGIS) Date: Mon, 23 Mar 2026 16:46:14 -0000 Subject: [PostGIS] #6060: Fully quality calls to postgis functions in plpgsql In-Reply-To: <049.6b4e7fe4a1fc19f1fbe2f0abe6bf0708@osgeo.org> References: <049.6b4e7fe4a1fc19f1fbe2f0abe6bf0708@osgeo.org> Message-ID: <064.5085ca0dd13c978733047c18f940d5ea@osgeo.org> #6060: Fully quality calls to postgis functions in plpgsql ----------------------+--------------------------- Reporter: pramsey | Owner: pramsey Type: defect | Status: assigned Priority: medium | Milestone: PostGIS 3.6.2 Component: postgis | Version: 3.6.x Resolution: | Keywords: ----------------------+--------------------------- Comment (by Paul Ramsey ): In [changeset:"458f750305a0986d7aac6ab47d4a6fa576d153eb/git" 458f7503/git]: {{{#!CommitTicketReference repository="git" revision="458f750305a0986d7aac6ab47d4a6fa576d153eb" Fully quality calls to helper functions references #6060 }}} -- Ticket URL: PostGIS The PostGIS Trac is used for bug, enhancement & task tracking, a user and developer wiki, and a view into the subversion code repository of PostGIS project. From git at osgeo.org Mon Mar 23 09:47:08 2026 From: git at osgeo.org (git at osgeo.org) Date: Mon, 23 Mar 2026 09:47:08 -0700 (PDT) Subject: [SCM] PostGIS branch stable-3.3 updated. 3.3.9-10-gf47c0154e Message-ID: <20260323164708.DE04321851@trac.osgeo.org> 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.3 has been updated via f47c0154ed450c0d4c30f91daa9c8797d0f94c35 (commit) from 0d4f9dce49d14a996500cc3acc6d04d771496cf9 (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 f47c0154ed450c0d4c30f91daa9c8797d0f94c35 Author: Paul Ramsey Date: Mon Mar 23 09:46:37 2026 -0700 Fully quality calls to helper functions references #6060 diff --git a/NEWS b/NEWS index d95d911c4..afccd4faf 100644 --- a/NEWS +++ b/NEWS @@ -9,6 +9,7 @@ PostGIS 3.3.10 Reported by Sven Klemm (Tiger Data), Allistair Ishmael Hakim (allistair.sh) and Daniel Bakker - GH-850 Use quote_identifier to build tables in pgis_tablefromflatgeobuf (Ariel Mashraki) + - #6060, fully quality calls to helper functions (Paul Ramsey) PostGIS 3.3.9 diff --git a/postgis/postgis.sql.in b/postgis/postgis.sql.in index bb1bad9b9..ecde392fd 100644 --- a/postgis/postgis.sql.in +++ b/postgis/postgis.sql.in @@ -2217,18 +2217,18 @@ BEGIN IF use_typmod THEN BEGIN EXECUTE 'ALTER TABLE ' || quote_ident(gcs.nspname) || '.' || quote_ident(gcs.relname) || ' ALTER COLUMN ' || quote_ident(gcs.attname) || - ' TYPE geometry(' || postgis_type_name(gtype, gndims, true) || ', ' || gsrid::text || ') '; + ' TYPE geometry(' || @extschema at .postgis_type_name(gtype, gndims, true) || ', ' || gsrid::text || ') '; inserted := inserted + 1; EXCEPTION WHEN invalid_parameter_value OR feature_not_supported THEN - RAISE WARNING 'Could not convert ''%'' in ''%.%'' to use typmod with srid %, type %: %', quote_ident(gcs.attname), quote_ident(gcs.nspname), quote_ident(gcs.relname), gsrid, postgis_type_name(gtype, gndims, true), SQLERRM; + RAISE WARNING 'Could not convert ''%'' in ''%.%'' to use typmod with srid %, type %: %', quote_ident(gcs.attname), quote_ident(gcs.nspname), quote_ident(gcs.relname), gsrid, @extschema at .postgis_type_name(gtype, gndims, true), SQLERRM; gc_is_valid := false; END; ELSE -- Try to apply srid check to column constraint_successful = false; - IF (gsrid > 0 AND postgis_constraint_srid(gcs.nspname, gcs.relname,gcs.attname) IS NULL ) THEN + IF (gsrid > 0 AND @extschema at .postgis_constraint_srid(gcs.nspname, gcs.relname,gcs.attname) IS NULL ) THEN BEGIN EXECUTE 'ALTER TABLE ONLY ' || quote_ident(gcs.nspname) || '.' || quote_ident(gcs.relname) || ' ADD CONSTRAINT ' || quote_ident('enforce_srid_' || gcs.attname) || @@ -2242,7 +2242,7 @@ BEGIN END IF; -- Try to apply ndims check to column - IF (gndims IS NOT NULL AND postgis_constraint_dims(gcs.nspname, gcs.relname,gcs.attname) IS NULL ) THEN + IF (gndims IS NOT NULL AND @extschema at .postgis_constraint_dims(gcs.nspname, gcs.relname,gcs.attname) IS NULL ) THEN BEGIN EXECUTE 'ALTER TABLE ONLY ' || quote_ident(gcs.nspname) || '.' || quote_ident(gcs.relname) || ' ADD CONSTRAINT ' || quote_ident('enforce_dims_' || gcs.attname) || ' @@ -2256,7 +2256,7 @@ BEGIN END IF; -- Try to apply geometrytype check to column - IF (gtype IS NOT NULL AND postgis_constraint_type(gcs.nspname, gcs.relname,gcs.attname) IS NULL ) THEN + IF (gtype IS NOT NULL AND @extschema at .postgis_constraint_type(gcs.nspname, gcs.relname,gcs.attname) IS NULL ) THEN BEGIN EXECUTE 'ALTER TABLE ONLY ' || quote_ident(gcs.nspname) || '.' || quote_ident(gcs.relname) || ' ADD CONSTRAINT ' || quote_ident('enforce_geotype_' || gcs.attname) || ' @@ -2313,7 +2313,7 @@ DECLARE BEGIN -- Verify geometry type - IF (postgis_type_name(new_type,new_dim) IS NULL ) + IF (@extschema at .postgis_type_name(new_type,new_dim) IS NULL ) THEN RAISE EXCEPTION 'Invalid type name "%(%)" - valid ones are: POINT, MULTIPOINT, @@ -2718,7 +2718,7 @@ BEGIN END IF; END IF; - IF postgis_constraint_srid(real_schema, table_name, column_name) IS NOT NULL THEN + IF @extschema at .postgis_constraint_srid(real_schema, table_name, column_name) IS NOT NULL THEN -- srid was enforced with constraints before, keep it that way. -- Make up constraint name cname = 'enforce_srid_' || column_name; ----------------------------------------------------------------------- Summary of changes: NEWS | 1 + postgis/postgis.sql.in | 14 +++++++------- 2 files changed, 8 insertions(+), 7 deletions(-) hooks/post-receive -- PostGIS From trac at osgeo.org Mon Mar 23 09:47:10 2026 From: trac at osgeo.org (PostGIS) Date: Mon, 23 Mar 2026 16:47:10 -0000 Subject: [PostGIS] #6060: Fully quality calls to postgis functions in plpgsql In-Reply-To: <049.6b4e7fe4a1fc19f1fbe2f0abe6bf0708@osgeo.org> References: <049.6b4e7fe4a1fc19f1fbe2f0abe6bf0708@osgeo.org> Message-ID: <064.0d1eda6c63245caf4cb84601f16e5f6f@osgeo.org> #6060: Fully quality calls to postgis functions in plpgsql ----------------------+--------------------------- Reporter: pramsey | Owner: pramsey Type: defect | Status: assigned Priority: medium | Milestone: PostGIS 3.6.2 Component: postgis | Version: 3.6.x Resolution: | Keywords: ----------------------+--------------------------- Comment (by Paul Ramsey ): In [changeset:"f47c0154ed450c0d4c30f91daa9c8797d0f94c35/git" f47c015/git]: {{{#!CommitTicketReference repository="git" revision="f47c0154ed450c0d4c30f91daa9c8797d0f94c35" Fully quality calls to helper functions references #6060 }}} -- Ticket URL: PostGIS The PostGIS Trac is used for bug, enhancement & task tracking, a user and developer wiki, and a view into the subversion code repository of PostGIS project. From git at osgeo.org Mon Mar 23 11:08:02 2026 From: git at osgeo.org (git at osgeo.org) Date: Mon, 23 Mar 2026 11:08:02 -0700 (PDT) Subject: [SCM] PostGIS branch master updated. 3.6.0rc2-407-gbebe97d1a Message-ID: <20260323180803.48ECB266BB@trac.osgeo.org> 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 bebe97d1abb3c2208f29533d40fe78a08c0cf0b6 (commit) via 08f383f7cfe6da372592a096876c1cb7c2fefc44 (commit) via 913caaedf89827cbc61fc9b3b0ee283a2fdff866 (commit) via acf474815d0c0bcf442ee5784050dcae5da68aef (commit) from c52110c83f015716df310dd94d48ff76abdd7620 (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 bebe97d1abb3c2208f29533d40fe78a08c0cf0b6 Author: Paul Ramsey Date: Mon Mar 23 10:59:53 2026 -0700 remove K&R style handling of zero-arg functions diff --git a/raster/rt_pg/rtpg_pixel.c b/raster/rt_pg/rtpg_pixel.c index 38f6ccb34..9aa65ebea 100644 --- a/raster/rt_pg/rtpg_pixel.c +++ b/raster/rt_pg/rtpg_pixel.c @@ -1292,7 +1292,7 @@ struct rtpg_setvaluesgv_geomval_t { rt_raster mask; }; -static rtpg_setvaluesgv_arg rtpg_setvaluesgv_arg_init() { +static rtpg_setvaluesgv_arg rtpg_setvaluesgv_arg_init(void) { rtpg_setvaluesgv_arg arg = palloc(sizeof(struct rtpg_setvaluesgv_arg_t)); if (arg == NULL) { elog(ERROR, "rtpg_setvaluesgv_arg_init: Could not allocate memory for function arguments"); commit 08f383f7cfe6da372592a096876c1cb7c2fefc44 Author: Paul Ramsey Date: Mon Mar 23 10:53:04 2026 -0700 remove K&R style handling of zero-arg functions diff --git a/raster/rt_pg/rtpg_statistics.c b/raster/rt_pg/rtpg_statistics.c index bffdf0e6b..03219f74e 100644 --- a/raster/rt_pg/rtpg_statistics.c +++ b/raster/rt_pg/rtpg_statistics.c @@ -513,7 +513,7 @@ rtpg_summarystats_arg_destroy(rtpg_summarystats_arg arg) { } static rtpg_summarystats_arg -rtpg_summarystats_arg_init() { +rtpg_summarystats_arg_init(void) { rtpg_summarystats_arg arg = NULL; arg = palloc(sizeof(struct rtpg_summarystats_arg_t)); commit 913caaedf89827cbc61fc9b3b0ee283a2fdff866 Author: Paul Ramsey Date: Mon Mar 23 10:50:28 2026 -0700 remove K&R style handling of zero-arg functions diff --git a/liblwgeom/cunit/cu_ptarray.c b/liblwgeom/cunit/cu_ptarray.c index 6d8ea2faa..8cf3d8c11 100644 --- a/liblwgeom/cunit/cu_ptarray.c +++ b/liblwgeom/cunit/cu_ptarray.c @@ -314,7 +314,7 @@ static void test_ptarray_isccw(void) lwpoly_free(poly); } -static void test_ptarray_signed_area() +static void test_ptarray_signed_area(void) { LWLINE *line; double area; @@ -340,7 +340,7 @@ static void test_ptarray_signed_area() } -static void test_ptarray_contains_point() +static void test_ptarray_contains_point(void) { /* int ptarray_contains_point(const POINTARRAY *pa, const POINT2D *pt, int *winding_number) */ @@ -440,7 +440,7 @@ static void test_ptarray_contains_point() lwline_free(lwline); } -static void test_ptarrayarc_contains_point() +static void test_ptarrayarc_contains_point(void) { /* int ptarrayarc_contains_point(const POINTARRAY *pa, const POINT2D *pt) */ @@ -578,7 +578,7 @@ static void test_ptarrayarc_contains_point() lwcircstring_free(lwcirc); } -static void test_ptarray_scale() +static void test_ptarray_scale(void) { LWLINE *line; POINTARRAY *pa; @@ -627,7 +627,7 @@ static void test_ptarray_scale() lwline_free(line); } -static void test_ptarray_scroll() +static void test_ptarray_scroll(void) { LWLINE *line; POINTARRAY *pa; @@ -664,7 +664,7 @@ static void test_ptarray_scroll() lwline_free(line); } -static void test_ptarray_closest_vertex_2d() +static void test_ptarray_closest_vertex_2d(void) { LWLINE *line; POINTARRAY *pa; @@ -696,7 +696,7 @@ static void test_ptarray_closest_vertex_2d() lwline_free(line); } -static void test_ptarray_closest_segment_2d() +static void test_ptarray_closest_segment_2d(void) { LWLINE *line; POINTARRAY *pa; diff --git a/liblwgeom/cunit/cu_remove_irrelevant_points_for_view.c b/liblwgeom/cunit/cu_remove_irrelevant_points_for_view.c index b3bbcbcd0..ce796b939 100644 --- a/liblwgeom/cunit/cu_remove_irrelevant_points_for_view.c +++ b/liblwgeom/cunit/cu_remove_irrelevant_points_for_view.c @@ -15,7 +15,6 @@ #include "lwgeom_remove_irrelevant_points_for_view.h" -// test case for lwgeom_remove_irrelevant_points_for_view() static void test_lwgeom_remove_irrelevant_points_for_view(void) { LWGEOM *geom; diff --git a/liblwgeom/cunit/cu_tester.c b/liblwgeom/cunit/cu_tester.c index 0df215893..708b8070c 100644 --- a/liblwgeom/cunit/cu_tester.c +++ b/liblwgeom/cunit/cu_tester.c @@ -30,12 +30,12 @@ cu_debuglogger(int level, const char *fmt, va_list ap); /* ADD YOUR SUITE SETUP FUNCTION HERE (1 of 2) */ -extern void print_suite_setup(); -extern void algorithms_suite_setup(); -extern void boundary_suite_setup(); -extern void buildarea_suite_setup(); -extern void clean_suite_setup(); -extern void clip_by_rect_suite_setup(); +extern void print_suite_setup(void); +extern void algorithms_suite_setup(void); +extern void boundary_suite_setup(void); +extern void buildarea_suite_setup(void); +extern void clean_suite_setup(void); +extern void clip_by_rect_suite_setup(void); extern void force_dims_suite_setup(void); extern void force_sfs_suite_setup(void); extern void geodetic_suite_setup(void); diff --git a/liblwgeom/lwboundingcircle.c b/liblwgeom/lwboundingcircle.c index ba6bc40d7..673b40a1f 100644 --- a/liblwgeom/lwboundingcircle.c +++ b/liblwgeom/lwboundingcircle.c @@ -33,7 +33,7 @@ typedef struct { } SUPPORTING_POINTS; static SUPPORTING_POINTS* -supporting_points_create() +supporting_points_create(void) { SUPPORTING_POINTS* s = lwalloc(sizeof(SUPPORTING_POINTS)); s->p1 = NULL; @@ -214,7 +214,7 @@ calculate_mbc(const POINT2D** points, uint32_t max_n, SUPPORTING_POINTS* support } static LWBOUNDINGCIRCLE* -lwboundingcircle_create() +lwboundingcircle_create(void) { LWBOUNDINGCIRCLE* c = lwalloc(sizeof(LWBOUNDINGCIRCLE)); c->center = lwalloc(sizeof(POINT2D)); diff --git a/liblwgeom/lwgeom_api.c b/liblwgeom/lwgeom_api.c index 8d5a0f0e1..99e51b0ca 100644 --- a/liblwgeom/lwgeom_api.c +++ b/liblwgeom/lwgeom_api.c @@ -35,7 +35,7 @@ #define str(s) #s const char * -lwgeom_version() +lwgeom_version(void) { static char *ptr = NULL; static char buf[256]; @@ -655,11 +655,11 @@ interpolate_point4d(const POINT4D *A, const POINT4D *B, POINT4D *I, double F) int _lwgeom_interrupt_requested = 0; void -lwgeom_request_interrupt() { +lwgeom_request_interrupt(void) { _lwgeom_interrupt_requested = 1; } void -lwgeom_cancel_interrupt() { +lwgeom_cancel_interrupt(void) { _lwgeom_interrupt_requested = 0; } diff --git a/loader/cunit/cu_tester.c b/loader/cunit/cu_tester.c index d47d5b1aa..37fd810ec 100644 --- a/loader/cunit/cu_tester.c +++ b/loader/cunit/cu_tester.c @@ -20,7 +20,7 @@ ** Returns a CUE_SUCCESS on successful running, another ** CUnit error code on failure. */ -int main() +int main(void) { /* initialize the CUnit test registry */ diff --git a/raster/rt_pg/rtpg_pixel.c b/raster/rt_pg/rtpg_pixel.c index 2bfecf4d4..38f6ccb34 100644 --- a/raster/rt_pg/rtpg_pixel.c +++ b/raster/rt_pg/rtpg_pixel.c @@ -349,7 +349,7 @@ struct rtpg_dumpvalues_arg_t { bool **nodata; }; -static rtpg_dumpvalues_arg rtpg_dumpvalues_arg_init() { +static rtpg_dumpvalues_arg rtpg_dumpvalues_arg_init(void) { rtpg_dumpvalues_arg arg = NULL; arg = palloc(sizeof(struct rtpg_dumpvalues_arg_t)); diff --git a/raster/test/cunit/cu_band_basics.c b/raster/test/cunit/cu_band_basics.c index 5219442e9..6a67f5d28 100644 --- a/raster/test/cunit/cu_band_basics.c +++ b/raster/test/cunit/cu_band_basics.c @@ -25,7 +25,7 @@ #include "CUnit/Basic.h" #include "cu_tester.h" -static void test_band_metadata() { +static void test_band_metadata(void) { rt_raster rast = NULL; uint8_t *data = NULL; rt_band band = NULL; @@ -147,7 +147,7 @@ static void test_band_metadata() { cu_free_raster(rast); } -static void test_band_pixtype_1BB() { +static void test_band_pixtype_1BB(void) { rt_pixtype pixtype = PT_1BB; uint8_t *data = NULL; rt_band band = NULL; @@ -221,7 +221,7 @@ static void test_band_pixtype_1BB() { rt_band_destroy(band); } -static void test_band_pixtype_2BUI() { +static void test_band_pixtype_2BUI(void) { rt_pixtype pixtype = PT_2BUI; uint8_t *data = NULL; rt_band band = NULL; @@ -313,7 +313,7 @@ static void test_band_pixtype_2BUI() { rt_band_destroy(band); } -static void test_band_pixtype_4BUI() { +static void test_band_pixtype_4BUI(void) { rt_pixtype pixtype = PT_4BUI; uint8_t *data = NULL; rt_band band = NULL; @@ -419,7 +419,7 @@ static void test_band_pixtype_4BUI() { rt_band_destroy(band); } -static void test_band_pixtype_8BUI() { +static void test_band_pixtype_8BUI(void) { rt_pixtype pixtype = PT_8BUI; uint8_t *data = NULL; rt_band band = NULL; @@ -527,7 +527,7 @@ static void test_band_pixtype_8BUI() { rt_band_destroy(band); } -static void test_band_pixtype_8BSI() { +static void test_band_pixtype_8BSI(void) { rt_pixtype pixtype = PT_8BSI; uint8_t *data = NULL; rt_band band = NULL; @@ -659,7 +659,7 @@ static void test_band_pixtype_8BSI() { rt_band_destroy(band); } -static void test_band_pixtype_16BUI() { +static void test_band_pixtype_16BUI(void) { rt_pixtype pixtype = PT_16BUI; uint8_t *data = NULL; rt_band band = NULL; @@ -748,7 +748,7 @@ static void test_band_pixtype_16BUI() { rt_band_destroy(band); } -static void test_band_pixtype_16BSI() { +static void test_band_pixtype_16BSI(void) { rt_pixtype pixtype = PT_16BSI; uint8_t *data = NULL; rt_band band = NULL; @@ -860,7 +860,7 @@ static void test_band_pixtype_16BSI() { rt_band_destroy(band); } -static void test_band_pixtype_32BUI() { +static void test_band_pixtype_32BUI(void) { rt_pixtype pixtype = PT_32BUI; uint8_t *data = NULL; rt_band band = NULL; @@ -956,7 +956,7 @@ static void test_band_pixtype_32BUI() { rt_band_destroy(band); } -static void test_band_pixtype_32BSI() { +static void test_band_pixtype_32BSI(void) { rt_pixtype pixtype = PT_32BSI; uint8_t *data = NULL; rt_band band = NULL; @@ -1053,7 +1053,7 @@ static void test_band_pixtype_32BSI() { rt_band_destroy(band); } -static void test_band_pixtype_32BF() { +static void test_band_pixtype_32BF(void) { rt_pixtype pixtype = PT_32BF; uint8_t *data = NULL; rt_band band = NULL; @@ -1135,7 +1135,7 @@ static void test_band_pixtype_32BF() { rt_band_destroy(band); } -static void test_band_pixtype_64BF() { +static void test_band_pixtype_64BF(void) { rt_pixtype pixtype = PT_64BF; uint8_t *data = NULL; rt_band band = NULL; @@ -1217,7 +1217,7 @@ static void test_band_pixtype_64BF() { rt_band_destroy(band); } -static void test_band_get_pixel_line() { +static void test_band_get_pixel_line(void) { rt_raster rast; rt_band band; int maxX = 5; @@ -1259,7 +1259,7 @@ static void test_band_get_pixel_line() { cu_free_raster(rast); } -static void test_band_new_offline_from_path() { +static void test_band_new_offline_from_path(void) { rt_band band = NULL; int width = 10; int height = 10; diff --git a/raster/test/cunit/cu_band_misc.c b/raster/test/cunit/cu_band_misc.c index 0e1686564..f3af3f0a4 100644 --- a/raster/test/cunit/cu_band_misc.c +++ b/raster/test/cunit/cu_band_misc.c @@ -25,7 +25,7 @@ #include "cu_tester.h" #include -static void test_band_get_nearest_pixel() { +static void test_band_get_nearest_pixel(void) { rt_raster rast; rt_band band; int x, y; @@ -287,7 +287,7 @@ static void test_band_get_nearest_pixel() { cu_free_raster(rast); } -static void test_band_get_pixel_of_value() { +static void test_band_get_pixel_of_value(void) { rt_raster rast; rt_band band; uint32_t x, y; @@ -367,7 +367,7 @@ static void test_band_get_pixel_of_value() { cu_free_raster(rast); } -static void test_pixel_set_to_array(){ +static void test_pixel_set_to_array(void){ rt_raster rast; rt_band band; rt_mask mask = NULL; diff --git a/raster/test/cunit/cu_band_stats.c b/raster/test/cunit/cu_band_stats.c index cf1534987..499f37afc 100644 --- a/raster/test/cunit/cu_band_stats.c +++ b/raster/test/cunit/cu_band_stats.c @@ -24,7 +24,7 @@ #include "CUnit/Basic.h" #include "cu_tester.h" -static void test_band_stats() { +static void test_band_stats(void) { rt_bandstats stats = NULL; rt_histogram histogram = NULL; double bin_width[] = {100}; @@ -209,7 +209,7 @@ static void test_band_stats() { cu_free_raster(raster); } -static void test_band_value_count() { +static void test_band_value_count(void) { rt_valuecount vcnts = NULL; rt_raster raster; diff --git a/raster/test/cunit/cu_gdal.c b/raster/test/cunit/cu_gdal.c index 4420d2062..18b1b6314 100644 --- a/raster/test/cunit/cu_gdal.c +++ b/raster/test/cunit/cu_gdal.c @@ -25,11 +25,11 @@ #include "CUnit/Basic.h" #include "cu_tester.h" -static void test_gdal_configured() { +static void test_gdal_configured(void) { CU_ASSERT(rt_util_gdal_configured()); } -static void test_gdal_drivers() { +static void test_gdal_drivers(void) { uint32_t i; uint32_t size; rt_gdaldriver drv = NULL; @@ -47,7 +47,7 @@ static void test_gdal_drivers() { rtdealloc(drv); } -static void test_gdal_rasterize() { +static void test_gdal_rasterize(void) { rt_raster raster; char srs[] = "PROJCS[\"unnamed\",GEOGCS[\"unnamed ellipse\",DATUM[\"unknown\",SPHEROID[\"unnamed\",6370997,0]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433]],PROJECTION[\"Lambert_Azimuthal_Equal_Area\"],PARAMETER[\"latitude_of_center\",45],PARAMETER[\"longitude_of_center\",-100],PARAMETER[\"false_easting\",0],PARAMETER[\"false_northing\",0],UNIT[\"Meter\",1],AUTHORITY[\"EPSG\",\"2163\"]]"; const char wkb_hex[] = "010300000001000000050000000000000080841ec100000000600122410000000080841ec100000000804f22410000000040e81dc100000000804f22410000000040e81dc100000000600122410000000080841ec10000000060012241"; @@ -152,7 +152,7 @@ static rt_raster fillRasterToPolygonize(int hasnodata, double nodataval) { return raster; } -static void test_gdal_polygonize() { +static void test_gdal_polygonize(void) { int i; rt_raster rt; int nPols = 0; @@ -301,7 +301,7 @@ test_gdal_polygonize_interrupt(void) cu_free_raster(rt); } -static void test_raster_to_gdal() { +static void test_raster_to_gdal(void) { rt_pixtype pixtype = PT_64BF; rt_raster raster = NULL; rt_band band = NULL; @@ -374,7 +374,7 @@ static void test_raster_to_gdal() { cu_free_raster(raster); } -static void test_gdal_to_raster() { +static void test_gdal_to_raster(void) { rt_pixtype pixtype = PT_64BF; rt_band band = NULL; @@ -497,7 +497,7 @@ static void test_gdal_to_raster() { cu_free_raster(raster); } -static void test_gdal_warp() { +static void test_gdal_warp(void) { rt_pixtype pixtype = PT_64BF; rt_band band = NULL; diff --git a/raster/test/cunit/cu_mapalgebra.c b/raster/test/cunit/cu_mapalgebra.c index 32e9e6e04..553cc7c36 100644 --- a/raster/test/cunit/cu_mapalgebra.c +++ b/raster/test/cunit/cu_mapalgebra.c @@ -492,7 +492,7 @@ static int testRasterIterator7_callback(rt_iterator_arg arg, void *userarg, doub return 1; } -static void test_raster_iterator() { +static void test_raster_iterator(void) { rt_raster rast1; rt_raster rast2; rt_raster rast3; @@ -793,7 +793,7 @@ static void test_raster_iterator() { if (rtn != NULL) cu_free_raster(rtn); } -static void test_band_reclass() { +static void test_band_reclass(void) { rt_reclassexpr *exprset; rt_raster raster; @@ -879,7 +879,7 @@ static void test_band_reclass() { rt_band_destroy(newband); } -static void test_raster_colormap() { +static void test_raster_colormap(void) { rt_raster raster; rt_raster rtn; rt_band band; diff --git a/raster/test/cunit/cu_misc.c b/raster/test/cunit/cu_misc.c index 24c618dbd..791d70136 100644 --- a/raster/test/cunit/cu_misc.c +++ b/raster/test/cunit/cu_misc.c @@ -24,7 +24,7 @@ #include "CUnit/Basic.h" #include "cu_tester.h" -static void test_rgb_to_hsv() { +static void test_rgb_to_hsv(void) { double rgb[3] = {0, 0, 0}; double hsv[3] = {0, 0, 0}; @@ -66,7 +66,7 @@ static void test_rgb_to_hsv() { CU_ASSERT_DOUBLE_EQUAL(hsv[2], 0.4, DBL_EPSILON); } -static void test_hsv_to_rgb() { +static void test_hsv_to_rgb(void) { double hsv[3] = {0, 0, 0}; double rgb[3] = {0, 0, 0}; @@ -108,7 +108,7 @@ static void test_hsv_to_rgb() { CU_ASSERT_DOUBLE_EQUAL(rgb[2], 0.4, DBL_EPSILON); } -static void test_util_gdal_open() { +static void test_util_gdal_open(void) { extern char *gdal_enabled_drivers; GDALDatasetH ds; diff --git a/raster/test/cunit/cu_pixtype.c b/raster/test/cunit/cu_pixtype.c index b69db7b37..6ef05cd64 100644 --- a/raster/test/cunit/cu_pixtype.c +++ b/raster/test/cunit/cu_pixtype.c @@ -25,7 +25,7 @@ #include "CUnit/Basic.h" #include "cu_tester.h" -static void test_pixtype_size() { +static void test_pixtype_size(void) { CU_ASSERT_EQUAL(rt_pixtype_size(PT_1BB), 1); CU_ASSERT_EQUAL(rt_pixtype_size(PT_2BUI), 1); CU_ASSERT_EQUAL(rt_pixtype_size(PT_4BUI), 1); @@ -42,11 +42,11 @@ static void test_pixtype_size() { CU_ASSERT_EQUAL(rt_pixtype_size(PT_END), -1); } -static void test_pixtype_alignment() { +static void test_pixtype_alignment(void) { /* rt_pixtype_alignment() just forwards to rt_pixtype_size() */ } -static void test_pixtype_name() { +static void test_pixtype_name(void) { CU_ASSERT_STRING_EQUAL(rt_pixtype_name(PT_1BB), "1BB"); CU_ASSERT_STRING_EQUAL(rt_pixtype_name(PT_2BUI), "2BUI"); CU_ASSERT_STRING_EQUAL(rt_pixtype_name(PT_4BUI), "4BUI"); @@ -63,7 +63,7 @@ static void test_pixtype_name() { CU_ASSERT_STRING_EQUAL(rt_pixtype_name(PT_END), "Unknown"); } -static void test_pixtype_index_from_name() { +static void test_pixtype_index_from_name(void) { CU_ASSERT_EQUAL(rt_pixtype_index_from_name("1BB"), PT_1BB); CU_ASSERT_EQUAL(rt_pixtype_index_from_name("2BUI"), PT_2BUI); CU_ASSERT_EQUAL(rt_pixtype_index_from_name("4BUI"), PT_4BUI); @@ -83,7 +83,7 @@ static void test_pixtype_index_from_name() { CU_ASSERT_EQUAL(rt_pixtype_index_from_name("3BUI"), PT_END); } -static void test_pixtype_get_min_value() { +static void test_pixtype_get_min_value(void) { CU_ASSERT_DOUBLE_EQUAL(rt_pixtype_get_min_value(PT_1BB), rt_util_clamp_to_1BB((double) CHAR_MIN), DBL_EPSILON); CU_ASSERT_DOUBLE_EQUAL(rt_pixtype_get_min_value(PT_2BUI), rt_util_clamp_to_2BUI((double) CHAR_MIN), DBL_EPSILON); CU_ASSERT_DOUBLE_EQUAL(rt_pixtype_get_min_value(PT_4BUI), rt_util_clamp_to_4BUI((double) CHAR_MIN), DBL_EPSILON); @@ -105,7 +105,7 @@ static void test_pixtype_get_min_value() { CU_ASSERT_DOUBLE_EQUAL(rt_pixtype_get_min_value(PT_END), rt_util_clamp_to_8BUI((double) CHAR_MIN), DBL_EPSILON); } -static void test_pixtype_compare_clamped_values() { +static void test_pixtype_compare_clamped_values(void) { int isequal = 0; /* 1BB */ diff --git a/raster/test/cunit/cu_raster_basics.c b/raster/test/cunit/cu_raster_basics.c index 98d640a1a..ad68cba9d 100644 --- a/raster/test/cunit/cu_raster_basics.c +++ b/raster/test/cunit/cu_raster_basics.c @@ -24,7 +24,7 @@ #include "CUnit/Basic.h" #include "cu_tester.h" -static void test_raster_new() { +static void test_raster_new(void) { rt_raster raster = NULL; raster = rt_raster_new(0, 0); @@ -40,7 +40,7 @@ static void test_raster_new() { cu_free_raster(raster); } -static void test_raster_empty() { +static void test_raster_empty(void) { rt_raster raster = NULL; /* check that raster is empty */ @@ -59,7 +59,7 @@ static void test_raster_empty() { cu_free_raster(raster); } -static void test_raster_metadata() { +static void test_raster_metadata(void) { rt_raster raster = NULL; /* create raster */ @@ -96,7 +96,7 @@ static void test_raster_metadata() { cu_free_raster(raster); } -static void test_raster_clone() { +static void test_raster_clone(void) { rt_raster rast1; rt_raster rast2; rt_band band; @@ -140,7 +140,7 @@ static void test_raster_clone() { cu_free_raster(rast1); } -static void test_raster_from_band() { +static void test_raster_from_band(void) { uint32_t bandNums[] = {1,3}; int lenBandNums = 2; rt_raster raster; @@ -169,7 +169,7 @@ static void test_raster_from_band() { cu_free_raster(raster); } -static void test_raster_replace_band() { +static void test_raster_replace_band(void) { rt_raster raster; rt_band band; rt_band rband; diff --git a/raster/test/cunit/cu_raster_geometry.c b/raster/test/cunit/cu_raster_geometry.c index 162e44789..97ebb40f4 100644 --- a/raster/test/cunit/cu_raster_geometry.c +++ b/raster/test/cunit/cu_raster_geometry.c @@ -24,7 +24,7 @@ #include "CUnit/Basic.h" #include "cu_tester.h" -static void test_raster_envelope() { +static void test_raster_envelope(void) { rt_raster raster = NULL; rt_envelope rtenv; @@ -85,7 +85,7 @@ static void test_raster_envelope() { cu_free_raster(raster); } -static void test_raster_envelope_geom() { +static void test_raster_envelope_geom(void) { rt_raster raster = NULL; LWGEOM *env = NULL; LWPOLY *poly = NULL; @@ -163,7 +163,7 @@ static void test_raster_envelope_geom() { cu_free_raster(raster); } -static void test_raster_convex_hull() { +static void test_raster_convex_hull(void) { rt_raster raster = NULL; LWGEOM *hull = NULL; LWPOLY *poly = NULL; @@ -252,7 +252,7 @@ lwgeom_to_text(const LWGEOM *lwgeom) { return wkt; } -static void test_raster_surface() { +static void test_raster_surface(void) { rt_raster rast; rt_band band; const int maxX = 5; @@ -374,7 +374,7 @@ static void test_raster_surface() { cu_free_raster(rast); } -static void test_raster_perimeter() { +static void test_raster_perimeter(void) { rt_raster rast; rt_band band; const int maxX = 5; @@ -528,7 +528,7 @@ static void test_raster_perimeter() { cu_free_raster(rast); } -static void test_raster_pixel_as_polygon() { +static void test_raster_pixel_as_polygon(void) { rt_raster rast; rt_band band; uint32_t x, y; @@ -576,7 +576,7 @@ static void test_raster_pixel_as_polygon() { -static void test_raster_get_pixel_bilinear() { +static void test_raster_get_pixel_bilinear(void) { uint32_t width = 2; uint32_t height = 2; double ul_x = 0.0; diff --git a/raster/test/cunit/cu_raster_misc.c b/raster/test/cunit/cu_raster_misc.c index b2ed95e17..90888a9aa 100644 --- a/raster/test/cunit/cu_raster_misc.c +++ b/raster/test/cunit/cu_raster_misc.c @@ -24,7 +24,7 @@ #include "CUnit/Basic.h" #include "cu_tester.h" -static void test_raster_cell_to_geopoint() { +static void test_raster_cell_to_geopoint(void) { rt_raster raster; int rtn; double xw, yw; @@ -43,7 +43,7 @@ static void test_raster_cell_to_geopoint() { cu_free_raster(raster); } -static void test_raster_geopoint_to_cell() { +static void test_raster_geopoint_to_cell(void) { rt_raster raster; int rtn; double xr, yr; @@ -62,7 +62,7 @@ static void test_raster_geopoint_to_cell() { cu_free_raster(raster); } -static void test_raster_from_two_rasters() { +static void test_raster_from_two_rasters(void) { rt_raster rast1; rt_raster rast2; rt_raster rast = NULL; @@ -175,7 +175,7 @@ static void test_raster_from_two_rasters() { cu_free_raster(rast1); } -static void test_raster_compute_skewed_raster() { +static void test_raster_compute_skewed_raster(void) { rt_envelope extent; rt_raster rast; double skew[2] = {0.25, 0.25}; diff --git a/raster/test/cunit/cu_raster_wkb.c b/raster/test/cunit/cu_raster_wkb.c index fd36aa6f9..e1e6219e1 100644 --- a/raster/test/cunit/cu_raster_wkb.c +++ b/raster/test/cunit/cu_raster_wkb.c @@ -25,7 +25,7 @@ #include "CUnit/Basic.h" #include "cu_tester.h" -static void test_raster_wkb() { +static void test_raster_wkb(void) { /* will use default allocators and message handlers */ rt_raster raster = NULL; const char *hexwkb = NULL; diff --git a/raster/test/cunit/cu_spatial_relationship.c b/raster/test/cunit/cu_spatial_relationship.c index f99e78b01..7438367e4 100644 --- a/raster/test/cunit/cu_spatial_relationship.c +++ b/raster/test/cunit/cu_spatial_relationship.c @@ -24,7 +24,7 @@ #include "CUnit/Basic.h" #include "cu_tester.h" -static void test_raster_geos_overlaps() { +static void test_raster_geos_overlaps(void) { rt_raster rast1; rt_raster rast2; rt_band band1; @@ -499,7 +499,7 @@ static void test_raster_geos_overlaps() { cu_free_raster(rast1); } -static void test_raster_geos_touches() { +static void test_raster_geos_touches(void) { rt_raster rast1; rt_raster rast2; rt_band band1; @@ -1026,7 +1026,7 @@ static void test_raster_geos_touches() { cu_free_raster(rast1); } -static void test_raster_geos_contains() { +static void test_raster_geos_contains(void) { rt_raster rast1; rt_raster rast2; rt_band band1; @@ -1553,7 +1553,7 @@ static void test_raster_geos_contains() { cu_free_raster(rast1); } -static void test_raster_geos_contains_properly() { +static void test_raster_geos_contains_properly(void) { rt_raster rast1; rt_raster rast2; rt_band band1; @@ -2080,7 +2080,7 @@ static void test_raster_geos_contains_properly() { cu_free_raster(rast1); } -static void test_raster_geos_covers() { +static void test_raster_geos_covers(void) { rt_raster rast1; rt_raster rast2; rt_band band1; @@ -2607,7 +2607,7 @@ static void test_raster_geos_covers() { cu_free_raster(rast1); } -static void test_raster_geos_covered_by() { +static void test_raster_geos_covered_by(void) { rt_raster rast1; rt_raster rast2; rt_band band1; @@ -3134,7 +3134,7 @@ static void test_raster_geos_covered_by() { cu_free_raster(rast1); } -static void test_raster_within_distance() { +static void test_raster_within_distance(void) { rt_raster rast1; rt_raster rast2; rt_band band1; @@ -3696,7 +3696,7 @@ static void test_raster_within_distance() { cu_free_raster(rast1); } -static void test_raster_fully_within_distance() { +static void test_raster_fully_within_distance(void) { rt_raster rast1; rt_raster rast2; rt_band band1; @@ -4258,7 +4258,7 @@ static void test_raster_fully_within_distance() { cu_free_raster(rast1); } -static void test_raster_intersects() { +static void test_raster_intersects(void) { rt_raster rast1; rt_raster rast2; rt_band band1; @@ -4725,7 +4725,7 @@ static void test_raster_intersects() { cu_free_raster(rast1); } -static void test_raster_same_alignment() { +static void test_raster_same_alignment(void) { rt_raster rast1; rt_raster rast2; int rtn; commit acf474815d0c0bcf442ee5784050dcae5da68aef Author: Paul Ramsey Date: Mon Mar 23 10:27:29 2026 -0700 Remove warning on fallthrough diff --git a/postgis/lwgeom_functions_basic.c b/postgis/lwgeom_functions_basic.c index 055375099..ec8b3ca18 100644 --- a/postgis/lwgeom_functions_basic.c +++ b/postgis/lwgeom_functions_basic.c @@ -2743,8 +2743,10 @@ Datum LWGEOM_angle(PG_FUNCTION_ARGS) { default: /*always executed*/ for (j = 0; j <= i; j++) + { PG_FREE_IF_COPY(seri_geoms[j], j); - FALLTHROUGH; + } + FALLTHROUGH; case 1: lwpgerror("Empty geometry"); ----------------------------------------------------------------------- Summary of changes: liblwgeom/cunit/cu_ptarray.c | 14 +++++------ .../cunit/cu_remove_irrelevant_points_for_view.c | 1 - liblwgeom/cunit/cu_tester.c | 12 +++++----- liblwgeom/lwboundingcircle.c | 4 ++-- liblwgeom/lwgeom_api.c | 6 ++--- loader/cunit/cu_tester.c | 2 +- postgis/lwgeom_functions_basic.c | 4 +++- raster/rt_pg/rtpg_pixel.c | 4 ++-- raster/rt_pg/rtpg_statistics.c | 2 +- raster/test/cunit/cu_band_basics.c | 28 +++++++++++----------- raster/test/cunit/cu_band_misc.c | 6 ++--- raster/test/cunit/cu_band_stats.c | 4 ++-- raster/test/cunit/cu_gdal.c | 14 +++++------ raster/test/cunit/cu_mapalgebra.c | 6 ++--- raster/test/cunit/cu_misc.c | 6 ++--- raster/test/cunit/cu_pixtype.c | 12 +++++----- raster/test/cunit/cu_raster_basics.c | 12 +++++----- raster/test/cunit/cu_raster_geometry.c | 14 +++++------ raster/test/cunit/cu_raster_misc.c | 8 +++---- raster/test/cunit/cu_raster_wkb.c | 2 +- raster/test/cunit/cu_spatial_relationship.c | 20 ++++++++-------- 21 files changed, 91 insertions(+), 90 deletions(-) hooks/post-receive -- PostGIS From trac at osgeo.org Mon Mar 23 11:12:43 2026 From: trac at osgeo.org (PostGIS) Date: Mon, 23 Mar 2026 18:12:43 -0000 Subject: [PostGIS] #6060: Fully quality calls to postgis functions in plpgsql In-Reply-To: <049.6b4e7fe4a1fc19f1fbe2f0abe6bf0708@osgeo.org> References: <049.6b4e7fe4a1fc19f1fbe2f0abe6bf0708@osgeo.org> Message-ID: <064.2369c71b8c8826904f3c71845a35f7ce@osgeo.org> #6060: Fully quality calls to postgis functions in plpgsql ----------------------+--------------------------- Reporter: pramsey | Owner: pramsey Type: defect | Status: closed Priority: medium | Milestone: PostGIS 3.6.2 Component: postgis | Version: 3.6.x Resolution: fixed | Keywords: ----------------------+--------------------------- Changes (by pramsey): * resolution: => fixed * status: assigned => closed -- Ticket URL: PostGIS The PostGIS Trac is used for bug, enhancement & task tracking, a user and developer wiki, and a view into the subversion code repository of PostGIS project. From git at osgeo.org Mon Mar 23 12:06:24 2026 From: git at osgeo.org (git at osgeo.org) Date: Mon, 23 Mar 2026 12:06:24 -0700 (PDT) Subject: [SCM] PostGIS branch master updated. 3.6.0rc2-409-g917961da3 Message-ID: <20260323190624.848A8272F5@trac.osgeo.org> 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 917961da372c463decf044c366bb0515c4481fe5 (commit) via c64beac5ac5f0243e9463f225285dd89ed1599ea (commit) from bebe97d1abb3c2208f29533d40fe78a08c0cf0b6 (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 917961da372c463decf044c366bb0515c4481fe5 Merge: c64beac5a bebe97d1a Author: Paul Ramsey Date: Mon Mar 23 11:09:08 2026 -0700 Merge branch 'master' into master-buildclean commit c64beac5ac5f0243e9463f225285dd89ed1599ea Author: Paul Ramsey Date: Mon Mar 23 11:09:04 2026 -0700 First cut at stripping AddToSearchPath from build, to reduce security surface area diff --git a/extensions/Makefile.in b/extensions/Makefile.in index 344418584..bb847bc91 100644 --- a/extensions/Makefile.in +++ b/extensions/Makefile.in @@ -47,8 +47,6 @@ distclean-local: clean-local check check-unit check-regress: @echo "Nothing to check" -postgis_extension_helper.sql: ../libpgcommon/sql/AddToSearchPath.sql.inc - # Generate any .sql file from .sql.in files by running them through the SQL pre-processor %.sql: %.sql.in $(SQLPP) -I at top_builddir@/postgis -I at top_srcdir@ $< > $@.tmp diff --git a/extensions/postgis_extension_helper.sql.in b/extensions/postgis_extension_helper.sql.in index 4855ea882..096563c77 100644 --- a/extensions/postgis_extension_helper.sql.in +++ b/extensions/postgis_extension_helper.sql.in @@ -36,5 +36,3 @@ END; $$ LANGUAGE 'plpgsql' VOLATILE; -CREATE FUNCTION postgis_extension_AddToSearchPath(a_schema_name text) -#include "libpgcommon/sql/AddToSearchPath.sql.inc" diff --git a/extensions/postgis_extension_helper_uninstall.sql b/extensions/postgis_extension_helper_uninstall.sql index c582d3511..4cff3c7d0 100644 --- a/extensions/postgis_extension_helper_uninstall.sql +++ b/extensions/postgis_extension_helper_uninstall.sql @@ -14,5 +14,3 @@ -- This drops extension helper functions -- and should be called at the end of the extension upgrade file DROP FUNCTION IF EXISTS postgis_extension_drop_if_exists(text, text); -DROP FUNCTION IF EXISTS postgis_extension_AddToSearchPath(varchar); -DROP FUNCTION IF EXISTS postgis_extension_AddToSearchPath(text); diff --git a/extensions/postgis_tiger_geocoder/Makefile.in b/extensions/postgis_tiger_geocoder/Makefile.in index e064d6f0b..2f8f02bc8 100644 --- a/extensions/postgis_tiger_geocoder/Makefile.in +++ b/extensions/postgis_tiger_geocoder/Makefile.in @@ -181,8 +181,7 @@ sql/tiger_geocoder.sql.in: sql_bits/norm_addy_create.sql.in \ ../../extras/tiger_geocoder/geocode/reverse_geocode.sql \ ../../extras/tiger_geocoder/geocode/census_tracts_functions.sql \ ../../extras/tiger_geocoder/topology/tiger_topology_loader.sql \ - ../postgis_extension_helper.sql \ - sql/add_search_path.sql | sql + ../postgis_extension_helper.sql | sql cat $^ > $@ echo "SELECT postgis_extension_drop_if_exists('${EXTENSION}', 'DROP SCHEMA tiger_data');" >> $@ cat @srcdir@/../postgis_extension_helper_uninstall.sql >> $@ @@ -191,9 +190,6 @@ sql/tiger_geocoder.sql: sql/tiger_geocoder.sql.in sed -e 's/BEGIN;//g' -e 's/COMMIT;//g' -e '/^CREATE SCHEMA/d;' $< > $@ $(PERL) -pe 's/BEGIN\;//g ; s/COMMIT\;//g' $< > $@ -sql/add_search_path.sql: sql_bits/add_search_path.sql.in | sql - cp $< $@ - #hardcode for now #TODO: generate via create_unpackaged.pl sql/$(EXTENSION)--unpackaged--$(EXTVERSION).sql: sql_bits/tiger_geocoder--unpackaged.sql.in | sql diff --git a/extensions/postgis_tiger_geocoder/sql_bits/add_search_path.sql.in b/extensions/postgis_tiger_geocoder/sql_bits/add_search_path.sql.in deleted file mode 100644 index e3d3d5833..000000000 --- a/extensions/postgis_tiger_geocoder/sql_bits/add_search_path.sql.in +++ /dev/null @@ -1,18 +0,0 @@ --- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --- ----- --- PostGIS - Spatial Types for PostgreSQL --- http://postgis.net --- --- Copyright (C) 2012 Regina Obe --- --- This is free software; you can redistribute and/or modify it under --- the terms of the GNU General Public Licence. See the COPYING file. --- --- Author: Regina Obe --- --- This adds the tiger schema to search path --- Functions in tiger are not schema qualified --- so this is needed for them to work - -SELECT postgis_extension_AddToSearchPath('tiger'); diff --git a/libpgcommon/sql/AddToSearchPath.sql.inc b/libpgcommon/sql/AddToSearchPath.sql.inc deleted file mode 100644 index ff313406c..000000000 --- a/libpgcommon/sql/AddToSearchPath.sql.inc +++ /dev/null @@ -1,70 +0,0 @@ -/* - - Common body for a function to add a schema to the search path - Use as follows: - - CREATE OR REPLACE FUNCTION someName(someARg text) - #include "libpgcommon/sql/AddToSearchPath.sql.inc" -*/ -RETURNS text -AS -$BODY$ -DECLARE - var_result text; - var_cur_search_path text; - a_schema_name text := $1; -BEGIN - WITH settings AS ( - SELECT unnest(setconfig) config - FROM pg_catalog.pg_db_role_setting - WHERE setdatabase = ( - SELECT oid - FROM pg_catalog.pg_database - WHERE datname = current_database() - ) and setrole = 0 - ) - SELECT regexp_replace(config, '^search_path=', '') - FROM settings WHERE config like 'search_path=%' - INTO var_cur_search_path; - - RAISE NOTICE 'cur_search_path from pg_db_role_setting is %', var_cur_search_path; - - -- only run this test if person creating the extension is a super user - IF var_cur_search_path IS NULL AND (SELECT rolsuper FROM pg_catalog.pg_roles where rolname = CURRENT_USER) THEN - SELECT setting - INTO var_cur_search_path - FROM pg_catalog.pg_file_settings - WHERE name = 'search_path' AND applied; - - RAISE NOTICE 'cur_search_path from pg_file_settings is %', var_cur_search_path; - END IF; - - IF var_cur_search_path IS NULL THEN - SELECT boot_val - INTO var_cur_search_path - FROM pg_catalog.pg_settings - WHERE name = 'search_path'; - - RAISE NOTICE 'cur_search_path from pg_settings is %', var_cur_search_path; - END IF; - - IF var_cur_search_path LIKE '%' || quote_ident(a_schema_name) || '%' THEN - var_result := a_schema_name || ' already in database search_path'; - ELSE - var_cur_search_path := var_cur_search_path || ', ' - || quote_ident(a_schema_name); - EXECUTE 'ALTER DATABASE ' || quote_ident(current_database()) - || ' SET search_path = ' || var_cur_search_path; - var_result := a_schema_name || ' has been added to end of database search_path '; - END IF; - - EXECUTE 'SET search_path = ' || var_cur_search_path; - - RETURN var_result; -END -$BODY$ --- explicitly move pg_temp after pg_catalog in search path -SET search_path = pg_catalog, pg_temp -LANGUAGE 'plpgsql' VOLATILE STRICT -; - diff --git a/topology/Makefile.in b/topology/Makefile.in index 24f155599..25cae0bfa 100644 --- a/topology/Makefile.in +++ b/topology/Makefile.in @@ -159,7 +159,6 @@ topology.sql: \ sql/topogeometry/topogeom_edit.sql.in \ sql/topogeometry/simplify.sql.in \ sql/predicates.sql.in \ - ../libpgcommon/sql/AddToSearchPath.sql.inc \ ../postgis/sqldefines.h \ ../postgis_revision.h diff --git a/topology/sql/manage/ManageHelper.sql.in b/topology/sql/manage/ManageHelper.sql.in index 4c912317b..bfae596b6 100644 --- a/topology/sql/manage/ManageHelper.sql.in +++ b/topology/sql/manage/ManageHelper.sql.in @@ -17,6 +17,67 @@ -- if it is not already in the database search path -- This is a helper function for upgrade/install -- We may want to move this function as a generic helper +-- CREATE OR REPLACE FUNCTION topology.AddToSearchPath(a_schema_name varchar) -#include "libpgcommon/sql/AddToSearchPath.sql.inc" ---} AddToSearchPath +RETURNS text +AS +$BODY$ +DECLARE + var_result text; + var_cur_search_path text; + a_schema_name text := $1; +BEGIN + WITH settings AS ( + SELECT unnest(setconfig) config + FROM pg_catalog.pg_db_role_setting + WHERE setdatabase = ( + SELECT oid + FROM pg_catalog.pg_database + WHERE datname = current_database() + ) and setrole = 0 + ) + SELECT regexp_replace(config, '^search_path=', '') + FROM settings WHERE config like 'search_path=%' + INTO var_cur_search_path; + + RAISE NOTICE 'cur_search_path from pg_db_role_setting is %', var_cur_search_path; + + -- only run this test if person creating the extension is a super user + IF var_cur_search_path IS NULL AND (SELECT rolsuper FROM pg_catalog.pg_roles where rolname = CURRENT_USER) THEN + SELECT setting + INTO var_cur_search_path + FROM pg_catalog.pg_file_settings + WHERE name = 'search_path' AND applied; + + RAISE NOTICE 'cur_search_path from pg_file_settings is %', var_cur_search_path; + END IF; + + IF var_cur_search_path IS NULL THEN + SELECT boot_val + INTO var_cur_search_path + FROM pg_catalog.pg_settings + WHERE name = 'search_path'; + + RAISE NOTICE 'cur_search_path from pg_settings is %', var_cur_search_path; + END IF; + + IF var_cur_search_path LIKE '%' || quote_ident(a_schema_name) || '%' THEN + var_result := a_schema_name || ' already in database search_path'; + ELSE + var_cur_search_path := var_cur_search_path || ', ' + || quote_ident(a_schema_name); + EXECUTE 'ALTER DATABASE ' || quote_ident(current_database()) + || ' SET search_path = ' || var_cur_search_path; + var_result := a_schema_name || ' has been added to end of database search_path '; + END IF; + + EXECUTE 'SET search_path = ' || var_cur_search_path; + + RETURN var_result; +END +$BODY$ +-- explicitly move pg_temp after pg_catalog in search path +SET search_path = pg_catalog, pg_temp +LANGUAGE 'plpgsql' VOLATILE STRICT +; + ----------------------------------------------------------------------- Summary of changes: extensions/Makefile.in | 2 - extensions/postgis_extension_helper.sql.in | 2 - extensions/postgis_extension_helper_uninstall.sql | 2 - extensions/postgis_tiger_geocoder/Makefile.in | 6 +- .../sql_bits/add_search_path.sql.in | 18 ------ libpgcommon/sql/AddToSearchPath.sql.inc | 70 ---------------------- topology/Makefile.in | 1 - topology/sql/manage/ManageHelper.sql.in | 65 +++++++++++++++++++- 8 files changed, 64 insertions(+), 102 deletions(-) delete mode 100644 extensions/postgis_tiger_geocoder/sql_bits/add_search_path.sql.in delete mode 100644 libpgcommon/sql/AddToSearchPath.sql.inc hooks/post-receive -- PostGIS From trac at osgeo.org Mon Mar 23 14:13:44 2026 From: trac at osgeo.org (PostGIS) Date: Mon, 23 Mar 2026 21:13:44 -0000 Subject: [PostGIS] #6054: Lock down search path during install In-Reply-To: <046.d130944804e39b7d3a159db8f685fa61@osgeo.org> References: <046.d130944804e39b7d3a159db8f685fa61@osgeo.org> Message-ID: <061.42df961341c1fa59d95c15ee73296ea7@osgeo.org> #6054: Lock down search path during install ----------------------+---------------------------- Reporter: robe | Owner: robe Type: defect | Status: closed Priority: medium | Milestone: PostGIS 3.2.10 Component: install | Version: 3.2.x Resolution: fixed | Keywords: ----------------------+---------------------------- Changes (by pramsey): * resolution: => fixed * status: assigned => closed -- Ticket URL: PostGIS The PostGIS Trac is used for bug, enhancement & task tracking, a user and developer wiki, and a view into the subversion code repository of PostGIS project. From trac at osgeo.org Mon Mar 23 14:14:26 2026 From: trac at osgeo.org (PostGIS) Date: Mon, 23 Mar 2026 21:14:26 -0000 Subject: [PostGIS] #6057: Remove postgis_extension_AddToSearchPath In-Reply-To: <049.9ab2c7a5b0db3ab355b4fd09c0bd8107@osgeo.org> References: <049.9ab2c7a5b0db3ab355b4fd09c0bd8107@osgeo.org> Message-ID: <064.2c7c51b41a0aab68f9d39fe081a52750@osgeo.org> #6057: Remove postgis_extension_AddToSearchPath -----------------------------+--------------------------- Reporter: pramsey | Owner: robe Type: defect | Status: closed Priority: blocker | Milestone: PostGIS 3.7.0 Component: tiger geocoder | Version: master Resolution: fixed | Keywords: -----------------------------+--------------------------- Changes (by pramsey): * resolution: => fixed * status: assigned => closed -- Ticket URL: PostGIS The PostGIS Trac is used for bug, enhancement & task tracking, a user and developer wiki, and a view into the subversion code repository of PostGIS project. From trac at osgeo.org Mon Mar 23 14:16:16 2026 From: trac at osgeo.org (PostGIS) Date: Mon, 23 Mar 2026 21:16:16 -0000 Subject: [PostGIS] #5352: ST_ClusterRelate(geom, de9impattern) In-Reply-To: <049.acd06712da02443e4ee6f8b180a08c84@osgeo.org> References: <049.acd06712da02443e4ee6f8b180a08c84@osgeo.org> Message-ID: <064.8def09908363cf479c0dfd65b87014bc@osgeo.org> #5352: ST_ClusterRelate(geom, de9impattern) --------------------------+--------------------------- Reporter: pramsey | Owner: pramsey Type: enhancement | Status: closed Priority: medium | Milestone: PostGIS 3.7.0 Component: postgis | Version: master Resolution: fixed | Keywords: --------------------------+--------------------------- Changes (by pramsey): * resolution: => fixed * status: assigned => closed Comment: Done at [5fac7d16ab444240d465a36d717b4f0b95c068dd] -- Ticket URL: PostGIS The PostGIS Trac is used for bug, enhancement & task tracking, a user and developer wiki, and a view into the subversion code repository of PostGIS project. From git at osgeo.org Mon Mar 23 22:27:23 2026 From: git at osgeo.org (git at osgeo.org) Date: Mon, 23 Mar 2026 22:27:23 -0700 (PDT) Subject: [SCM] PostGIS branch master updated. 3.6.0rc2-410-gae010eb31 Message-ID: <20260324052723.A69853023F@trac.osgeo.org> 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 ae010eb312279c94f279979d223278ced80e4d2f (commit) from 917961da372c463decf044c366bb0515c4481fe5 (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 ae010eb312279c94f279979d223278ced80e4d2f Author: Teramoto Ikuhiro Date: Tue Mar 24 05:09:02 2026 +0000 Translated PostGIS Manual using Weblate (Japanese) Currently translated at 99.9% (5889 of 5893 strings) Translation: postgis/PostGIS Manual Translate-URL: https://weblate.osgeo.org/projects/postgis/postgis-manual/ja/ diff --git a/doc/po/ja/postgis-manual.po b/doc/po/ja/postgis-manual.po index 9815baf0c..798c40238 100644 --- a/doc/po/ja/postgis-manual.po +++ b/doc/po/ja/postgis-manual.po @@ -10,7 +10,7 @@ msgstr "" "Project-Id-Version: postgis 3.5\n" "Report-Msgid-Bugs-To: https://bugs.kde.org\n" "POT-Creation-Date: 2025-11-13 16:23+0000\n" -"PO-Revision-Date: 2026-03-17 01:16+0000\n" +"PO-Revision-Date: 2026-03-24 05:27+0000\n" "Last-Translator: Teramoto Ikuhiro \n" "Language-Team: Japanese \n" @@ -46091,14 +46091,14 @@ msgstr "" "???" #. Tag: para -#, fuzzy, no-c-format +#, no-c-format msgid "" "MULTIPOINTs are simple if no two " "coordinates (POINTs) are equal (have identical coordinate " "values)." msgstr "" -"MULTIPOINT??????????? (POINT)?????????????" +"MULTIPOINT?????????????" +"????? (POINT)???????????" #. Tag: para #, no-c-format ----------------------------------------------------------------------- Summary of changes: doc/po/ja/postgis-manual.po | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) hooks/post-receive -- PostGIS From trac at osgeo.org Tue Mar 24 09:39:11 2026 From: trac at osgeo.org (PostGIS) Date: Tue, 24 Mar 2026 16:39:11 -0000 Subject: [PostGIS] #6003: unknown conversion warning in lwgeom under mingw64/msys2 gcc 13.2 In-Reply-To: <046.af1e8163b07c9a3c6d2c1916c460f2e6@osgeo.org> References: <046.af1e8163b07c9a3c6d2c1916c460f2e6@osgeo.org> Message-ID: <061.1f84650bd1d75921f008ec2aa50f5b6f@osgeo.org> #6003: unknown conversion warning in lwgeom under mingw64/msys2 gcc 13.2 ----------------------+--------------------------- Reporter: robe | Owner: robe Type: defect | Status: new Priority: low | Milestone: PostGIS 3.7.0 Component: postgis | Version: 3.5.x Resolution: | Keywords: windows ----------------------+--------------------------- Changes (by pramsey): * owner: pramsey => robe -- Ticket URL: PostGIS The PostGIS Trac is used for bug, enhancement & task tracking, a user and developer wiki, and a view into the subversion code repository of PostGIS project. From trac at osgeo.org Tue Mar 24 22:46:24 2026 From: trac at osgeo.org (PostGIS) Date: Wed, 25 Mar 2026 05:46:24 -0000 Subject: [PostGIS] #6053: Spin off address_standardizer as separate project In-Reply-To: <049.f4d1eb5ea5ce334e1b08e74f1d6e7c99@osgeo.org> References: <049.f4d1eb5ea5ce334e1b08e74f1d6e7c99@osgeo.org> Message-ID: <064.34f1e299d353f3c42277862d35a0d98a@osgeo.org> #6053: Spin off address_standardizer as separate project ----------------------+--------------------------- Reporter: pramsey | Owner: pramsey Type: defect | Status: closed Priority: medium | Milestone: PostGIS 3.7.0 Component: postgis | Version: master Resolution: fixed | Keywords: ----------------------+--------------------------- Comment (by Regina Obe ): In [changeset:"a2db07f39d7d0450605e0425c8863c62395d36ed/git" a2db07f3/git]: {{{#!CommitTicketReference repository="git" revision="a2db07f39d7d0450605e0425c8863c62395d36ed" Remove postgis_tiger_geocoder Add missing note about removal of address_standardizer References #6053 Closes #6052 }}} -- Ticket URL: PostGIS The PostGIS Trac is used for bug, enhancement & task tracking, a user and developer wiki, and a view into the subversion code repository of PostGIS project. From trac at osgeo.org Tue Mar 24 22:46:24 2026 From: trac at osgeo.org (PostGIS) Date: Wed, 25 Mar 2026 05:46:24 -0000 Subject: [PostGIS] #6052: Spin off postgis_tiger_geocoder as separate project In-Reply-To: <046.664a93489c0a4b9da43591e3964cc468@osgeo.org> References: <046.664a93489c0a4b9da43591e3964cc468@osgeo.org> Message-ID: <061.6bf97f5b79c41aae06caded7fa9aaed8@osgeo.org> #6052: Spin off postgis_tiger_geocoder as separate project -----------------------------+--------------------------- Reporter: robe | Owner: robe Type: defect | Status: closed Priority: medium | Milestone: PostGIS 3.7.0 Component: tiger geocoder | Version: master Resolution: fixed | Keywords: -----------------------------+--------------------------- Changes (by Regina Obe ): * resolution: => fixed * status: assigned => closed Comment: In [changeset:"a2db07f39d7d0450605e0425c8863c62395d36ed/git" a2db07f3/git]: {{{#!CommitTicketReference repository="git" revision="a2db07f39d7d0450605e0425c8863c62395d36ed" Remove postgis_tiger_geocoder Add missing note about removal of address_standardizer References #6053 Closes #6052 }}} -- Ticket URL: PostGIS The PostGIS Trac is used for bug, enhancement & task tracking, a user and developer wiki, and a view into the subversion code repository of PostGIS project. From git at osgeo.org Tue Mar 24 23:17:16 2026 From: git at osgeo.org (git at osgeo.org) Date: Tue, 24 Mar 2026 23:17:16 -0700 (PDT) Subject: [SCM] PostGIS branch master updated. 3.6.0rc2-412-g651cc141f Message-ID: <20260325061716.82CEE354F0@trac.osgeo.org> 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 651cc141f9af17106fc31ed8add5617df40cc1d4 (commit) from a2db07f39d7d0450605e0425c8863c62395d36ed (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 651cc141f9af17106fc31ed8add5617df40cc1d4 Author: Regina Obe Date: Wed Mar 25 02:16:56 2026 -0400 Update pot to remove address_standardizer and postgis_tiger_geocoder diff --git a/doc/po/templates/postgis-manual.pot b/doc/po/templates/postgis-manual.pot index 5fd065446..2cd6f8083 100644 --- a/doc/po/templates/postgis-manual.pot +++ b/doc/po/templates/postgis-manual.pot @@ -701,950 +701,6 @@ msgid "" "scripts that can be run as is." msgstr "" -#. Tag: chapter -#, no-c-format -msgid "&extras_address_standardizer; &extras_tigergeocoder;" -msgstr "" - -#. Tag: title -#, no-c-format -msgid "Address Standardizer" -msgstr "" - -#. Tag: para -#, no-c-format -msgid "" -"This is a fork of the PAGC standardizer (original code for this portion was " -"PAGC PostgreSQL Address Standardizer)." -msgstr "" - -#. Tag: para -#, no-c-format -msgid "" -"The address standardizer is a single line address parser that takes an input " -"address and normalizes it based on a set of rules stored in a table and " -"helper lex and gaz tables." -msgstr "" - -#. Tag: para -#, no-c-format -msgid "" -"The code is built into a single PostgreSQL extension library called " -"address_standardizer which can be installed with CREATE " -"EXTENSION address_standardizer;. In addition to the " -"address_standardizer extension, a sample data extension called " -"address_standardizer_data_us extensions is built, which " -"contains gaz, lex, and rules tables for US data. This extensions can be " -"installed via: CREATE EXTENSION address_standardizer_data_us;" -msgstr "" - -#. Tag: para -#, no-c-format -msgid "" -"The code for this extension can be found in the PostGIS extensions/" -"address_standardizer and is currently self-contained." -msgstr "" - -#. Tag: para -#, no-c-format -msgid "" -"For installation instructions refer to: ." -msgstr "" - -#. Tag: title -#, no-c-format -msgid "How the Parser Works" -msgstr "" - -#. Tag: para -#, no-c-format -msgid "" -"The parser works from right to left looking first at the macro elements for " -"postcode, state/province, city, and then looks micro elements to determine " -"if we are dealing with a house number street or intersection or landmark. It " -"currently does not look for a country code or name, but that could be " -"introduced in the future." -msgstr "" - -#. Tag: term -#, no-c-format -msgid "Country code" -msgstr "" - -#. Tag: para -#, no-c-format -msgid "" -"Assumed to be US or CA based on: postcode as US or Canada state/province as " -"US or Canada else US" -msgstr "" - -#. Tag: term -#, no-c-format -msgid "Postcode/zipcode" -msgstr "" - -#. Tag: para -#, no-c-format -msgid "" -"These are recognized using Perl compatible regular expressions. These regexs " -"are currently in the parseaddress-api.c and are relatively simple to make " -"changes to if needed." -msgstr "" - -#. Tag: term -#, no-c-format -msgid "State/province" -msgstr "" - -#. Tag: para -#, no-c-format -msgid "" -"These are recognized using Perl compatible regular expressions. These regexs " -"are currently in the parseaddress-api.c but could get moved into includes in " -"the future for easier maintenance." -msgstr "" - -#. Tag: title -#, no-c-format -msgid "Address Standardizer Types" -msgstr "" - -#. Tag: para -#, no-c-format -msgid "" -"This section lists the PostgreSQL data types installed by Address " -"Standardizer extension. Note we describe the casting behavior of these which " -"is very important especially when designing your own functions." -msgstr "" - -#. Tag: refpurpose -#, no-c-format -msgid "" -"A composite type that consists of the elements of an address. This is the " -"return type for standardize_address function." -msgstr "" - -#. Tag: title -#, no-c-format -msgid "Description" -msgstr "" - -#. Tag: para -#, no-c-format -msgid "" -"A composite type that consists of elements of an address. This is the return " -"type for function. Some descriptions " -"for elements are borrowed from PAGC Postal Attributes." -msgstr "" - -#. Tag: para -#, no-c-format -msgid "" -"The token numbers denote the output reference number in the ." -msgstr "" - -#. Tag: para -#, no-c-format -msgid "&address_standardizer_required;" -msgstr "" - -#. Tag: para -#, no-c-format -msgid "" -"is text (token number 0): Refers to building number or name. " -"Unparsed building identifiers and types. Generally blank for most addresses." -msgstr "" - -#. Tag: para -#, no-c-format -msgid "" -"is a text (token number 1): This is the street number on a " -"street. Example 75 in 75 State Street." -msgstr "" - -#. Tag: para -#, no-c-format -msgid "" -"is text (token number 2): STREET NAME PRE-DIRECTIONAL such as " -"North, South, East, West etc." -msgstr "" - -#. Tag: para -#, no-c-format -msgid "" -"is text (token number 3): STREET NAME PRE-MODIFIER Example " -"OLD in 3715 OLD HIGHWAY 99." -msgstr "" - -#. Tag: para -#, no-c-format -msgid "is text (token number 4): STREET PREFIX TYPE" -msgstr "" - -#. Tag: para -#, no-c-format -msgid "is text (token number 5): STREET NAME" -msgstr "" - -#. Tag: para -#, no-c-format -msgid "" -"is text (token number 6): STREET POST TYPE e.g. St, Ave, Cir. A " -"street type following the root street name. Example STREET in 75 State Street." -msgstr "" - -#. Tag: para -#, no-c-format -msgid "" -"is text (token number 7): STREET POST-DIRECTIONAL A directional " -"modifier that follows the street name.. Example WEST in " -"3715 TENTH AVENUE WEST." -msgstr "" - -#. Tag: para -#, no-c-format -msgid "" -"is text (token number 8): RURAL ROUTE . Example 7 in RR 7." -msgstr "" - -#. Tag: para -#, no-c-format -msgid "is text: Extra information like Floor number." -msgstr "" - -#. Tag: para -#, no-c-format -msgid "is text (token number 10): Example Boston." -msgstr "" - -#. Tag: para -#, no-c-format -msgid "" -"is text (token number 11): Example MASSACHUSETTS" -msgstr "" - -#. Tag: para -#, no-c-format -msgid "is text (token number 12): Example USA" -msgstr "" - -#. Tag: para -#, no-c-format -msgid "" -"is text POSTAL CODE (ZIP CODE) (token number 13): Example " -"02109" -msgstr "" - -#. Tag: para -#, no-c-format -msgid "" -"is text POSTAL BOX NUMBER (token number 14 and 15): Example " -"02109" -msgstr "" - -#. Tag: para -#, no-c-format -msgid "" -"is text Apartment number or Suite Number (token number 17): " -"Example 3B in APT 3B." -msgstr "" - -#. Tag: title -#, no-c-format -msgid "Address Standardizer Tables" -msgstr "" - -#. Tag: para -#, no-c-format -msgid "" -"This section lists the PostgreSQL table formats used by the " -"address_standardizer for normalizing addresses. Note that these tables do " -"not need to be named the same as what is referenced here. You can have " -"different lex, gaz, rules tables for each country for example or for your " -"custom geocoder. The names of these tables get passed into the address " -"standardizer functions." -msgstr "" - -#. Tag: para -#, no-c-format -msgid "" -"The packaged extension address_standardizer_data_us " -"contains data for standardizing US addresses." -msgstr "" - -#. Tag: refpurpose -#, no-c-format -msgid "" -"The rules table contains a set of rules that maps address input sequence " -"tokens to standardized output sequence. A rule is defined as a set of input " -"tokens followed by -1 (terminator) followed by set of output tokens followed " -"by -1 followed by number denoting kind of rule followed by ranking of rule." -msgstr "" - -#. Tag: para -#, no-c-format -msgid "" -"A rules table must have at least the following columns, though you are " -"allowed to add more for your own uses." -msgstr "" - -#. Tag: para -#, no-c-format -msgid "Primary key of table" -msgstr "" - -#. Tag: para -#, no-c-format -msgid "" -"text field denoting the rule. Details at PAGC Address Standardizer " -"Rule records." -msgstr "" - -#. Tag: para -#, no-c-format -msgid "" -"A rule consists of a set of non-negative integers representing input tokens, " -"terminated by a -1, followed by an equal number of non-negative integers " -"representing postal attributes, terminated by a -1, followed by an integer " -"representing a rule type, followed by an integer representing the rank of " -"the rule. The rules are ranked from 0 (lowest) to 17 (highest)." -msgstr "" - -#. Tag: para -#, no-c-format -msgid "" -"So for example the rule 2 0 2 22 3 -1 5 5 6 7 3 -1 2 6 maps to " -"sequence of output tokens TYPE NUMBER TYPE DIRECT QUALIF to the output sequence STREET STREET SUFTYP SUFDIR " -"QUALIF. The rule is an ARC_C rule of rank 6." -msgstr "" - -#. Tag: para -#, no-c-format -msgid "" -"Numbers for corresponding output tokens are listed in ." -msgstr "" - -#. Tag: title -#, no-c-format -msgid "Input Tokens" -msgstr "" - -#. Tag: para -#, no-c-format -msgid "" -"Each rule starts with a set of input tokens followed by a terminator " -"-1. Valid input tokens excerpted from PAGC Input Tokens are " -"as follows:" -msgstr "" - -#. Tag: emphasis -#, no-c-format -msgid "Form-Based Input Tokens" -msgstr "" - -#. Tag: para -#, no-c-format -msgid "" -"(13). The ampersand (&) is frequently used to abbreviate the word " -"\"and\"." -msgstr "" - -#. Tag: para -#, no-c-format -msgid "(9). A punctuation character." -msgstr "" - -#. Tag: para -#, no-c-format -msgid "(21). A sequence of two letters. Often used as identifiers." -msgstr "" - -#. Tag: para -#, no-c-format -msgid "(25). Fractions are sometimes used in civic numbers or unit numbers." -msgstr "" - -#. Tag: para -#, no-c-format -msgid "" -"(23). An alphanumeric string that contains both letters and digits. Used for " -"identifiers." -msgstr "" - -#. Tag: para -#, no-c-format -msgid "(0). A string of digits." -msgstr "" - -#. Tag: para -#, no-c-format -msgid "(15). Representations such as First or 1st. Often used in street names." -msgstr "" - -#. Tag: para -#, no-c-format -msgid "(18). A single letter." -msgstr "" - -#. Tag: para -#, no-c-format -msgid "" -"(1). A word is a string of letters of arbitrary length. A single letter can " -"be both a SINGLE and a WORD." -msgstr "" - -#. Tag: emphasis -#, no-c-format -msgid "Function-based Input Tokens" -msgstr "" - -#. Tag: para -#, no-c-format -msgid "" -"(14). Words used to denote post office boxes. For example Box or PO Box." -msgstr "" - -#. Tag: para -#, no-c-format -msgid "" -"(19). Words used to denote buildings or building complexes, usually as a " -"prefix. For example: Tower in Tower 7A." -msgstr "" - -#. Tag: para -#, no-c-format -msgid "" -"(24). Words and abbreviations used to denote buildings or building " -"complexes, usually as a suffix. For example: Shopping Centre." -msgstr "" - -#. Tag: para -#, no-c-format -msgid "" -"(22). Words used to denote directions, for example North." -msgstr "" - -#. Tag: para -#, no-c-format -msgid "(20). Words used to denote milepost addresses." -msgstr "" - -#. Tag: para -#, no-c-format -msgid "" -"(6). Words and abbreviations used to denote highways and roads. For example: " -"the Interstate in Interstate 5" -msgstr "" - -#. Tag: para -#, no-c-format -msgid "" -"(8). Words and abbreviations used to denote rural routes. RR." -msgstr "" - -#. Tag: para -#, no-c-format -msgid "" -"(2). Words and abbreviations used to denote street types. For example: " -"ST or AVE." -msgstr "" - -#. Tag: para -#, no-c-format -msgid "" -"(16). Words and abbreviations used to denote internal subaddresses. For " -"example, APT or UNIT." -msgstr "" - -#. Tag: emphasis -#, no-c-format -msgid "Postal Type Input Tokens" -msgstr "" - -#. Tag: para -#, no-c-format -msgid "(28). A 5 digit number. Identifies a ZIP code" -msgstr "" - -#. Tag: para -#, no-c-format -msgid "(29). A 4 digit number. Identifies ZIP4." -msgstr "" - -#. Tag: para -#, no-c-format -msgid "" -"(27). A 3 character sequence of letter number letter. Identifies an FSA, the " -"first 3 characters of a Canadian postal code." -msgstr "" - -#. Tag: para -#, no-c-format -msgid "" -"(26). A 3 character sequence of number letter number. Identifies an LDU, the " -"last 3 characters of a Canadian postal code." -msgstr "" - -#. Tag: emphasis -#, no-c-format -msgid "Stopwords" -msgstr "" - -#. Tag: para -#, no-c-format -msgid "" -"STOPWORDS combine with WORDS. In rules a string of multiple WORDs and " -"STOPWORDs will be represented by a single WORD token." -msgstr "" - -#. Tag: para -#, no-c-format -msgid "" -"(7). A word with low lexical significance, that can be omitted in parsing. " -"For example: THE." -msgstr "" - -#. Tag: title -#, no-c-format -msgid "Output Tokens" -msgstr "" - -#. Tag: para -#, no-c-format -msgid "" -"After the first -1 (terminator), follows the output tokens and their order, " -"followed by a terminator -1. Numbers for corresponding output " -"tokens are listed in . What are allowed is " -"dependent on kind of rule. Output tokens valid for each rule type are listed " -"in ." -msgstr "" - -#. Tag: title -#, no-c-format -msgid "Rule Types and Rank" -msgstr "" - -#. Tag: para -#, no-c-format -msgid "" -"The final part of the rule is the rule type which is denoted by one of the " -"following, followed by a rule rank. The rules are ranked from 0 (lowest) to " -"17 (highest)." -msgstr "" - -#. Tag: para -#, no-c-format -msgid "" -"(token number = \"0\"). The class of " -"rules for parsing MACRO clauses such as PLACE STATE ZIP" -msgstr "" - -#. Tag: para -#, no-c-format -msgid "" -"MACRO_C output tokens " -"(excerpted from http://www.pagcgeo.org/docs/html/pagc-12.html#--r-typ--." -msgstr "" - -#. Tag: para -#, no-c-format -msgid "(token number \"10\"). Example \"Albany\"" -msgstr "" - -#. Tag: para -#, no-c-format -msgid "(token number \"11\"). Example \"NY\"" -msgstr "" - -#. Tag: para -#, no-c-format -msgid "" -"(token number \"12\"). This attribute is not used in most reference files. " -"Example \"USA\"" -msgstr "" - -#. Tag: para -#, no-c-format -msgid "" -"(token number \"13\"). (SADS elements \"ZIP CODE\" , \"PLUS 4\" ). This " -"attribute is used for both the US ZIP and the Canadian postal codes." -msgstr "" - -#. Tag: para -#, no-c-format -msgid "" -"(token number = \"1\"). The class of " -"rules for parsing full MICRO clauses (such as House, street, sufdir, predir, " -"pretyp, suftype, qualif) (ie ARC_C plus CIVIC_C). These rules are not used " -"in the build phase." -msgstr "" - -#. Tag: para -#, no-c-format -msgid "" -"MICRO_C output tokens " -"(excerpted from http://www.pagcgeo.org/docs/html/pagc-12.html#--r-typ--." -msgstr "" - -#. Tag: para -#, no-c-format -msgid "" -"(token number = \"2\"). The class of " -"rules for parsing MICRO clauses, excluding the HOUSE attribute. As such uses " -"same set of output tokens as MICRO_C minus the HOUSE token." -msgstr "" - -#. Tag: para -#, no-c-format -msgid "" -"(token number = \"3\"). The class of " -"rules for parsing the HOUSE attribute." -msgstr "" - -#. Tag: para -#, no-c-format -msgid "" -"(token number = \"4\"). The class of " -"rules for parsing EXTRA attributes - attributes excluded from geocoding. " -"These rules are not used in the build phase." -msgstr "" - -#. Tag: para -#, no-c-format -msgid "" -"EXTRA_C output tokens " -"(excerpted from http://www.pagcgeo.org/docs/html/pagc-12.html#--r-typ--." -msgstr "" - -#. Tag: para -#, no-c-format -msgid "(token number 0): Unparsed building identifiers and types." -msgstr "" - -#. Tag: para -#, no-c-format -msgid "" -"(token number 14): The BOX " -"in BOX 3B" -msgstr "" - -#. Tag: para -#, no-c-format -msgid "" -"(token number 15): The 3B in " -"BOX 3B" -msgstr "" - -#. Tag: para -#, no-c-format -msgid "" -"(token number 8): The RR in " -"RR 7" -msgstr "" - -#. Tag: para -#, no-c-format -msgid "" -"(token number 16): The APT " -"in APT 3B" -msgstr "" - -#. Tag: para -#, no-c-format -msgid "" -"(token number 17): The 3B in " -"APT 3B" -msgstr "" - -#. Tag: para -#, no-c-format -msgid "(token number 9): An otherwise unclassified output." -msgstr "" - -#. Tag: refpurpose -#, no-c-format -msgid "" -"A lex table is used to classify alphanumeric input and associate that input " -"with (a) input tokens ( See ) and (b) " -"standardized representations." -msgstr "" - -#. Tag: para -#, no-c-format -msgid "" -"A lex (short for lexicon) table is used to classify alphanumeric input and " -"associate that input with and (b) " -"standardized representations. Things you will find in these tables are " -"ONE mapped to stdword: 1." -msgstr "" - -#. Tag: para -#, no-c-format -msgid "A lex has at least the following columns in the table. You may add" -msgstr "" - -#. Tag: para -#, no-c-format -msgid "integer: definition number?" -msgstr "" - -#. Tag: para -#, no-c-format -msgid "text: the input word" -msgstr "" - -#. Tag: para -#, no-c-format -msgid "text: the standardized replacement word" -msgstr "" - -#. Tag: para -#, no-c-format -msgid "" -"integer: the kind of word it is. Only if it is used in this context will it " -"be replaced. Refer to PAGC Tokens." -msgstr "" - -#. Tag: refpurpose -#, no-c-format -msgid "" -"A gaz table is used to standardize place names and associate that input with " -"(a) input tokens ( See ) and (b) " -"standardized representations." -msgstr "" - -#. Tag: para -#, no-c-format -msgid "" -"A gaz (short for gazeteer) table is used to standardize place names and " -"associate that input with and (b) " -"standardized representations. For example if you are in US, you may load " -"these with State Names and associated abbreviations." -msgstr "" - -#. Tag: para -#, no-c-format -msgid "" -"A gaz table has at least the following columns in the table. You may add " -"more columns if you wish for your own purposes." -msgstr "" - -#. Tag: para -#, no-c-format -msgid "" -"integer: definition number? - identifier used for that instance of the word" -msgstr "" - -#. Tag: title -#, no-c-format -msgid "Address Standardizer Functions" -msgstr "" - -#. Tag: refpurpose -#, no-c-format -msgid "" -"Returns a json formatted text listing the parse tokens and standardizations" -msgstr "" - -#. Tag: para -#, no-c-format -msgid "" -"This is a function for debugging address standardizer rules and lex/gaz " -"mappings. It returns a json formatted text that includes the matching rules, " -"mapping of tokens, and best standardized address " -"form of an input address utilizing table name, " -", and table names and " -"an address." -msgstr "" - -#. Tag: para -#, no-c-format -msgid "For single line addresses use just micro" -msgstr "" - -#. Tag: para -#, no-c-format -msgid "" -"For two line address A micro consisting of standard first " -"line of postal address e.g. house_num street, and a macro " -"consisting of standard postal second line of an address e.g city, " -"state postal_code country." -msgstr "" - -#. Tag: para -#, no-c-format -msgid "Elements returned in the json document are" -msgstr "" - -#. Tag: para -#, no-c-format -msgid "" -"For each word in the input address, returns the position of the word, token " -"categorization of the word, and the standard word it is mapped to. Note that " -"for some input words, you might get back multiple records because some " -"inputs can be categorized as more than one thing." -msgstr "" - -#. Tag: para -#, no-c-format -msgid "" -"The set of rules matching the input and the corresponding score for each. " -"The first rule (highest scoring) is what is used for standardization" -msgstr "" - -#. Tag: para -#, no-c-format -msgid "" -"The standardized address elements that would be " -"returned when running " -msgstr "" - -#. Tag: para -#, no-c-format -msgid "Availability: 3.4.0" -msgstr "" - -#. Tag: title -#, no-c-format -msgid "Examples" -msgstr "" - -#. Tag: para -#, no-c-format -msgid "Using address_standardizer_data_us extension" -msgstr "" - -#. Tag: para -#, no-c-format -msgid "Variant 1: Single line address and returning the input tokens" -msgstr "" - -#. Tag: para -#, no-c-format -msgid "" -"Variant 2: Multi line address and returning first rule input mappings and " -"score" -msgstr "" - -#. Tag: title -#, no-c-format -msgid "See Also" -msgstr "" - -#. Tag: para -#, no-c-format -msgid "" -", , , , " -msgstr "" - -#. Tag: refpurpose -#, no-c-format -msgid "Takes a 1 line address and breaks into parts" -msgstr "" - -#. Tag: para -#, no-c-format -msgid "" -"Returns takes an address as input, and returns a record output consisting of " -"fields num, street, " -"street2, address1, city, state, zip, " -"zipplus, country." -msgstr "" - -#. Tag: para -#, no-c-format -msgid "Availability: 2.2.0" -msgstr "" - -#. Tag: para -#, no-c-format -msgid "Single Address" -msgstr "" - -#. Tag: para -#, no-c-format -msgid "Table of addresses" -msgstr "" - -#. Tag: refpurpose -#, no-c-format -msgid "" -"Returns an stdaddr form of an input address utilizing lex, gaz, and rule " -"tables." -msgstr "" - -#. Tag: para -#, no-c-format -msgid "" -"Returns an form of an input address utilizing " -" table name, , and table names and an address." -msgstr "" - -#. Tag: para -#, no-c-format -msgid "Variant 1: Takes an address as a single line." -msgstr "" - -#. Tag: para -#, no-c-format -msgid "" -"Variant 2: Takes an address as 2 parts. A micro " -"consisting of standard first line of postal address e.g. house_num " -"street, and a macro consisting of standard postal second line of an " -"address e.g city, state postal_code country." -msgstr "" - -#. Tag: para -#, no-c-format -msgid "" -"Variant 1: Single line address. This doesn't work well with non-US addresses" -msgstr "" - -#. Tag: para -#, no-c-format -msgid "" -"Using tables packaged with tiger geocoder. This example only works if you " -"installed postgis_tiger_geocoder." -msgstr "" - -#. Tag: para -#, no-c-format -msgid "" -"Make easier to read we'll dump output using hstore extension CREATE " -"EXTENSION hstore; you need to install" -msgstr "" - -#. Tag: para -#, no-c-format -msgid "Variant 2: As a two part Address" -msgstr "" - #. Tag: title #, no-c-format msgid "History Tracking" @@ -1728,6 +784,11 @@ msgid "" "tables." msgstr "" +#. Tag: title +#, no-c-format +msgid "Description" +msgstr "" + #. Tag: para #, no-c-format msgid "" @@ -1740,6 +801,16 @@ msgstr "" msgid "Availability: 1.5.0" msgstr "" +#. Tag: title +#, no-c-format +msgid "Examples" +msgstr "" + +#. Tag: title +#, no-c-format +msgid "See Also" +msgstr "" + #. Tag: refpurpose #, no-c-format msgid "" @@ -1766,1227 +837,6 @@ msgid "" "present in geometry_columns table." msgstr "" -#. Tag: title -#, no-c-format -msgid "Tiger Geocoder" -msgstr "" - -#. Tag: para -#, no-c-format -msgid "" -"A plpgsql based geocoder written to work with the TIGER (Topologically Integrated Geographic " -"Encoding and Referencing system ) / Line and Master Address database export released by the US Census Bureau." -msgstr "" - -#. Tag: para -#, no-c-format -msgid "" -"There are four components to the geocoder: the data loader functions, the " -"address normalizer, the address geocoder, and the reverse geocoder." -msgstr "" - -#. Tag: para -#, no-c-format -msgid "" -"Although it is designed specifically for the US, a lot of the concepts and " -"functions are applicable and can be adapted to work with other country " -"address and road networks." -msgstr "" - -#. Tag: para -#, no-c-format -msgid "" -"The script builds a schema called tiger to house all the " -"TIGER-related functions, reusable lookup data such as road type prefixes, " -"suffixes, states, various control tables for managing data load, and " -"skeleton base tables from which all the TIGER-loaded tables inherit." -msgstr "" - -#. Tag: para -#, no-c-format -msgid "" -"Another schema called tiger_data is also created which " -"houses all the census data for each state that the loader downloads from the " -"Census site and loads into the database. In the current model, each set of " -"state tables is prefixed with the state code e.g ma_addr, " -"ma_edges etc with constraints to enforce only that state " -"data. Each of these tables inherits from the tables addr, " -"faces, edges, etc located in the " -"tiger schema." -msgstr "" - -#. Tag: para -#, no-c-format -msgid "" -"All the geocode functions only reference the base tables, so there is no " -"requirement that the data schema be called tiger_data or " -"that data can't be further partitioned into other schemas -- e.g. a " -"different schema for each state, as long as all the tables inherit from the " -"tables in the tiger schema." -msgstr "" - -#. Tag: para -#, no-c-format -msgid "" -"For instructions on how to enable the extension in your database and also to " -"load data using it, refer to ." -msgstr "" - -#. Tag: para -#, no-c-format -msgid "" -"If you are using the TIGER Geocoder (tiger_2010), you can upgrade the " -"scripts using the accompanying upgrade_geocoder.bat / .sh scripts in extras/" -"tiger. One major change between tiger_2010 and " -"tiger_2011+ is that the county and " -"state tables are no longer broken out by state. If you " -"have data from tiger_2010 and want to replace with tiger_2015, refer to " -"" -msgstr "" - -#. Tag: para -#, no-c-format -msgid "" -"You can install the TIGER Geocoder with the PostgreSQL extension model. " -"Refer to for details." -msgstr "" - -#. Tag: para -#, no-c-format -msgid "" -"The function as a drop in " -"replacement for in-built . Refer to " -" for compile and " -"installation instructions." -msgstr "" - -#. Tag: para -#, no-c-format -msgid "Design:" -msgstr "" - -#. Tag: para -#, no-c-format -msgid "" -"The goal of this project is to build a fully functional geocoder that can " -"process an arbitrary United States address string and using normalized TIGER " -"census data, produce a point geometry and rating reflecting the location of " -"the given address and likeliness of the location. The higher the rating " -"number the worse the result." -msgstr "" - -#. Tag: para -#, no-c-format -msgid "" -"The reverse_geocode function is useful for deriving the " -"street address and cross streets of a GPS location." -msgstr "" - -#. Tag: para -#, no-c-format -msgid "" -"The geocoder should be simple for anyone familiar with PostGIS to install " -"and use, and should be easily installable and usable on all platforms " -"supported by PostGIS." -msgstr "" - -#. Tag: para -#, no-c-format -msgid "" -"It should be robust enough to function properly despite formatting and " -"spelling errors." -msgstr "" - -#. Tag: para -#, no-c-format -msgid "" -"It should be extensible enough to be used with future data updates, or " -"alternate data sources with a minimum of coding changes." -msgstr "" - -#. Tag: para -#, no-c-format -msgid "" -"The tiger schema must be added to the database search " -"path for the functions to work properly." -msgstr "" - -#. Tag: para -#, no-c-format -msgid "" -"There are a couple other open source geocoders for PostGIS, that unlike the " -"TIGER Geocoder have the advantage of multi-country geocoding support" -msgstr "" - -#. Tag: para -#, no-c-format -msgid "" -"Nominatim uses OpenStreetMap gazeteer formatted data. It requires osm2pgsql for " -"loading the data together with PostgreSQL and PostGIS. It is packaged as a " -"webservice interface and seems designed to be called as a webservice. Just " -"like the TIGER Geocoder, it has both a geocoder and a reverse geocoder " -"component. From the documentation, it is unclear if it has a pure SQL " -"interface like the TIGER Geocoder, or if a good deal of the logic is " -"implemented in the web interface." -msgstr "" - -#. Tag: para -#, no-c-format -msgid "" -"GIS Graphy can " -"utilize PostGIS and like Nominatim uses OpenStreetMap (OSM) data along with " -"some other sources. It comes with a loader to load OSM data and similar to " -"Nominatim is capable of geocoding not just US. Much like Nominatim, it runs " -"as a webservice and relies on Java 1.5, Servlet apps, Solr. GisGraphy is " -"cross-platform and also has a reverse geocoder among some other neat " -"features." -msgstr "" - -#. Tag: refpurpose -#, no-c-format -msgid "" -"Generates a script that drops all non-primary key and non-unique " -"indexes on tiger schema and user specified schema. Defaults schema to " -"tiger_data if no schema is specified." -msgstr "" - -#. Tag: para -#, no-c-format -msgid "" -"Generates a script that drops all non-primary key and non-unique " -"indexes on tiger schema and user specified schema. Defaults schema to " -"tiger_data if no schema is specified." -msgstr "" - -#. Tag: para -#, no-c-format -msgid "" -"This is useful for minimizing index bloat that may confuse the query planner " -"or take up unnecessary space. Use in combination with to add just the indexes used by the " -"geocoder." -msgstr "" - -#. Tag: para -#, no-c-format -msgid "Availability: 2.0.0" -msgstr "" - -#. Tag: para -#, no-c-format -msgid ", " -msgstr "" - -#. Tag: refpurpose -#, no-c-format -msgid "" -"Generates a script that drops all tables in the specified schema that start " -"with county_all, state_all or state " -"code followed by county or state." -msgstr "" - -#. Tag: para -#, no-c-format -msgid "" -"Generates a script that drops all tables in the specified schema that start " -"with county_all, state_all or state " -"code followed by county or state. This " -"is needed if you are upgrading from tiger_2010 to " -"tiger_2011 data." -msgstr "" - -#. Tag: para -#, no-c-format -msgid "Availability: 2.1.0" -msgstr "" - -#. Tag: refpurpose -#, no-c-format -msgid "" -"Generates a script that drops all tables in the specified schema that are " -"prefixed with the state abbreviation. Defaults schema to " -"tiger_data if no schema is specified." -msgstr "" - -#. Tag: para -#, no-c-format -msgid "" -"Generates a script that drops all tables in the specified schema that are " -"prefixed with the state abbreviation. Defaults schema to " -"tiger_data if no schema is specified. This function is " -"useful for dropping tables of a state just before you reload a state in case " -"something went wrong during your previous load." -msgstr "" - -#. Tag: refpurpose -#, no-c-format -msgid "" -"Takes in an address as a string (or other normalized address) and outputs a " -"set of possible locations which include a point geometry in NAD 83 long lat, " -"a normalized address for each, and the rating. The lower the rating the more " -"likely the match. Results are sorted by lowest rating first. Can optionally " -"pass in maximum results, defaults to 10, and restrict_region (defaults to " -"NULL)" -msgstr "" - -#. Tag: para -#, no-c-format -msgid "" -"Takes in an address as a string (or already normalized address) and outputs " -"a set of possible locations which include a point geometry in NAD 83 long " -"lat, a normalized_address (addy) for each, and the " -"rating. The lower the rating the more likely the match. Results are sorted " -"by lowest rating first. Uses Tiger data (edges,faces,addr), PostgreSQL fuzzy " -"string matching (soundex,levenshtein) and PostGIS line interpolation " -"functions to interpolate address along the Tiger edges. The higher the " -"rating the less likely the geocode is right. The geocoded point is defaulted " -"to offset 10 meters from center-line off to side (L/R) of street address is " -"located on." -msgstr "" - -#. Tag: para -#, no-c-format -msgid "" -"Enhanced: 2.0.0 to support Tiger 2010 structured data and revised some logic " -"to improve speed, accuracy of geocoding, and to offset point from centerline " -"to side of street address is located on. The new parameter " -"max_results useful for specifying number of best results " -"or just returning the best result." -msgstr "" - -#. Tag: title -#, no-c-format -msgid "Examples: Basic" -msgstr "" - -#. Tag: para -#, no-c-format -msgid "Exact matches are faster to compute (61ms)" -msgstr "" - -#. Tag: para -#, no-c-format -msgid "" -"Even if zip is not passed in the geocoder can guess (took about 122-150 ms)" -msgstr "" - -#. Tag: para -#, no-c-format -msgid "" -"Can handle misspellings and provides more than one possible solution with " -"ratings and takes longer (500ms)." -msgstr "" - -#. Tag: para -#, no-c-format -msgid "" -"Using to do a batch geocode of addresses. Easiest is to set " -"max_results=1. Only process those not yet geocoded (have " -"no rating)." -msgstr "" - -#. Tag: title -#, no-c-format -msgid "Examples: Using Geometry filter" -msgstr "" - -#. Tag: para -#, no-c-format -msgid "" -", , , , , " -msgstr "" - -#. Tag: refpurpose -#, no-c-format -msgid "" -"Takes in 2 streets that intersect and a state, city, zip, and outputs a set " -"of possible locations on the first cross street that is at the intersection, " -"also includes a geomout as the point location in NAD 83 long lat, a " -"normalized_address (addy) for each location, and the " -"rating. The lower the rating the more likely the match. Results are sorted " -"by lowest rating first. Can optionally pass in maximum results, defaults to " -"10. Uses Tiger data (edges, faces, addr), PostgreSQL fuzzy string matching " -"(soundex, levenshtein)." -msgstr "" - -#. Tag: para -#, no-c-format -msgid "" -"Takes in 2 streets that intersect and a state, city, zip, and outputs a set " -"of possible locations on the first cross street that is at the intersection, " -"also includes a point geometry in NAD 83 long lat, a normalized address for " -"each location, and the rating. The lower the rating the more likely the " -"match. Results are sorted by lowest rating first. Can optionally pass in " -"maximum results, defaults to 10. Returns normalized_address (addy) for each, geomout as the point location in nad 83 long lat, " -"and the rating. The lower the rating the more likely the match. Results are " -"sorted by lowest rating first. Uses Tiger data (edges,faces,addr), " -"PostgreSQL fuzzy string matching (soundex,levenshtein)" -msgstr "" - -#. Tag: para -#, no-c-format -msgid "" -"Even if zip is not passed in the geocoder can guess (took about 3500 ms on " -"the windows 7 box), on the windows 2003 64-bit 741 ms" -msgstr "" - -#. Tag: para -#, no-c-format -msgid ", , " -msgstr "" - -#. Tag: refpurpose -#, no-c-format -msgid "" -"Returns value of specific setting stored in tiger.geocode_settings table." -msgstr "" - -#. Tag: para -#, no-c-format -msgid "" -"Returns value of specific setting stored in tiger.geocode_settings table. " -"Settings allow you to toggle debugging of functions. Later plans will be to " -"control rating with settings. Current list of settings are as follows:" -msgstr "" - -#. Tag: para -#, no-c-format -msgid "" -"Changed: 2.2.0 : default settings are now kept in a table called " -"geocode_settings_default. Use customized settingsa are in geocode_settings " -"and only contain those that have been set by user." -msgstr "" - -#. Tag: title -#, no-c-format -msgid "Example return debugging setting" -msgstr "" - -#. Tag: refpurpose -#, no-c-format -msgid "" -"Returns census tract or field from tract table of where the geometry is " -"located. Default to returning short name of tract." -msgstr "" - -#. Tag: para -#, no-c-format -msgid "" -"Given a geometry will return the census tract location of that geometry. NAD " -"83 long lat is assumed if no spatial ref sys is specified." -msgstr "" - -#. Tag: para -#, no-c-format -msgid "" -"This function uses the census tract which is not loaded " -"by default. If you have already loaded your state table, you can load tract " -"as well as bg, and tabblock using the script." -msgstr "" - -#. Tag: para -#, no-c-format -msgid "" -"If you have not loaded your state data yet and want these additional tables " -"loaded, do the following" -msgstr "" - -#. Tag: para -#, no-c-format -msgid "" -"then they will be included by the ." -msgstr "" - -#. Tag: para -#, no-c-format -msgid ">" -msgstr "" - -#. Tag: refpurpose -#, no-c-format -msgid "" -"Finds all tables with key columns used in geocoder joins and filter " -"conditions that are missing used indexes on those columns and will add them." -msgstr "" - -#. Tag: para -#, no-c-format -msgid "" -"Finds all tables in tiger and tiger_data schemas with key columns used in geocoder joins and filters that " -"are missing indexes on those columns and will output the SQL DDL to define " -"the index for those tables and then execute the generated script. This is a " -"helper function that adds new indexes needed to make queries faster that may " -"have been missing during the load process. This function is a companion to " -" that in addition to " -"generating the create index script, also executes it. It is called as part " -"of the update_geocode.sql upgrade script." -msgstr "" - -#. Tag: refpurpose -#, no-c-format -msgid "" -"Generates a shell script for the specified platform for the specified states " -"that will download Tiger census state tract, bg, and tabblocks data tables, " -"stage and load into tiger_data schema. Each state script " -"is returned as a separate record." -msgstr "" - -#. Tag: para -#, no-c-format -msgid "" -"Generates a shell script for the specified platform for the specified states " -"that will download Tiger data census state tract, block " -"groups bg, and tabblocks data tables, " -"stage and load into tiger_data schema. Each state script " -"is returned as a separate record." -msgstr "" - -#. Tag: para -#, no-c-format -msgid "" -"It uses unzip on Linux (7-zip on Windows by default) and wget to do the " -"downloading. It uses to load in the " -"data. Note the smallest unit it does is a whole state. It will only process " -"the files in the staging and temp folders." -msgstr "" - -#. Tag: para -#, no-c-format -msgid "" -"It uses the following control tables to control the process and different OS " -"shell syntax variations." -msgstr "" - -#. Tag: para -#, no-c-format -msgid "" -"loader_variables keeps track of various variables such as " -"census site, year, data and staging schemas" -msgstr "" - -#. Tag: para -#, no-c-format -msgid "" -"loader_platform profiles of various platforms and where " -"the various executables are located. Comes with windows and linux. More can " -"be added." -msgstr "" - -#. Tag: para -#, no-c-format -msgid "" -"loader_lookuptables each record defines a kind of table " -"(state, county), whether to process records in it and how to load them in. " -"Defines the steps to import data, stage data, add, removes columns, indexes, " -"and constraints for each. Each table is prefixed with the state and inherits " -"from a table in the tiger schema. e.g. creates tiger_data.ma_faces which inherits from tiger.faces" -msgstr "" - -#. Tag: para -#, no-c-format -msgid "" -"includes this logic, but if you installed the TIGER Geocoder with older " -"scripts, rerun it on the states you have already processed to get these " -"additional tables." -msgstr "" - -#. Tag: para -#, no-c-format -msgid "" -"Generate script to load up data for select states in Windows shell script " -"format." -msgstr "" - -#. Tag: para -#, no-c-format -msgid "Generate sh script" -msgstr "" - -#. Tag: refpurpose -#, no-c-format -msgid "" -"Generates a shell script for the specified platform for the specified states " -"that will download Tiger data, stage and load into tiger_data schema. Each state script is returned as a separate record. Latest " -"version supports Tiger 2010 structural changes and also loads census tract, " -"block groups, and blocks tables." -msgstr "" - -#. Tag: para -#, no-c-format -msgid "" -"Generates a shell script for the specified platform for the specified states " -"that will download Tiger data, stage and load into tiger_data schema. Each state script is returned as a separate record." -msgstr "" - -#. Tag: para -#, no-c-format -msgid "" -"It uses unzip on Linux (7-zip on Windows by default) and wget to do the " -"downloading. It uses to load in the " -"data. Note the smallest unit it does is a whole state, but you can overwrite " -"this by downloading the files yourself. It will only process the files in " -"the staging and temp folders." -msgstr "" - -#. Tag: para -#, no-c-format -msgid "" -"Availability: 2.0.0 to support Tiger 2010 structured data and load census " -"tract (tract), block groups (bg), and blocks (tabblocks) tables ." -msgstr "" - -#. Tag: para -#, no-c-format -msgid "" -"If you are using pgAdmin 3, be warned that by default pgAdmin 3 truncates " -"long text. To fix, change File -> Options -> Query Tool -" -"> Query Editor - > Max. characters per column to larger " -"than 50000 characters." -msgstr "" - -#. Tag: para -#, no-c-format -msgid "" -"Using psql where gistest is your database and /gisdata/data_load." -"sh is the file to create with the shell commands to run." -msgstr "" - -#. Tag: para -#, no-c-format -msgid "" -"Generate script to load up data for 2 states in Windows shell script format." -msgstr "" - -#. Tag: para -#, no-c-format -msgid "" -", , " -msgstr "" - -#. Tag: refpurpose -#, no-c-format -msgid "" -"Generates a shell script for the specified platform that loads in the county " -"and state lookup tables." -msgstr "" - -#. Tag: para -#, no-c-format -msgid "" -"Generates a shell script for the specified platform that loads in the " -"county_all, county_all_lookup, " -"state_all tables into tiger_data " -"schema. These inherit respectively from the county, " -"county_lookup, state tables in " -"tiger schema." -msgstr "" - -#. Tag: para -#, no-c-format -msgid "" -"It uses unzip on Linux (7-zip on Windows by default) and wget to do the " -"downloading. It uses to load in the data." -msgstr "" - -#. Tag: para -#, no-c-format -msgid "" -"It uses the following control tables tiger.loader_platform, tiger.loader_variables, and tiger." -"loader_lookuptables to control the process and different OS shell " -"syntax variations." -msgstr "" - -#. Tag: para -#, no-c-format -msgid "" -"loader_platform profiles of various platforms and where " -"the various executables are located. Comes with windows and linux/unix. More " -"can be added." -msgstr "" - -#. Tag: para -#, no-c-format -msgid "" -"Enhanced: 2.4.1 ZIP Code 5 tabulation area (zcta5) load step was fixed and " -"when enabled, zcta5 data is loaded as a single table called zcta5_all as " -"part of the nation script load." -msgstr "" - -#. Tag: para -#, no-c-format -msgid "" -"If you want ZIP Code 5 tabulation area (zcta5) to be included in your nation " -"script load, do the following:" -msgstr "" - -#. Tag: para -#, no-c-format -msgid "" -"If you were running tiger_2010 version and you want to " -"reload as state with newer tiger data, you'll need to for the very first " -"load generate and run drop statements before you run this script." -msgstr "" - -#. Tag: para -#, no-c-format -msgid "Generate script script to load nation data Windows." -msgstr "" - -#. Tag: para -#, no-c-format -msgid "Generate script to load up data for Linux/Unix systems." -msgstr "" - -#. Tag: para -#, no-c-format -msgid ", " -msgstr "" - -#. Tag: refpurpose -#, no-c-format -msgid "" -"Finds all tables with key columns used in geocoder joins that are missing " -"indexes on those columns and will output the SQL DDL to define the index for " -"those tables." -msgstr "" - -#. Tag: para -#, no-c-format -msgid "" -"Finds all tables in tiger and tiger_data schemas with key columns used in geocoder joins that are missing " -"indexes on those columns and will output the SQL DDL to define the index for " -"those tables. This is a helper function that adds new indexes needed to make " -"queries faster that may have been missing during the load process. As the " -"geocoder is improved, this function will be updated to accommodate new " -"indexes being used. If this function outputs nothing, it means all your " -"tables have what we think are the key indexes already in place." -msgstr "" - -#. Tag: para -#, no-c-format -msgid ", " -msgstr "" - -#. Tag: refpurpose -#, no-c-format -msgid "" -"Given a textual street address, returns a composite norm_addy type that has road suffix, prefix and type standardized, street, " -"streetname etc. broken into separate fields. This function will work with " -"just the lookup data packaged with the tiger_geocoder (no need for tiger " -"census data)." -msgstr "" - -#. Tag: para -#, no-c-format -msgid "" -"Given a textual street address, returns a composite norm_addy type that has road suffix, prefix and type standardized, street, " -"streetname etc. broken into separate fields. This is the first step in the " -"geocoding process to get all addresses into normalized postal form. No other " -"data is required aside from what is packaged with the geocoder." -msgstr "" - -#. Tag: para -#, no-c-format -msgid "" -"This function just uses the various direction/state/suffix lookup tables " -"preloaded with the tiger_geocoder and located in the tiger schema, so it doesn't need you to download tiger census data or any " -"other additional data to make use of it. You may find the need to add more " -"abbreviations or alternative namings to the various lookup tables in the " -"tiger schema." -msgstr "" - -#. Tag: para -#, no-c-format -msgid "" -"It uses various control lookup tables located in tiger " -"schema to normalize the input address." -msgstr "" - -#. Tag: para -#, no-c-format -msgid "" -"Fields in the norm_addy type object returned by this " -"function in this order where () indicates a field required by the geocoder, " -"[] indicates an optional field:" -msgstr "" - -#. Tag: para -#, no-c-format -msgid "" -"(address) [predirAbbrev] (streetName) [streetTypeAbbrev] [postdirAbbrev] " -"[internal] [location] [stateAbbrev] [zip] [parsed] [zip4] " -"[address_alphanumeric]" -msgstr "" - -#. Tag: para -#, no-c-format -msgid "" -"Enhanced: 2.4.0 norm_addy object includes additional fields zip4 and " -"address_alphanumeric." -msgstr "" - -#. Tag: para -#, no-c-format -msgid "address is an integer: The street number" -msgstr "" - -#. Tag: para -#, no-c-format -msgid "" -"predirAbbrev is varchar: Directional prefix of road such " -"as N, S, E, W etc. These are controlled using the direction_lookup table." -msgstr "" - -#. Tag: para -#, no-c-format -msgid "streetName varchar" -msgstr "" - -#. Tag: para -#, no-c-format -msgid "" -"streetTypeAbbrev varchar abbreviated version of street " -"type: e.g. St, Ave, Cir. These are controlled using the " -"street_type_lookup table." -msgstr "" - -#. Tag: para -#, no-c-format -msgid "" -"postdirAbbrev varchar abbreviated directional suffice of " -"road N, S, E, W etc. These are controlled using the " -"direction_lookup table." -msgstr "" - -#. Tag: para -#, no-c-format -msgid "" -"internal varchar internal address such as an apartment or " -"suite number." -msgstr "" - -#. Tag: para -#, no-c-format -msgid "" -"location varchar usually a city or governing province." -msgstr "" - -#. Tag: para -#, no-c-format -msgid "" -"stateAbbrev varchar two character US State. e.g MA, NY, " -"MI. These are controlled by the state_lookup table." -msgstr "" - -#. Tag: para -#, no-c-format -msgid "zip varchar 5-digit zipcode. e.g. 02109." -msgstr "" - -#. Tag: para -#, no-c-format -msgid "" -"parsed boolean - denotes if address was formed from " -"normalize process. The normalize_address function sets this to true before " -"returning the address." -msgstr "" - -#. Tag: para -#, no-c-format -msgid "" -"zip4 last 4 digits of a 9 digit ZIP Code. Availability: " -"PostGIS 2.4.0." -msgstr "" - -#. Tag: para -#, no-c-format -msgid "" -"address_alphanumeric Full street number even if it has " -"alpha characters like 17R. Parsing of this is better using function. Availability: PostGIS 2.4.0." -msgstr "" - -#. Tag: para -#, no-c-format -msgid "" -"Output select fields. Use if you want a " -"pretty textual output." -msgstr "" - -#. Tag: para -#, no-c-format -msgid ", " -msgstr "" - -#. Tag: refpurpose -#, no-c-format -msgid "" -"Given a textual street address, returns a composite norm_addy type that has road suffix, prefix and type standardized, street, " -"streetname etc. broken into separate fields. This function will work with " -"just the lookup data packaged with the tiger_geocoder (no need for tiger " -"census data). Requires address_standardizer extension." -msgstr "" - -#. Tag: para -#, no-c-format -msgid "" -"This function just uses the various pagc_* lookup tables preloaded with the " -"tiger_geocoder and located in the tiger schema, so it " -"doesn't need you to download tiger census data or any other additional data " -"to make use of it. You may find the need to add more abbreviations or " -"alternative namings to the various lookup tables in the tiger schema." -msgstr "" - -#. Tag: para -#, no-c-format -msgid "" -"There are slight variations in casing and formatting over the ." -msgstr "" - -#. Tag: para -#, no-c-format -msgid "" -"(address) [predirAbbrev] (streetName) [streetTypeAbbrev] [postdirAbbrev] " -"[internal] [location] [stateAbbrev] [zip]" -msgstr "" - -#. Tag: para -#, no-c-format -msgid "" -"The native standardaddr of address_standardizer extension is at this time a " -"bit richer than norm_addy since its designed to support international " -"addresses (including country). standardaddr equivalent fields are:" -msgstr "" - -#. Tag: para -#, no-c-format -msgid "house_num,predir, name, suftype, sufdir, unit, city, state, postcode" -msgstr "" - -#. Tag: para -#, no-c-format -msgid "Single call example" -msgstr "" - -#. Tag: para -#, no-c-format -msgid "" -"Batch call. There are currently speed issues with the way " -"postgis_tiger_geocoder wraps the address_standardizer. These will hopefully " -"be resolved in later editions. To work around them, if you need speed for " -"batch geocoding to call generate a normaddy in batch mode, you are " -"encouraged to directly call the address_standardizer standardize_address " -"function as shown below which is similar exercise to what we did in that uses data created in ." -msgstr "" - -#. Tag: para -#, no-c-format -msgid ", " -msgstr "" - -#. Tag: refpurpose -#, no-c-format -msgid "" -"Given a norm_addy composite type object, returns a pretty " -"print representation of it. Usually used in conjunction with " -"normalize_address." -msgstr "" - -#. Tag: para -#, no-c-format -msgid "" -"Given a norm_addy composite type object, returns a pretty " -"print representation of it. No other data is required aside from what is " -"packaged with the geocoder." -msgstr "" - -#. Tag: para -#, no-c-format -msgid "Usually used in conjunction with ." -msgstr "" - -#. Tag: para -#, no-c-format -msgid "Pretty print a single address" -msgstr "" - -#. Tag: para -#, no-c-format -msgid "Pretty print address a table of addresses" -msgstr "" - -#. Tag: refpurpose -#, no-c-format -msgid "" -"Takes a geometry point in a known spatial ref sys and returns a record " -"containing an array of theoretically possible addresses and an array of " -"cross streets. If include_strnum_range = true, includes the street range in " -"the cross streets." -msgstr "" - -#. Tag: para -#, no-c-format -msgid "" -"Takes a geometry point in a known spatial ref and returns a record " -"containing an array of theoretically possible addresses and an array of " -"cross streets. If include_strnum_range = true, includes the street range in " -"the cross streets. include_strnum_range defaults to false if not passed in. " -"Addresses are sorted according to which road a point is closest to so first " -"address is most likely the right one." -msgstr "" - -#. Tag: para -#, no-c-format -msgid "" -"Why do we say theoretical instead of actual addresses. The Tiger data " -"doesn't have real addresses, but just street ranges. As such the theoretical " -"address is an interpolated address based on the street ranges. Like for " -"example interpolating one of my addresses returns a 26 Court St. and 26 " -"Court Sq., though there is no such place as 26 Court Sq. This is because a " -"point may be at a corner of 2 streets and thus the logic interpolates along " -"both streets. The logic also assumes addresses are equally spaced along a " -"street, which of course is wrong since you can have a municipal building " -"taking up a good chunk of the street range and the rest of the buildings are " -"clustered at the end." -msgstr "" - -#. Tag: para -#, no-c-format -msgid "" -"Note: Hmm this function relies on Tiger data. If you have not loaded data " -"covering the region of this point, then hmm you will get a record filled " -"with NULLS." -msgstr "" - -#. Tag: para -#, no-c-format -msgid "Returned elements of the record are as follows:" -msgstr "" - -#. Tag: para -#, no-c-format -msgid "" -"intpt is an array of points: These are the center line " -"points on the street closest to the input point. There are as many points as " -"there are addresses." -msgstr "" - -#. Tag: para -#, no-c-format -msgid "" -"addy is an array of norm_addy (normalized addresses): " -"These are an array of possible addresses that fit the input point. The first " -"one in the array is most likely. Generally there should be only one, except " -"in the case when a point is at the corner of 2 or 3 streets, or the point is " -"somewhere on the road and not off to the side." -msgstr "" - -#. Tag: para -#, no-c-format -msgid "" -"street an array of varchar: These are cross streets (or " -"the street) (streets that intersect or are the street the point is projected " -"to be on)." -msgstr "" - -#. Tag: para -#, no-c-format -msgid "" -"Enhanced: 2.4.1 if optional zcta5 dataset is loaded, the reverse_geocode " -"function can resolve to state and zip even if the specific state data is not " -"loaded. Refer to for " -"details on loading zcta5 data." -msgstr "" - -#. Tag: para -#, no-c-format -msgid "" -"Example of a point at the corner of two streets, but closest to one. This is " -"approximate location of MIT: 77 Massachusetts Ave, Cambridge, MA 02139 Note " -"that although we don't have 3 streets, PostgreSQL will just return null for " -"entries above our upper bound so safe to use. This includes street ranges" -msgstr "" - -#. Tag: para -#, no-c-format -msgid "" -"Here we choose not to include the address ranges for the cross streets and " -"picked a location really really close to a corner of 2 streets thus could be " -"known by two different addresses." -msgstr "" - -#. Tag: para -#, no-c-format -msgid "" -"For this one we reuse our geocoded example from " -"and we only want the primary address and at most 2 cross streets." -msgstr "" - -#. Tag: para -#, no-c-format -msgid "" -", , " -msgstr "" - -#. Tag: refpurpose -#, no-c-format -msgid "" -"Loads a defined region of tiger data into a PostGIS Topology and " -"transforming the tiger data to spatial reference of the topology and " -"snapping to the precision tolerance of the topology." -msgstr "" - -#. Tag: para -#, no-c-format -msgid "" -"Loads a defined region of tiger data into a PostGIS Topology. The faces, " -"nodes and edges are transformed to the spatial reference system of the " -"target topology and points are snapped to the tolerance of the target " -"topology. The created faces, nodes, edges maintain the same ids as the " -"original Tiger data faces, nodes, edges so that datasets can be in the " -"future be more easily reconciled with tiger data. Returns summary details " -"about the process." -msgstr "" - -#. Tag: para -#, no-c-format -msgid "" -"This would be useful for example for redistricting data where you require " -"the newly formed polygons to follow the center lines of streets and for the " -"resulting polygons not to overlap." -msgstr "" - -#. Tag: para -#, no-c-format -msgid "" -"This function relies on Tiger data as well as the installation of the " -"PostGIS topology module. For more information, refer to and . " -"If you have not loaded data covering the region of interest, then no " -"topology records will be created. This function will also fail if you have " -"not created a topology using the topology functions." -msgstr "" - -#. Tag: para -#, no-c-format -msgid "" -"Most topology validation errors are a result of tolerance issues where after " -"transformation the edges points don't quite line up or overlap. To remedy " -"the situation you may want to increase or lower the precision if you get " -"topology validation failures." -msgstr "" - -#. Tag: para -#, no-c-format -msgid "Required arguments:" -msgstr "" - -#. Tag: para -#, no-c-format -msgid "" -"topo_name The name of an existing PostGIS topology to " -"load data into." -msgstr "" - -#. Tag: para -#, no-c-format -msgid "" -"region_type The type of bounding region. Currently only " -"place and county are supported. Plan " -"is to have several more. This is the table to look into to define the region " -"bounds. e.g tiger.place, tiger.county" -msgstr "" - -#. Tag: para -#, no-c-format -msgid "" -"region_id This is what TIGER calls the geoid. It is the " -"unique identifier of the region in the table. For place it is the " -"plcidfp column in tiger.place. For " -"county it is the cntyidfp column in tiger." -"county" -msgstr "" - -#. Tag: title -#, no-c-format -msgid "Example: Boston, Massachusetts Topology" -msgstr "" - -#. Tag: para -#, no-c-format -msgid "" -"Create a topology for Boston, Massachusetts in Mass State Plane Feet (2249) " -"with tolerance 0.25 feet and then load in Boston city tiger faces, edges, " -"nodes." -msgstr "" - -#. Tag: title -#, no-c-format -msgid "Example: Suffolk, Massachusetts Topology" -msgstr "" - -#. Tag: para -#, no-c-format -msgid "" -"Create a topology for Suffolk, Massachusetts in Mass State Plane Meters " -"(26986) with tolerance 0.25 meters and then load in Suffolk county tiger " -"faces, edges, nodes." -msgstr "" - -#. Tag: para -#, no-c-format -msgid "" -", , , " -"" -msgstr "" - -#. Tag: refpurpose -#, no-c-format -msgid "Sets a setting that affects behavior of geocoder functions." -msgstr "" - -#. Tag: para -#, no-c-format -msgid "" -"Sets value of specific setting stored in tiger.geocode_settings table. Settings allow you to toggle debugging of functions. Later " -"plans will be to control rating with settings. Current list of settings are " -"listed in ." -msgstr "" - -#. Tag: para -#, no-c-format -msgid "" -"If you run when this function is true, the " -"NOTICE log will output timing and queries." -msgstr "" - #. Tag: title #, no-c-format msgid "Topology" @@ -3025,7 +875,7 @@ msgid "" "href=\"https://www.census.gov/geo/maps-data/data/tiger.html\">US Census " "Topologically Integrated Geographic Encoding and Referencing System (TIGER) database. If you want to experiment with PostGIS topology and need " -"some data, check out ." +"some data." msgstr "" #. Tag: para @@ -3459,6 +1309,11 @@ msgid "" "metadata information about it is updated accordingly." msgstr "" +#. Tag: para +#, no-c-format +msgid "Availability: 3.4.0" +msgstr "" + #. Tag: para #, no-c-format msgid ", " @@ -3600,6 +1455,11 @@ msgid "" "in topology." msgstr "" +#. Tag: para +#, no-c-format +msgid "Availability: 2.0.0" +msgstr "" + #. Tag: refpurpose #, no-c-format msgid "" @@ -3979,11 +1839,6 @@ msgid "" "linking checks." msgstr "" -#. Tag: para -#, no-c-format -msgid ", " -msgstr "" - #. Tag: refpurpose #, no-c-format msgid "Returns info about invalid topology relation records" @@ -4033,6 +1888,15 @@ msgid "" "specified by the bbox parameter." msgstr "" +#. Tag: para +#, no-c-format +msgid "" +"Using a gridSize larger than the smallest edge extent " +"raises an exception rather than collapsing the edge into an empty geometry. " +"This safeguards adjacent topological relationships by preventing precision " +"snapping from removing primitives altogether." +msgstr "" + #. Tag: para #, no-c-format msgid "" @@ -4242,8 +2106,7 @@ msgstr "" #. Tag: para #, no-c-format -msgid "" -", , " +msgid ", " msgstr "" #. Tag: refpurpose @@ -5510,6 +3373,11 @@ msgstr "" msgid "Splitting component edges may help retaining simplicity/validity." msgstr "" +#. Tag: para +#, no-c-format +msgid "Availability: 2.1.0" +msgstr "" + #. Tag: para #, no-c-format msgid "" @@ -6547,17 +4415,6 @@ msgid "" "SFCGAL/." msgstr "" -#. Tag: para -#, no-c-format -msgid "" -"In order to build the you will also " -"need PCRE 1 or 2 http://www.pcre." -"org (which generally is already installed on nix systems). will automatically be built if it detects " -"a PCRE library, or you pass in a valid --with-pcre-dir=/path/to/" -"pcre during configure." -msgstr "" - #. Tag: para #, no-c-format msgid "" @@ -6600,8 +4457,12 @@ msgstr "" #, no-c-format msgid "" "GraphicsMagick (gm convert) is required to generate the " -"images used in the documentation. GraphicsMagick is available from http://www.graphicsmagick.org/ ." +"images used in the documentation. If GraphicsMagick is unavailable, " +"ImageMagick (convert or magick convert) provides the same command-line syntax. GraphicsMagick is " +"available from http://" +"www.graphicsmagick.org/ and ImageMagick from https://imagemagick.org/ ." msgstr "" #. Tag: title @@ -6729,16 +4590,6 @@ msgid "" "will build against." msgstr "" -#. Tag: para -#, no-c-format -msgid "" -"PCRE is an BSD-licensed " -"Perl Compatible Regular Expression library required by address_standardizer " -"extension. Use this parameter (--with-pcredir=/path/to/pcredir) to manually specify a particular PCRE installation directory that " -"PostGIS will build against." -msgstr "" - #. Tag: para #, no-c-format msgid "" @@ -6751,11 +4602,6 @@ msgstr "" msgid "Compile without raster support." msgstr "" -#. Tag: para -#, no-c-format -msgid "Disables tiger geocoder support." -msgstr "" - #. Tag: para #, no-c-format msgid "Compile without topology support." @@ -6848,10 +4694,8 @@ msgid "" "The make cheatsheets target generates html cheat sheets " "suitable for quick reference or for student handouts. This requires xsltproc " "to build and will generate 4 files in doc folder " -"topology_cheatsheet.html, " -"tiger_geocoder_cheatsheet.html, " -"raster_cheatsheet.html, postgis_cheatsheet." -"html" +"topology_cheatsheet.html, raster_cheatsheet." +"html, postgis_cheatsheet.html" msgstr "" #. Tag: para @@ -7075,34 +4919,6 @@ msgid "" "results will look similar to the following (numerous lines omitted below):" msgstr "" -#. Tag: para -#, no-c-format -msgid "" -"The postgis_tiger_geocoder and " -"address_standardizer extensions, currently only support " -"the standard PostgreSQL installcheck. To test these use the below. Note: the " -"make install is not necessary if you already did make install at root of " -"PostGIS code folder." -msgstr "" - -#. Tag: para -#, no-c-format -msgid "For address_standardizer:" -msgstr "" - -#. Tag: para -#, no-c-format -msgid "Output should look like:" -msgstr "" - -#. Tag: para -#, no-c-format -msgid "" -"For tiger geocoder, make sure you have postgis and fuzzystrmatch extensions " -"available in your PostgreSQL instance. The address_standardizer tests will " -"also kick in if you built postgis with address_standardizer support:" -msgstr "" - #. Tag: para #, no-c-format msgid "output should look like:" @@ -7164,465 +4980,6 @@ msgid "" "dependency of xsltproc." msgstr "" -#. Tag: title -#, no-c-format -msgid "Installing and Using the address standardizer" -msgstr "" - -#. Tag: para -#, no-c-format -msgid "" -"The address_standardizer extension is bundled with PostGIS. For " -"more information about the address_standardizer, what it does, and how to " -"configure it for your needs, refer to ." -msgstr "" - -#. Tag: para -#, no-c-format -msgid "" -"This standardizer can be used in conjunction with the PostGIS packaged tiger " -"geocoder extension as a replacement for the discussed. To use as replacement refer to " -". You can also use it as " -"a building block for your own geocoder or use it to standardize your " -"addresses for easier compare of addresses." -msgstr "" - -#. Tag: para -#, no-c-format -msgid "" -"The address standardizer relies on PCRE which is usually already installed " -"on many Nix systems, but you can download the latest at: http://www.pcre.org. If during , PCRE is found, then the address " -"standardizer extension will automatically be built. If you have a custom " -"pcre install you want to use instead, pass to configure --with-" -"pcredir=/path/to/pcre where /path/to/pcre is the " -"root folder for your pcre include and lib directories." -msgstr "" - -#. Tag: para -#, no-c-format -msgid "" -"Windows installation packages include the address_standardizer so you can " -"move straight to the CREATE EXTENSION step." -msgstr "" - -#. Tag: para -#, no-c-format -msgid "" -"Once you have installed, you can connect to your database and run the SQL:" -msgstr "" - -#. Tag: para -#, no-c-format -msgid "The following test requires no rules, gaz, or lex tables" -msgstr "" - -#. Tag: para -#, no-c-format -msgid "Output should be" -msgstr "" - -#. Tag: title -#, no-c-format -msgid "Installing, Upgrading Tiger Geocoder, and loading data" -msgstr "" - -#. Tag: para -#, no-c-format -msgid "" -"Extras like Tiger geocoder may not be packaged in your PostGIS distribution. " -"If you are missing the tiger geocoder extension or want a newer version than " -"what your install comes with, then use the share/extension/" -"postgis_tiger_geocoder.* files from the packages in Windows Unreleased Versions section for your version of PostgreSQL. Although these packages are " -"for windows, the postgis_tiger_geocoder extension files will work on any OS " -"since the extension is an SQL/plpgsql only extension." -msgstr "" - -#. Tag: title -#, no-c-format -msgid "Tiger Geocoder Enabling your PostGIS database" -msgstr "" - -#. Tag: para -#, no-c-format -msgid "" -"These directions assume your PostgreSQL installation already has the " -"postgis_tiger_geocoder extension installed." -msgstr "" - -#. Tag: para -#, no-c-format -msgid "" -"Connect to your database via psql or pgAdmin or some other tool and run the " -"following SQL commands. Note that if you are installing in a database that " -"already has postgis, you don't need to do the first step. If you have " -"fuzzystrmatch extension already installed, you don't need " -"to do the second step either." -msgstr "" - -#. Tag: para -#, no-c-format -msgid "" -"If you already have postgis_tiger_geocoder extension installed, and just " -"want to update to the latest run:" -msgstr "" - -#. Tag: para -#, no-c-format -msgid "" -"If you made custom entries or changes to tiger.loader_platform and tiger.loader_variables you may need to " -"update these." -msgstr "" - -#. Tag: para -#, no-c-format -msgid "" -"To confirm your install is working correctly, run this sql in your database:" -msgstr "" - -#. Tag: para -#, no-c-format -msgid "Which should output" -msgstr "" - -#. Tag: para -#, no-c-format -msgid "" -"Create a new record in tiger.loader_platform table with " -"the paths of your executables and server." -msgstr "" - -#. Tag: para -#, no-c-format -msgid "" -"So for example to create a profile called debbie that follows sh convention. You would do:" -msgstr "" - -#. Tag: para -#, no-c-format -msgid "" -"And then edit the paths in the declare_sect column to " -"those that fit Debbie's pg, unzip,shp2pgsql, psql, etc path locations." -msgstr "" - -#. Tag: para -#, no-c-format -msgid "" -"If you don't edit this loader_platform table, it will " -"just contain common case locations of items and you'll have to edit the " -"generated script after the script is generated." -msgstr "" - -#. Tag: para -#, no-c-format -msgid "" -"The Zip code-5 digit tabulation area zcta5 load step uses " -"current ZCTA data and is part of the when enabled. It is turned off " -"by default because it takes quite a bit of time to load (20 to 60 minutes), " -"takes up quite a bit of disk space, and is not used that often." -msgstr "" - -#. Tag: para -#, no-c-format -msgid "To enable it, do the following:" -msgstr "" - -#. Tag: para -#, no-c-format -msgid "" -"If present the function can use it if a boundary " -"filter is added to limit to just zips in that boundary. The function uses it if the returned address is " -"missing a zip, which often happens with highway reverse geocoding." -msgstr "" - -#. Tag: para -#, no-c-format -msgid "" -"Create a folder called gisdata on root of server or " -"your local pc if you have a fast network connection to the server. This " -"folder is where the tiger files will be downloaded to and processed. If you " -"are not happy with having the folder on the root of the server, or simply " -"want to change to a different folder for staging, then edit the field " -"staging_fold in the tiger.loader_variables table." -msgstr "" - -#. Tag: para -#, no-c-format -msgid "" -"Create a folder called temp in the gisdata folder or " -"wherever you designated the staging_fold to be. This will " -"be the folder where the loader extracts the downloaded tiger data." -msgstr "" - -#. Tag: para -#, no-c-format -msgid "" -"Then run the SQL function " -"make sure to use the name of your custom profile and copy the script to a ." -"sh or .bat file. So for example to build the nation load:" -msgstr "" - -#. Tag: para -#, no-c-format -msgid "Run the generated nation load commandline scripts." -msgstr "" - -#. Tag: para -#, no-c-format -msgid "" -"After you are done running the nation script, you should have three tables " -"in your tiger_data schema and they should be filled with data. " -"Confirm you do by doing the following queries from psql or pgAdmin" -msgstr "" - -#. Tag: para -#, no-c-format -msgid "This will only have data if you marked zcta5 to be loaded" -msgstr "" - -#. Tag: para -#, no-c-format -msgid "" -"By default the tables corresponding to bg, " -"tract, tabblock20 are not loaded. " -"These tables are not used by the geocoder but are used by folks for " -"population statistics. If you wish to load them as part of your state loads, " -"run the following statement to enable them." -msgstr "" - -#. Tag: para -#, no-c-format -msgid "" -"Alternatively you can load just these tables after loading state data using " -"the " -msgstr "" - -#. Tag: para -#, no-c-format -msgid "" -"DO NOT Generate the state script until you have already loaded the nation " -"data, because the state script utilizes county list loaded by nation script." -msgstr "" - -#. Tag: para -#, no-c-format -msgid "" -"For each state you want to load data for, generate a state script ." -msgstr "" - -#. Tag: para -#, no-c-format -msgid "Run the generated commandline scripts." -msgstr "" - -#. Tag: para -#, no-c-format -msgid "" -"After you are done loading all data or at a stopping point, it's a good idea " -"to analyze all the tiger tables to update the stats (include inherited stats)" -msgstr "" - -#. Tag: title -#, no-c-format -msgid "Using Address Standardizer Extension with Tiger geocoder" -msgstr "" - -#. Tag: para -#, no-c-format -msgid "" -"One of the many complaints of folks is the address normalizer function function that normalizes an address for " -"prepping before geocoding. The normalizer is far from perfect and trying to " -"patch its imperfectness takes a vast amount of resources. As such we have " -"integrated with another project that has a much better address standardizer " -"engine. To use this new address_standardizer, you compile the extension as " -"described in and " -"install as an extension in your database." -msgstr "" - -#. Tag: para -#, no-c-format -msgid "" -"Once you install this extension in the same database as you have installed " -"postgis_tiger_geocoder, then the can be used instead of . This extension is tiger agnostic, so can be " -"used with other data sources such as international addresses. The tiger " -"geocoder extension does come packaged with its own custom versions of ( tiger.pagc_rules) , (tiger.pagc_gaz), and (tiger.pagc_lex). These you can add and " -"update to improve your standardizing experience for your own needs." -msgstr "" - -#. Tag: title -#, no-c-format -msgid "Required tools for tiger data loading" -msgstr "" - -#. Tag: para -#, no-c-format -msgid "" -"The load process downloads data from the census website for the respective " -"nation files, states requested, extracts the files, and then loads each " -"state into its own separate set of state tables. Each state table inherits " -"from the tables defined in tiger schema so that its " -"sufficient to just query those tables to access all the data and drop a set " -"of state tables at any time using the if you need to reload a " -"state or just don't need a state anymore." -msgstr "" - -#. Tag: para -#, no-c-format -msgid "In order to be able to load data you'll need the following tools:" -msgstr "" - -#. Tag: para -#, no-c-format -msgid "A tool to unzip the zip files from census website." -msgstr "" - -#. Tag: para -#, no-c-format -msgid "" -"For Unix like systems: unzip executable which is usually " -"already installed on most Unix like platforms." -msgstr "" - -#. Tag: para -#, no-c-format -msgid "" -"For Windows, 7-zip which is a free compress/uncompress tool you can download " -"from http://www.7-zip.org/" -msgstr "" - -#. Tag: para -#, no-c-format -msgid "" -"shp2pgsql commandline which is installed by default " -"when you install PostGIS." -msgstr "" - -#. Tag: para -#, no-c-format -msgid "" -"wget which is a web grabber tool usually installed on " -"most Unix/Linux systems." -msgstr "" - -#. Tag: para -#, no-c-format -msgid "" -"If you are on windows, you can get pre-compiled binaries from http://gnuwin32." -"sourceforge.net/packages/wget.htm" -msgstr "" - -#. Tag: para -#, no-c-format -msgid "" -"If you are upgrading from tiger_2010, you'll need to first generate and run " -". Before you load any " -"state data, you need to load the nation wide data which you do with . Which will generate a loader " -"script for you. is a one-" -"time step that should be done for upgrading (from a prior year tiger census " -"data) and for new installs." -msgstr "" - -#. Tag: para -#, no-c-format -msgid "" -"To load state data refer to to " -"generate a data load script for your platform for the states you desire. " -"Note that you can install these piecemeal. You don't have to load all the " -"states you want all at once. You can load them as you need them." -msgstr "" - -#. Tag: para -#, no-c-format -msgid "" -"After the states you desire have been loaded, make sure to run the: " -"SELECT install_missing_indexes(); as " -"described in ." -msgstr "" - -#. Tag: para -#, no-c-format -msgid "" -"To test that things are working as they should, try to run a geocode on an " -"address in your state using " -msgstr "" - -#. Tag: title -#, no-c-format -msgid "Upgrading your Tiger Geocoder Install and Data" -msgstr "" - -#. Tag: para -#, no-c-format -msgid "First upgrade your postgis_tiger_geocoder extension as follows:" -msgstr "" - -#. Tag: para -#, no-c-format -msgid "" -"Next drop all nation tables and load up the new ones. Generate a drop script " -"with this SQL statement as detailed in " -msgstr "" - -#. Tag: para -#, no-c-format -msgid "Run the generated drop SQL statements." -msgstr "" - -#. Tag: para -#, no-c-format -msgid "" -"Generate a nation load script with this SELECT statement as detailed in " -"" -msgstr "" - -#. Tag: emphasis -#, no-c-format -msgid "For windows" -msgstr "" - -#. Tag: emphasis -#, no-c-format -msgid "For unix/linux" -msgstr "" - -#. Tag: para -#, no-c-format -msgid "" -"Refer to for " -"instructions on how to run the generate script. This only needs to be done " -"once." -msgstr "" - -#. Tag: para -#, no-c-format -msgid "" -"You can have a mix of different year state tables and can upgrade each state " -"separately. Before you upgrade a state you first need to drop the prior year " -"state tables for that state using ." -msgstr "" - #. Tag: title #, no-c-format msgid "Common Problems during installation" @@ -7751,7 +5108,7 @@ msgstr "" msgid "" "CI and website maintenance, Windows production and experimental builds, " "documentation, alignment of PostGIS with PostgreSQL releases, X3D support, " -"TIGER geocoder support, management functions." +"management functions." msgstr "" #. Tag: term @@ -9771,6 +7128,11 @@ msgid "" "valid." msgstr "" +#. Tag: para +#, no-c-format +msgid "Availability: 2.2.0" +msgstr "" + #. Tag: para #, no-c-format msgid "&M_support;" @@ -11839,6 +9201,50 @@ msgid "" "geometry argument participates in, or null for null inputs." msgstr "" +#. Tag: refpurpose +#, no-c-format +msgid "" +"Window function that returns a cluster id for each input geometry, " +"clustering input geometries into connected sets using the relate pattern to " +"determine whether the geometries are connected." +msgstr "" + +#. Tag: para +#, no-c-format +msgid "" +"A window function that builds connected clusters of geometries that " +"intersect. Geometries are added to a cluster if they share a pairwise DE9IM " +"relationship with another member of the cluster. With this function it is " +"possible to build a cluster of all objects that touch at boundaries, but " +"exclude those that merely overlap." +msgstr "" + +#. Tag: para +#, no-c-format +msgid "Availability: 3.7.0" +msgstr "" + +#. Tag: para +#, no-c-format +msgid "" +"This collection of line strings would form a single cluster using , but using can be clustered into three groups that " +"connect only via their end points." +msgstr "" + +#. Tag: para +#, no-c-format +msgid "Connected and overlapping linestrings" +msgstr "" + +#. Tag: para +#, no-c-format +msgid "" +", , " +msgstr "" + #. Tag: refpurpose #, no-c-format msgid "" @@ -35132,8 +32538,8 @@ msgid "" "if needed. Reports full PostGIS version and build configuration infos after. " "This is short-hand for doing multiple CREATE EXTENSION .. FROM unpackaged " "and ALTER EXTENSION .. UPDATE for each PostGIS extension. Currently only " -"tries to upgrade extensions postgis, postgis_raster, postgis_sfcgal, " -"postgis_topology, and postgis_tiger_geocoder." +"tries to upgrade extensions postgis, postgis_raster, postgis_sfcgal, and " +"postgis_topology." msgstr "" #. Tag: para @@ -40357,11 +37763,6 @@ msgstr "" msgid "Functions changed in PostGIS %" msgstr "" -#. Tag: para -#, no-c-format -msgid "This method needs address_standardizer extension." -msgstr "" - #. Tag: para #, no-c-format msgid "This method supports Circular Strings and Curves." ----------------------------------------------------------------------- Summary of changes: doc/po/templates/postgis-manual.pot | 2871 ++--------------------------------- 1 file changed, 136 insertions(+), 2735 deletions(-) hooks/post-receive -- PostGIS From trac at osgeo.org Wed Mar 25 10:52:06 2026 From: trac at osgeo.org (PostGIS) Date: Wed, 25 Mar 2026 17:52:06 -0000 Subject: [PostGIS] #6061: segmentation fault when loading geometries Message-ID: <055.668df5469379b563df5e0230250b6b98@osgeo.org> #6061: segmentation fault when loading geometries ---------------------------+--------------------------- Reporter: maxsynytsky1v | Owner: pramsey Type: defect | Status: new Priority: medium | Milestone: PostGIS 3.6.2 Component: postgis | Version: 3.6.x Keywords: | ---------------------------+--------------------------- I have a set of data extracted from Oracle database with ora2pg. The source geometries are Esri's ST_GEOMETRY and they are exported into WKT using SDE functions (SDE.ST_ASTEXT). During import I experience a crash of PostgreSQL cluster. {{{ 2026-03-25 17:39:30.083 GMT,,,1245799,,69bad932.130267,27,,2026-03-18 16:56:18 GMT,,0,LOG,00000,"server process (PID 1293403) was terminated by signal 11: Segmentation fault","Failed process was running: COPY FROM STDIN;",,,,,,,,"","postmaster",,0 2026-03-25 17:39:30.083 GMT,,,1245799,,69bad932.130267,28,,2026-03-18 16:56:18 GMT,,0,LOG,00000,"terminating any other active server processes",,,,,,,,,"","postmaster",,0 2026-03-25 17:39:30.091 GMT,,,1245799,,69bad932.130267,29,,2026-03-18 16:56:18 GMT,,0,LOG,00000,"all server processes terminated; reinitializing",,,,,,,,,"","postmaster",,0 2026-03-25 17:39:30.122 GMT,,,1293440,,69c41dd2.13bc80,1,,2026-03-25 17:39:30 GMT,,0,LOG,00000,"database system was interrupted; last known up at 2026-03-25 17:38:57 GMT",,,,,,,,,"","startup",,0 2026-03-25 17:39:31.277 GMT,,,1293440,,69c41dd2.13bc80,2,,2026-03-25 17:39:30 GMT,,0,LOG,00000,"database system was not properly shut down; automatic recovery in progress",,,,,,,,,"","startup",,0 }}} I am pretty sure the problem is not in the geometry extracted because the rows are always different but the problem can be reproduced consistently. For example: {{{ psql:data/data.sql:7114983: SSL SYSCALL error: EOF detected invalid socket psql:data/data.sql:7114983: error: connection to server was lost ERROR: an error occurs when importing file ./data/data.sql. psql:data/data.sql:7115021: SSL SYSCALL error: EOF detected invalid socket psql:data/data.sql:7115021: error: connection to server was lost ERROR: an error occurs when importing file ./data/data.sql. psql:data/data.sql:7115004: SSL SYSCALL error: EOF detected invalid socket psql:data/data.sql:7115004: error: connection to server was lost ERROR: an error occurs when importing file ./data/data.sql. psql:data/data.sql:7115055: SSL SYSCALL error: EOF detected invalid socket psql:data/data.sql:7115055: error: connection to server was lost ERROR: an error occurs when importing file ./data/data.sql. }}} I am using PostgreSQL 16.13 and PostGIS 3.6.2, OS is Debian 12.5. I will be uploading a gdb core debug and I made sure that PostgreSQL and PostGIS debug symbol packages are installed but I am running a release PostgreSQL. I redacted the debug to remove sensitive data but if you feel that this is necessary I will talk to the manager(s) if we can disclose this. -- Ticket URL: PostGIS The PostGIS Trac is used for bug, enhancement & task tracking, a user and developer wiki, and a view into the subversion code repository of PostGIS project. From trac at osgeo.org Wed Mar 25 10:53:02 2026 From: trac at osgeo.org (PostGIS) Date: Wed, 25 Mar 2026 17:53:02 -0000 Subject: [PostGIS] #6061: segmentation fault when loading geometries In-Reply-To: <055.668df5469379b563df5e0230250b6b98@osgeo.org> References: <055.668df5469379b563df5e0230250b6b98@osgeo.org> Message-ID: <070.2c5788df7f73e5f8e74d21ee496e11ef@osgeo.org> #6061: segmentation fault when loading geometries ----------------------------+--------------------------- Reporter: maxsynytsky1v | Owner: pramsey Type: defect | Status: new Priority: medium | Milestone: PostGIS 3.6.2 Component: postgis | Version: 3.6.x Resolution: | Keywords: ----------------------------+--------------------------- Changes (by maxsynytsky1v): * Attachment "gdb-postgres-core_redacted.txt" added. -- Ticket URL: PostGIS The PostGIS Trac is used for bug, enhancement & task tracking, a user and developer wiki, and a view into the subversion code repository of PostGIS project. From trac at osgeo.org Wed Mar 25 12:25:36 2026 From: trac at osgeo.org (PostGIS) Date: Wed, 25 Mar 2026 19:25:36 -0000 Subject: [PostGIS] #6061: segmentation fault when loading geometries In-Reply-To: <055.668df5469379b563df5e0230250b6b98@osgeo.org> References: <055.668df5469379b563df5e0230250b6b98@osgeo.org> Message-ID: <070.f7bf8bcc6bef6ee0336d9ed4a40f00d1@osgeo.org> #6061: segmentation fault when loading geometries ----------------------------+--------------------------- Reporter: maxsynytsky1v | Owner: pramsey Type: defect | Status: new Priority: medium | Milestone: PostGIS 3.6.2 Component: postgis | Version: 3.6.x Resolution: | Keywords: ----------------------------+--------------------------- Comment (by pramsey): In the unlikely event you've discovered a WKT input that can crash PostGIS, we will need at least one example of said input. Can you find a single row that does the magic? If you would like to back-channel it, you can email it to me directly. More likely there's something awry in your environment. Mismatched packages are one source of instability. But let's start with your input. -- Ticket URL: PostGIS The PostGIS Trac is used for bug, enhancement & task tracking, a user and developer wiki, and a view into the subversion code repository of PostGIS project. From git at osgeo.org Thu Mar 26 08:31:59 2026 From: git at osgeo.org (git at osgeo.org) Date: Thu, 26 Mar 2026 08:31:59 -0700 (PDT) Subject: [SCM] postgis.net branch website updated. clarity-final-181-gad7a9fc Message-ID: <20260326153159.8431D23012@trac.osgeo.org> 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.net". The branch, website has been updated via ad7a9fc7a906275bb67a58cf0399c16d2f6a4591 (commit) from 8f687a26d24cd29558ab3d159ecf5a675d7e5fae (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 ad7a9fc7a906275bb67a58cf0399c16d2f6a4591 Author: Regina Obe Date: Thu Mar 26 11:31:36 2026 -0400 Get rid of .Site.Author and .Site.Author.email, not supported in newer hugo diff --git a/layouts/_default/rss.xml b/layouts/_default/rss.xml index 49ce559..567a148 100644 --- a/layouts/_default/rss.xml +++ b/layouts/_default/rss.xml @@ -18,9 +18,7 @@ {{ .Permalink }} Recent content on {{ .Site.Title }} Hugo -- gohugo.io{{ with .Site.LanguageCode }} - {{.}}{{end}}{{ with .Site.Author.email }} - {{.}}{{ with $.Site.Author.name }} ({{.}}){{end}}{{end}}{{ with .Site.Author.email }} - {{.}}{{ with $.Site.Author.name }} ({{.}}){{end}}{{end}}{{ with .Site.Copyright }} + {{.}}{{end}}{{ with .Site.Copyright }} {{.}}{{end}}{{ if not .Date.IsZero }} {{ .Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }}{{ end }} {{- with .OutputFormats.Get "RSS" -}} ----------------------------------------------------------------------- Summary of changes: layouts/_default/rss.xml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) hooks/post-receive -- postgis.net From trac at osgeo.org Thu Mar 26 10:28:01 2026 From: trac at osgeo.org (PostGIS) Date: Thu, 26 Mar 2026 17:28:01 -0000 Subject: [PostGIS] #6061: segmentation fault when loading geometries In-Reply-To: <055.668df5469379b563df5e0230250b6b98@osgeo.org> References: <055.668df5469379b563df5e0230250b6b98@osgeo.org> Message-ID: <070.d3e8d11f7a8ca67b1aa9197ba35d815a@osgeo.org> #6061: segmentation fault when loading geometries ----------------------------+--------------------------- Reporter: maxsynytsky1v | Owner: pramsey Type: defect | Status: new Priority: medium | Milestone: PostGIS 3.6.2 Component: postgis | Version: 3.6.x Resolution: | Keywords: ----------------------------+--------------------------- Comment (by maxsynytsky1v): Thanks for the update, Paul. I have been able to reproduce the issue today on PostgreSQL 18.3 and PostGIS 3.6.2 running on Archlinux in WSL. This is to avoid a potential misconfiguration. I have also narrowed down the set to a single table and we are currently negotiating the disclosure. -- Ticket URL: PostGIS The PostGIS Trac is used for bug, enhancement & task tracking, a user and developer wiki, and a view into the subversion code repository of PostGIS project. From trac at osgeo.org Fri Mar 27 02:31:52 2026 From: trac at osgeo.org (PostGIS) Date: Fri, 27 Mar 2026 09:31:52 -0000 Subject: [PostGIS] #6061: segmentation fault when loading geometries In-Reply-To: <055.668df5469379b563df5e0230250b6b98@osgeo.org> References: <055.668df5469379b563df5e0230250b6b98@osgeo.org> Message-ID: <070.9d6fd672a75ed8da48c7bfd9ff2001ed@osgeo.org> #6061: segmentation fault when loading geometries ----------------------------+--------------------------- Reporter: maxsynytsky1v | Owner: pramsey Type: defect | Status: new Priority: medium | Milestone: PostGIS 3.6.2 Component: postgis | Version: 3.6.x Resolution: | Keywords: ----------------------------+--------------------------- Comment (by maxsynytsky1v): Hi Paul. The disclosure is agreed upon. What is your email? The data set is around 10MB compressed. I tries to reduce it yesterday but if I make it smaller the issue does not mitigate. So I decided to leave it as is. -- Ticket URL: PostGIS The PostGIS Trac is used for bug, enhancement & task tracking, a user and developer wiki, and a view into the subversion code repository of PostGIS project. From trac at osgeo.org Fri Mar 27 10:25:41 2026 From: trac at osgeo.org (PostGIS) Date: Fri, 27 Mar 2026 17:25:41 -0000 Subject: [PostGIS] #6061: segmentation fault when loading geometries In-Reply-To: <055.668df5469379b563df5e0230250b6b98@osgeo.org> References: <055.668df5469379b563df5e0230250b6b98@osgeo.org> Message-ID: <070.fff923c62810ef0de0b2c911d9f8f3e8@osgeo.org> #6061: segmentation fault when loading geometries ----------------------------+--------------------------- Reporter: maxsynytsky1v | Owner: pramsey Type: defect | Status: new Priority: medium | Milestone: PostGIS 3.6.2 Component: postgis | Version: 3.6.x Resolution: | Keywords: ----------------------------+--------------------------- Comment (by pramsey): You can find me pramsey at cleverelephant dot ca Hopefully 10MB will mail. -- Ticket URL: PostGIS The PostGIS Trac is used for bug, enhancement & task tracking, a user and developer wiki, and a view into the subversion code repository of PostGIS project. From trac at osgeo.org Fri Mar 27 10:35:53 2026 From: trac at osgeo.org (PostGIS) Date: Fri, 27 Mar 2026 17:35:53 -0000 Subject: [PostGIS] #6062: More error XX000: SQL/MM Spatial exception - geometry Message-ID: <050.cc9979242e6c0270b720ad1663c50b41@osgeo.org> #6062: More error XX000: SQL/MM Spatial exception - geometry -------------------------------+--------------------------- Reporter: Lars Aksel Opsahl | Owner: strk Type: defect | Status: new Priority: medium | Milestone: PostGIS 3.6.2 Component: topology | Version: 3.6.x Keywords: | -------------------------------+--------------------------- With attached with get topology errors {{{ psql:/Users/lop/dev/github/resolve-overlap-and-gap/tmp3/error_01.sql:41: ERROR: XX000: SQL/MM Spatial exception - geometry crosses edge 5107 at POINT(5.97358081667813 58.6227425544318) LOCATION: pg_error, lwgeom_pg.c:363 psql:/Users/lop/dev/github/resolve-overlap-and-gap/tmp3/error_01.sql:42: ERROR: XX000: SQL/MM Spatial exception - geometry crosses edge 5107 at POINT(5.97358081667813 58.6227425544318) LOCATION: pg_error, lwgeom_pg.c:363 }}} Tested on {{{ PostgreSQL 16.10 (Homebrew) on aarch64-apple-darwin23.6.0, compiled by Apple clang version 16.0.0 (clang-1600.0.26.6), 64-bit POSTGIS="3.7.0dev 3.6.0rc2-305-g3b3488ddf" [EXTENSION] PGSQL="160" GEOS="3.14.0-CAPI-1.20.4" PROJ="9.7.0 NETWORK_ENABLED=OFF URL_ENDPOINT=https://cdn.proj.org USER_WRITABLE_DIRECTORY=/Users/lop/Library/Application Support/proj DATABASE_PATH=/opt/homebrew/Cellar/proj/9.7.0/share/proj/proj.db" (compiled against PROJ 9.7.0) LIBXML="2.13.0" LIBJSON="0.18" TOPOLOGY PostgreSQL 16.4 (Ubuntu 16.4-1.pgdg20.04+1) on x86_64-pc-linux-gnu, compiled by gcc (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0, 64-bit POSTGIS="3.7.0dev 3.6.0rc2-305-g3b3488ddf" [EXTENSION] PGSQL="160" GEOS="3.14.0-CAPI-1.20.4" (compiled against GEOS 3.13.1) PROJ="8.2.1 NETWORK_ENABLED=OFF URL_ENDPOINT=https://cdn.proj.org USER_WRITABLE_DIRECTORY=/var/lib/postgresql/.local/share/proj DATABASE_PATH=/usr/share/proj/proj.db" (compiled against PROJ 8.2.1) LIBXML="2.9.13" LIBJSON="0.15" LIBPROTOBUF="1.3.3" WAGYU="0.5.0 (Internal)" TOPOLOGY }}} -- Ticket URL: PostGIS The PostGIS Trac is used for bug, enhancement & task tracking, a user and developer wiki, and a view into the subversion code repository of PostGIS project. From trac at osgeo.org Fri Mar 27 10:36:35 2026 From: trac at osgeo.org (PostGIS) Date: Fri, 27 Mar 2026 17:36:35 -0000 Subject: [PostGIS] #6062: More error XX000: SQL/MM Spatial exception - geometry In-Reply-To: <050.cc9979242e6c0270b720ad1663c50b41@osgeo.org> References: <050.cc9979242e6c0270b720ad1663c50b41@osgeo.org> Message-ID: <065.74e89d0a2697710508239873ad60bfac@osgeo.org> #6062: More error XX000: SQL/MM Spatial exception - geometry --------------------------------+--------------------------- Reporter: Lars Aksel Opsahl | Owner: strk Type: defect | Status: new Priority: medium | Milestone: PostGIS 3.6.2 Component: topology | Version: 3.6.x Resolution: | Keywords: --------------------------------+--------------------------- Changes (by Lars Aksel Opsahl): * Attachment "error_01.sql" added. -- Ticket URL: PostGIS The PostGIS Trac is used for bug, enhancement & task tracking, a user and developer wiki, and a view into the subversion code repository of PostGIS project. From trac at osgeo.org Mon Mar 30 00:06:22 2026 From: trac at osgeo.org (PostGIS) Date: Mon, 30 Mar 2026 07:06:22 -0000 Subject: [PostGIS] #6062: More error XX000: SQL/MM Spatial exception - geometry In-Reply-To: <050.cc9979242e6c0270b720ad1663c50b41@osgeo.org> References: <050.cc9979242e6c0270b720ad1663c50b41@osgeo.org> Message-ID: <065.dfbe24fbbcdcbc9875c2d54ea85ac9bb@osgeo.org> #6062: More error XX000: SQL/MM Spatial exception - geometry --------------------------------+--------------------------- Reporter: Lars Aksel Opsahl | Owner: strk Type: defect | Status: new Priority: medium | Milestone: PostGIS 3.6.2 Component: topology | Version: 3.6.x Resolution: | Keywords: --------------------------------+--------------------------- Changes (by strk): * Attachment "t6062.sql" added. simplified testcase -- Ticket URL: PostGIS The PostGIS Trac is used for bug, enhancement & task tracking, a user and developer wiki, and a view into the subversion code repository of PostGIS project. From trac at osgeo.org Mon Mar 30 00:09:07 2026 From: trac at osgeo.org (PostGIS) Date: Mon, 30 Mar 2026 07:09:07 -0000 Subject: [PostGIS] #6062: More error XX000: SQL/MM Spatial exception - geometry In-Reply-To: <050.cc9979242e6c0270b720ad1663c50b41@osgeo.org> References: <050.cc9979242e6c0270b720ad1663c50b41@osgeo.org> Message-ID: <065.083909d2138cbd7f40ba036f4488d1da@osgeo.org> #6062: More error XX000: SQL/MM Spatial exception - geometry --------------------------------+--------------------------- Reporter: Lars Aksel Opsahl | Owner: strk Type: defect | Status: new Priority: medium | Milestone: PostGIS 3.6.2 Component: topology | Version: 3.6.x Resolution: | Keywords: --------------------------------+--------------------------- Changes (by strk): * Attachment "screen.png" added. -- Ticket URL: PostGIS The PostGIS Trac is used for bug, enhancement & task tracking, a user and developer wiki, and a view into the subversion code repository of PostGIS project. From trac at osgeo.org Mon Mar 30 00:10:37 2026 From: trac at osgeo.org (PostGIS) Date: Mon, 30 Mar 2026 07:10:37 -0000 Subject: [PostGIS] #6062: More error XX000: SQL/MM Spatial exception - geometry In-Reply-To: <050.cc9979242e6c0270b720ad1663c50b41@osgeo.org> References: <050.cc9979242e6c0270b720ad1663c50b41@osgeo.org> Message-ID: <065.8d067ca22d8f8fabd021aeffea097f27@osgeo.org> #6062: More error XX000: SQL/MM Spatial exception - geometry --------------------------------+--------------------------- Reporter: Lars Aksel Opsahl | Owner: strk Type: defect | Status: new Priority: medium | Milestone: PostGIS 3.6.2 Component: topology | Version: 3.6.x Resolution: | Keywords: --------------------------------+--------------------------- Comment (by strk): The simplified case, as attached, adds 2 edges, one of which forms a face. Then adds a straight line which ends up throwing the "geometry crosses edge" error. [[Image(screen.png)]] -- Ticket URL: PostGIS The PostGIS Trac is used for bug, enhancement & task tracking, a user and developer wiki, and a view into the subversion code repository of PostGIS project. From trac at osgeo.org Mon Mar 30 00:23:42 2026 From: trac at osgeo.org (PostGIS) Date: Mon, 30 Mar 2026 07:23:42 -0000 Subject: [PostGIS] #6062: More error XX000: SQL/MM Spatial exception - geometry In-Reply-To: <050.cc9979242e6c0270b720ad1663c50b41@osgeo.org> References: <050.cc9979242e6c0270b720ad1663c50b41@osgeo.org> Message-ID: <065.d9aa3838ccf5308769068e6f4141ece8@osgeo.org> #6062: More error XX000: SQL/MM Spatial exception - geometry --------------------------------+--------------------------- Reporter: Lars Aksel Opsahl | Owner: strk Type: defect | Status: new Priority: medium | Milestone: PostGIS 3.6.2 Component: topology | Version: 3.6.x Resolution: | Keywords: --------------------------------+--------------------------- Changes (by strk): * Attachment "screen01.png" added. bogus snapping -- Ticket URL: PostGIS The PostGIS Trac is used for bug, enhancement & task tracking, a user and developer wiki, and a view into the subversion code repository of PostGIS project. From trac at osgeo.org Mon Mar 30 00:25:45 2026 From: trac at osgeo.org (PostGIS) Date: Mon, 30 Mar 2026 07:25:45 -0000 Subject: [PostGIS] #6062: More error XX000: SQL/MM Spatial exception - geometry In-Reply-To: <050.cc9979242e6c0270b720ad1663c50b41@osgeo.org> References: <050.cc9979242e6c0270b720ad1663c50b41@osgeo.org> Message-ID: <065.9a48d20c4951cfbfc494253b712f1d20@osgeo.org> #6062: More error XX000: SQL/MM Spatial exception - geometry --------------------------------+--------------------------- Reporter: Lars Aksel Opsahl | Owner: strk Type: defect | Status: new Priority: medium | Milestone: PostGIS 3.6.2 Component: topology | Version: 3.6.x Resolution: | Keywords: --------------------------------+--------------------------- Comment (by strk): It seems to be a problem with the snapping phase. The incoming line (yellow) fails to snap to the bottom-right vertices of the existing edges (green). The red line is the result of the snap. [[Image(screen01.png)]] -- Ticket URL: PostGIS The PostGIS Trac is used for bug, enhancement & task tracking, a user and developer wiki, and a view into the subversion code repository of PostGIS project. From trac at osgeo.org Mon Mar 30 00:40:30 2026 From: trac at osgeo.org (PostGIS) Date: Mon, 30 Mar 2026 07:40:30 -0000 Subject: [PostGIS] #6062: More error XX000: SQL/MM Spatial exception - geometry In-Reply-To: <050.cc9979242e6c0270b720ad1663c50b41@osgeo.org> References: <050.cc9979242e6c0270b720ad1663c50b41@osgeo.org> Message-ID: <065.00f29e2a7e009c0a737ecd847deb5471@osgeo.org> #6062: More error XX000: SQL/MM Spatial exception - geometry --------------------------------+--------------------------- Reporter: Lars Aksel Opsahl | Owner: strk Type: defect | Status: new Priority: medium | Milestone: PostGIS 3.6.2 Component: topology | Version: 3.6.x Resolution: | Keywords: --------------------------------+--------------------------- Comment (by strk): The reason why snap to bottom-right edge isn't performed is because that lower-right edge was NOT within tolerance distance BEFORE the incoming edge was snapped to the vertex of the upper-left edge, but the current code doesn't go back to querying the database on next snapping iteration. The topology-oriented snap algorithm proposed in https://gitea.osgeo.org/postgis/postgis/pulls/184 did include a recursive database query. I'll see if that kind of snapping would fix this case. -- Ticket URL: PostGIS The PostGIS Trac is used for bug, enhancement & task tracking, a user and developer wiki, and a view into the subversion code repository of PostGIS project. From trac at osgeo.org Mon Mar 30 00:53:41 2026 From: trac at osgeo.org (PostGIS) Date: Mon, 30 Mar 2026 07:53:41 -0000 Subject: [PostGIS] #6062: More error XX000: SQL/MM Spatial exception - geometry In-Reply-To: <050.cc9979242e6c0270b720ad1663c50b41@osgeo.org> References: <050.cc9979242e6c0270b720ad1663c50b41@osgeo.org> Message-ID: <065.6dea6318dbaccdadaa852418a1f26ad1@osgeo.org> #6062: More error XX000: SQL/MM Spatial exception - geometry --------------------------------+--------------------------- Reporter: Lars Aksel Opsahl | Owner: strk Type: defect | Status: new Priority: medium | Milestone: PostGIS 3.6.2 Component: topology | Version: 3.6.x Resolution: | Keywords: --------------------------------+--------------------------- Changes (by strk): * Attachment "screen02.png" added. tpsnap result -- Ticket URL: PostGIS The PostGIS Trac is used for bug, enhancement & task tracking, a user and developer wiki, and a view into the subversion code repository of PostGIS project. From trac at osgeo.org Mon Mar 30 00:54:13 2026 From: trac at osgeo.org (PostGIS) Date: Mon, 30 Mar 2026 07:54:13 -0000 Subject: [PostGIS] #6062: More error XX000: SQL/MM Spatial exception - geometry In-Reply-To: <050.cc9979242e6c0270b720ad1663c50b41@osgeo.org> References: <050.cc9979242e6c0270b720ad1663c50b41@osgeo.org> Message-ID: <065.d603fde224099dccaad8fa9819790a61@osgeo.org> #6062: More error XX000: SQL/MM Spatial exception - geometry --------------------------------+--------------------------- Reporter: Lars Aksel Opsahl | Owner: strk Type: defect | Status: new Priority: medium | Milestone: PostGIS 3.6.2 Component: topology | Version: 3.6.x Resolution: | Keywords: --------------------------------+--------------------------- Comment (by strk): The tpsnap results look good to me: [[Image(screen02.png)]] -- Ticket URL: PostGIS The PostGIS Trac is used for bug, enhancement & task tracking, a user and developer wiki, and a view into the subversion code repository of PostGIS project. From trac at osgeo.org Mon Mar 30 01:04:30 2026 From: trac at osgeo.org (PostGIS) Date: Mon, 30 Mar 2026 08:04:30 -0000 Subject: [PostGIS] #6062: More error XX000: SQL/MM Spatial exception - geometry In-Reply-To: <050.cc9979242e6c0270b720ad1663c50b41@osgeo.org> References: <050.cc9979242e6c0270b720ad1663c50b41@osgeo.org> Message-ID: <065.412bf6e5f60ec2e0ca40aefde8516585@osgeo.org> #6062: More error XX000: SQL/MM Spatial exception - geometry --------------------------------+--------------------------- Reporter: Lars Aksel Opsahl | Owner: strk Type: defect | Status: new Priority: medium | Milestone: PostGIS 3.6.2 Component: topology | Version: 3.6.x Resolution: | Keywords: --------------------------------+--------------------------- Comment (by Lars Aksel Opsahl): Nice, Is the tpsnap code something that may be included in master or this that a to big change ? -- Ticket URL: PostGIS The PostGIS Trac is used for bug, enhancement & task tracking, a user and developer wiki, and a view into the subversion code repository of PostGIS project. From trac at osgeo.org Mon Mar 30 02:03:18 2026 From: trac at osgeo.org (PostGIS) Date: Mon, 30 Mar 2026 09:03:18 -0000 Subject: [PostGIS] #6062: More error XX000: SQL/MM Spatial exception - geometry In-Reply-To: <050.cc9979242e6c0270b720ad1663c50b41@osgeo.org> References: <050.cc9979242e6c0270b720ad1663c50b41@osgeo.org> Message-ID: <065.692e99cacad88e0f75eadcb137dbfe81@osgeo.org> #6062: More error XX000: SQL/MM Spatial exception - geometry --------------------------------+--------------------------- Reporter: Lars Aksel Opsahl | Owner: strk Type: defect | Status: new Priority: medium | Milestone: PostGIS 3.6.2 Component: topology | Version: 3.6.x Resolution: | Keywords: --------------------------------+--------------------------- Comment (by strk): On a closer look, the tpsnap branch doesn't really iteratively query the database, but it fetches the candidate target edges using the bounding box of the line to be snapped, so by luck it ends up (in this case) also fetching the bottom-right edge. It would not work if the further snaps would be outside the original line's bounding box (for example if the case was rotated so that the incoming line was horizontal). I guess this could be improved/fixed, which in turn could decrease performances. I confirm your original testcase completes with the enforced !TopoSnap call from within TopoGeo_addLinestring, completing in 18 minutes on my laptop. Would you be up to test the strk/lwt_tpsnap branch again your datasets, to see how performance is affected by the enforced !TopoSnap call ? -- Ticket URL: PostGIS The PostGIS Trac is used for bug, enhancement & task tracking, a user and developer wiki, and a view into the subversion code repository of PostGIS project. From trac at osgeo.org Mon Mar 30 02:18:48 2026 From: trac at osgeo.org (PostGIS) Date: Mon, 30 Mar 2026 09:18:48 -0000 Subject: [PostGIS] #6062: More error XX000: SQL/MM Spatial exception - geometry In-Reply-To: <050.cc9979242e6c0270b720ad1663c50b41@osgeo.org> References: <050.cc9979242e6c0270b720ad1663c50b41@osgeo.org> Message-ID: <065.883cadc27b9cc7521be00fefe1c2e694@osgeo.org> #6062: More error XX000: SQL/MM Spatial exception - geometry --------------------------------+--------------------------- Reporter: Lars Aksel Opsahl | Owner: strk Type: defect | Status: new Priority: medium | Milestone: PostGIS 3.6.2 Component: topology | Version: 3.6.x Resolution: | Keywords: --------------------------------+--------------------------- Comment (by Lars Aksel Opsahl): How many minutes before you get an error without strk/lwt_tpsnap ? -- Ticket URL: PostGIS The PostGIS Trac is used for bug, enhancement & task tracking, a user and developer wiki, and a view into the subversion code repository of PostGIS project. From trac at osgeo.org Mon Mar 30 03:56:55 2026 From: trac at osgeo.org (PostGIS) Date: Mon, 30 Mar 2026 10:56:55 -0000 Subject: [PostGIS] #6063: postgis_restore ignoring dchemaname when migrating database Message-ID: <050.ee3636c59d46f82690e15c2a5c3318e5@osgeo.org> #6063: postgis_restore ignoring dchemaname when migrating database -----------------------------+--------------------------- Reporter: robopost | Owner: strk Type: defect | Status: new Priority: medium | Milestone: PostGIS 3.5.6 Component: upgrade/hard | Version: 3.5.x Keywords: postgis_restore | -----------------------------+--------------------------- Hello, during a Migration from postgis 3.1 to 3.5 using the Script postgis_restore i found a strange behaviour: In our Database we had a Table named layer in a Schema that didn't belong to postgis. After the run of postgis_restore the Table didn't exist and the Import had errors when it tried load Data in this Table. In a verbose run i saw this: SKIP: TABLE layer Here postgis_restore seemed to ignore the Schema. Is it common practice not to use Tables named layer in a postgis enabled database or could this be a Bug? Yours sincerely Robert Aussem -- Ticket URL: PostGIS The PostGIS Trac is used for bug, enhancement & task tracking, a user and developer wiki, and a view into the subversion code repository of PostGIS project. From trac at osgeo.org Mon Mar 30 04:24:55 2026 From: trac at osgeo.org (PostGIS) Date: Mon, 30 Mar 2026 11:24:55 -0000 Subject: [PostGIS] #6062: More error XX000: SQL/MM Spatial exception - geometry In-Reply-To: <050.cc9979242e6c0270b720ad1663c50b41@osgeo.org> References: <050.cc9979242e6c0270b720ad1663c50b41@osgeo.org> Message-ID: <065.1df9f182d7a8596681768e23c6a80ce5@osgeo.org> #6062: More error XX000: SQL/MM Spatial exception - geometry --------------------------------+--------------------------- Reporter: Lars Aksel Opsahl | Owner: strk Type: defect | Status: new Priority: medium | Milestone: PostGIS 3.6.2 Component: topology | Version: 3.6.x Resolution: | Keywords: --------------------------------+--------------------------- Comment (by strk): Replying to [comment:7 Lars Aksel Opsahl]: > How many minutes before you get an error without strk/lwt_tpsnap ? 1m40s with the main branch, ending with: {{{ ERROR: SQL/MM Spatial exception - geometry crosses edge 5107 at POINT(5.97358081667813 58.6227425544318) ERROR: SQL/MM Spatial exception - geometry crosses edge 5107 at POINT(5.97358081667813 58.6227425544318) {17007} }}} -- Ticket URL: PostGIS The PostGIS Trac is used for bug, enhancement & task tracking, a user and developer wiki, and a view into the subversion code repository of PostGIS project. From trac at osgeo.org Mon Mar 30 04:35:48 2026 From: trac at osgeo.org (PostGIS) Date: Mon, 30 Mar 2026 11:35:48 -0000 Subject: [PostGIS] #6062: More error XX000: SQL/MM Spatial exception - geometry In-Reply-To: <050.cc9979242e6c0270b720ad1663c50b41@osgeo.org> References: <050.cc9979242e6c0270b720ad1663c50b41@osgeo.org> Message-ID: <065.941001036a5d01153beaa11732333129@osgeo.org> #6062: More error XX000: SQL/MM Spatial exception - geometry --------------------------------+--------------------------- Reporter: Lars Aksel Opsahl | Owner: strk Type: defect | Status: new Priority: medium | Milestone: PostGIS 3.6.2 Component: topology | Version: 3.6.x Resolution: | Keywords: --------------------------------+--------------------------- Comment (by Lars Aksel Opsahl): Thanks then your idea about adding a function that can fix input line related to current edges in the database and also leave it up the caller to do a retry on calling add linestring as better idea. -- Ticket URL: PostGIS The PostGIS Trac is used for bug, enhancement & task tracking, a user and developer wiki, and a view into the subversion code repository of PostGIS project. From trac at osgeo.org Mon Mar 30 06:11:09 2026 From: trac at osgeo.org (PostGIS) Date: Mon, 30 Mar 2026 13:11:09 -0000 Subject: [PostGIS] #6061: segmentation fault when loading geometries In-Reply-To: <055.668df5469379b563df5e0230250b6b98@osgeo.org> References: <055.668df5469379b563df5e0230250b6b98@osgeo.org> Message-ID: <070.466938eb63732a074933d98ec70dc6d6@osgeo.org> #6061: segmentation fault when loading geometries ----------------------------+--------------------------- Reporter: maxsynytsky1v | Owner: pramsey Type: defect | Status: new Priority: medium | Milestone: PostGIS 3.6.2 Component: postgis | Version: 3.6.x Resolution: | Keywords: ----------------------------+--------------------------- Comment (by maxsynytsky1v): Hi. Unfortunately I have run into an issue trying to send the email. It got bounced with the following error: {{{ Error Details Error: 550 5.0.350 One or more of the attachments in your email is of a file type that is NOT allowed by the recipient's organization. }}} Outlook client also has offered me to upload the attachment to the Sharepoint and send you the link instead. Will that work for you? -- Ticket URL: PostGIS The PostGIS Trac is used for bug, enhancement & task tracking, a user and developer wiki, and a view into the subversion code repository of PostGIS project. From trac at osgeo.org Mon Mar 30 09:00:14 2026 From: trac at osgeo.org (PostGIS) Date: Mon, 30 Mar 2026 16:00:14 -0000 Subject: [PostGIS] #6062: More error XX000: SQL/MM Spatial exception - geometry In-Reply-To: <050.cc9979242e6c0270b720ad1663c50b41@osgeo.org> References: <050.cc9979242e6c0270b720ad1663c50b41@osgeo.org> Message-ID: <065.a37aaa6558768cb645a944f7950d7b6b@osgeo.org> #6062: More error XX000: SQL/MM Spatial exception - geometry --------------------------------+--------------------------- Reporter: Lars Aksel Opsahl | Owner: strk Type: defect | Status: new Priority: medium | Milestone: PostGIS 3.6.2 Component: topology | Version: 3.6.x Resolution: | Keywords: --------------------------------+--------------------------- Comment (by strk): As a workaround note that re-trying with a larger (to include the second edge) or smaller (to not snap to the second vertex) tolerance fixes the original load. -- Ticket URL: PostGIS The PostGIS Trac is used for bug, enhancement & task tracking, a user and developer wiki, and a view into the subversion code repository of PostGIS project. From trac at osgeo.org Mon Mar 30 09:30:29 2026 From: trac at osgeo.org (PostGIS) Date: Mon, 30 Mar 2026 16:30:29 -0000 Subject: [PostGIS] #6062: More error XX000: SQL/MM Spatial exception - geometry In-Reply-To: <050.cc9979242e6c0270b720ad1663c50b41@osgeo.org> References: <050.cc9979242e6c0270b720ad1663c50b41@osgeo.org> Message-ID: <065.aefac56fbab1f5363bd8826d1e8332ab@osgeo.org> #6062: More error XX000: SQL/MM Spatial exception - geometry --------------------------------+--------------------------- Reporter: Lars Aksel Opsahl | Owner: strk Type: defect | Status: new Priority: medium | Milestone: PostGIS 3.6.2 Component: topology | Version: 3.6.x Resolution: | Keywords: --------------------------------+--------------------------- Comment (by strk): I've an heuristic fix for this case: we'd just include more candidate snap points in the operations. It fixes the original case and doesn't break any of the existing tests. The fix is in a 't6062-fix' branch -- Ticket URL: PostGIS The PostGIS Trac is used for bug, enhancement & task tracking, a user and developer wiki, and a view into the subversion code repository of PostGIS project. From trac at osgeo.org Mon Mar 30 09:44:29 2026 From: trac at osgeo.org (PostGIS) Date: Mon, 30 Mar 2026 16:44:29 -0000 Subject: [PostGIS] #6062: More error XX000: SQL/MM Spatial exception - geometry In-Reply-To: <050.cc9979242e6c0270b720ad1663c50b41@osgeo.org> References: <050.cc9979242e6c0270b720ad1663c50b41@osgeo.org> Message-ID: <065.3e3ea9050caf6c11a37ed510d0f25a01@osgeo.org> #6062: More error XX000: SQL/MM Spatial exception - geometry --------------------------------+--------------------------- Reporter: Lars Aksel Opsahl | Owner: strk Type: defect | Status: new Priority: medium | Milestone: PostGIS 3.6.2 Component: topology | Version: 3.6.x Resolution: | Keywords: --------------------------------+--------------------------- Comment (by Lars Aksel Opsahl): What effect does this have on the running time ? -- Ticket URL: PostGIS The PostGIS Trac is used for bug, enhancement & task tracking, a user and developer wiki, and a view into the subversion code repository of PostGIS project. From trac at osgeo.org Mon Mar 30 14:10:35 2026 From: trac at osgeo.org (PostGIS) Date: Mon, 30 Mar 2026 21:10:35 -0000 Subject: [PostGIS] #6063: postgis_restore ignoring dchemaname when migrating database In-Reply-To: <050.ee3636c59d46f82690e15c2a5c3318e5@osgeo.org> References: <050.ee3636c59d46f82690e15c2a5c3318e5@osgeo.org> Message-ID: <065.190ec438e6b37f98205b8672e8728798@osgeo.org> #6063: postgis_restore ignoring dchemaname when migrating database ---------------------------+----------------------------- Reporter: robopost | Owner: strk Type: defect | Status: closed Priority: medium | Milestone: PostGIS 3.5.6 Component: upgrade/hard | Version: 3.5.x Resolution: wontfix | Keywords: postgis_restore ---------------------------+----------------------------- Changes (by robe): * resolution: => wontfix * status: new => closed Comment: Were you migrating from an extension based install to another extension based install. If so no need to use postgis_restore. Just use pg_dump / pg_restore. postgis_restore was designed for non-extension based restores because those included postgis bits in the backup. extension based installs, never include postgis shipped bits in the backups except possibly for the data like whats in topology.layer. -- Ticket URL: PostGIS The PostGIS Trac is used for bug, enhancement & task tracking, a user and developer wiki, and a view into the subversion code repository of PostGIS project. From trac at osgeo.org Mon Mar 30 14:13:53 2026 From: trac at osgeo.org (PostGIS) Date: Mon, 30 Mar 2026 21:13:53 -0000 Subject: [PostGIS] #6061: segmentation fault when loading geometries In-Reply-To: <055.668df5469379b563df5e0230250b6b98@osgeo.org> References: <055.668df5469379b563df5e0230250b6b98@osgeo.org> Message-ID: <070.4441e7361b9ba18e7a62670956d47fdd@osgeo.org> #6061: segmentation fault when loading geometries ----------------------------+--------------------------- Reporter: maxsynytsky1v | Owner: pramsey Type: defect | Status: new Priority: medium | Milestone: PostGIS 3.6.2 Component: postgis | Version: 3.6.x Resolution: | Keywords: ----------------------------+--------------------------- Comment (by robe): Replying to [comment:5 maxsynytsky1v]: > Hi. > > Unfortunately I have run into an issue trying to send the email. > It got bounced with the following error: > > {{{ > Error Details > Error: 550 5.0.350 One or more of the attachments in your email is of a file type that is NOT allowed by the recipient's organization. > }}} > > Outlook client also has offered me to upload the attachment to the Sharepoint and send you the link instead. Will that work for you? What extension did you give it. Maybe change the extension to .txt. I know these things often for example flag .zip as bad. -- Ticket URL: PostGIS The PostGIS Trac is used for bug, enhancement & task tracking, a user and developer wiki, and a view into the subversion code repository of PostGIS project. From git at osgeo.org Mon Mar 30 20:39:14 2026 From: git at osgeo.org (git at osgeo.org) Date: Mon, 30 Mar 2026 20:39:14 -0700 (PDT) Subject: [SCM] PostGIS branch master updated. 3.6.0rc2-414-g5ee8a986d Message-ID: <20260331033914.D0792115E9A@trac.osgeo.org> 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 5ee8a986d13858a64efddb0aaffefdf89071e19a (commit) from dfc4c03e1e6b394bc1cb223852fdc13d0d7d85a3 (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 5ee8a986d13858a64efddb0aaffefdf89071e19a Author: Teramoto Ikuhiro Date: Tue Mar 31 03:02:41 2026 +0000 Translated PostGIS Manual using Weblate (Japanese) Currently translated at 99.7% (5529 of 5542 strings) Translation: postgis/PostGIS Manual Translate-URL: https://weblate.osgeo.org/projects/postgis/postgis-manual/ja/ diff --git a/doc/po/ja/postgis-manual.po b/doc/po/ja/postgis-manual.po index 106ef3af5..7eb89045d 100644 --- a/doc/po/ja/postgis-manual.po +++ b/doc/po/ja/postgis-manual.po @@ -10,7 +10,7 @@ msgstr "" "Project-Id-Version: postgis 3.5\n" "Report-Msgid-Bugs-To: https://bugs.kde.org\n" "POT-Creation-Date: 2025-11-13 16:23+0000\n" -"PO-Revision-Date: 2026-03-24 05:27+0000\n" +"PO-Revision-Date: 2026-03-31 03:39+0000\n" "Last-Translator: Teramoto Ikuhiro \n" "Language-Team: Japanese \n" @@ -1145,6 +1145,11 @@ msgid "" "(TIGER) database. If you want to experiment with PostGIS topology and " "need some data." msgstr "" +"?????????GIS?????????US Census Topologically " +"Integrated Geographic Encoding and Referencing System (TIGER)" +"????????????PostGIS???????????????????????" +"?????" #. Tag: para #, no-c-format @@ -2666,7 +2671,7 @@ msgstr "" #. Tag: para #, no-c-format msgid ", " -msgstr "" +msgstr ", " #. Tag: refpurpose #, no-c-format @@ -5688,6 +5693,13 @@ msgid "" "www.graphicsmagick.org/ and ImageMagick from https://imagemagick.org/ ." msgstr "" +"GraphicsMagick (gm convert)??????????????" +"?????GraphicsMagick????????ImageMagick (convert???magick convert)?????????????" +"????????GraphicsMagick? http://www.graphicsmagick.org/ ????" +"ImageMagick? https://" +"imagemagick.org/ ??????" #. Tag: title #, no-c-format @@ -6004,6 +6016,11 @@ msgid "" "raster_cheatsheet.html, " "postgis_cheatsheet.html" msgstr "" +"make cheatsheets???????HTML????????????" +"????????????????????????????????????" +"xsltproc??????doc?????? topology_cheatsheet.html?raster_cheatsheet.html? " +"postgis_cheatsheet.html?4????????????" #. Tag: para #, no-c-format ----------------------------------------------------------------------- Summary of changes: doc/po/ja/postgis-manual.po | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) hooks/post-receive -- PostGIS From git at osgeo.org Mon Mar 30 22:39:11 2026 From: git at osgeo.org (git at osgeo.org) Date: Mon, 30 Mar 2026 22:39:11 -0700 (PDT) Subject: [SCM] PostGIS branch master updated. 3.6.0rc2-415-gbdbc1535e Message-ID: <20260331053911.B5286116938@trac.osgeo.org> 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 bdbc1535eda9730a93f3a58edaef92fec49650d7 (commit) from 5ee8a986d13858a64efddb0aaffefdf89071e19a (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 bdbc1535eda9730a93f3a58edaef92fec49650d7 Author: Teramoto Ikuhiro Date: Tue Mar 31 05:14:22 2026 +0000 Translated PostGIS Manual using Weblate (Japanese) Currently translated at 99.8% (5534 of 5542 strings) Translation: postgis/PostGIS Manual Translate-URL: https://weblate.osgeo.org/projects/postgis/postgis-manual/ja/ diff --git a/doc/po/ja/postgis-manual.po b/doc/po/ja/postgis-manual.po index 7eb89045d..fb2963a81 100644 --- a/doc/po/ja/postgis-manual.po +++ b/doc/po/ja/postgis-manual.po @@ -10,7 +10,7 @@ msgstr "" "Project-Id-Version: postgis 3.5\n" "Report-Msgid-Bugs-To: https://bugs.kde.org\n" "POT-Creation-Date: 2025-11-13 16:23+0000\n" -"PO-Revision-Date: 2026-03-31 03:39+0000\n" +"PO-Revision-Date: 2026-03-31 05:39+0000\n" "Last-Translator: Teramoto Ikuhiro \n" "Language-Team: Japanese \n" @@ -2404,6 +2404,10 @@ msgid "" "This safeguards adjacent topological relationships by preventing precision " "snapping from removing primitives altogether." msgstr "" +"????????????gridSize??????????" +"??????????????????????????????????????" +"??????????????????????????????????????" +"???????" #. Tag: para #, no-c-format @@ -11391,7 +11395,7 @@ msgstr "" #. Tag: para #, no-c-format msgid "Availability: 3.7.0" -msgstr "" +msgstr "Availability: 3.7.0" #. Tag: para #, no-c-format @@ -11401,11 +11405,15 @@ msgid "" "linkend=\"ST_ClusterRelateWin\"/> can be clustered into three groups that " "connect only via their end points." msgstr "" +"?????????????????? ???????????????????" +"? ?????????????????" +"?????????????????" #. Tag: para #, no-c-format msgid "Connected and overlapping linestrings" -msgstr "" +msgstr "???????????????????????" #. Tag: para #, no-c-format @@ -11413,6 +11421,8 @@ msgid "" ", , " msgstr "" +", , " #. Tag: refpurpose #, no-c-format ----------------------------------------------------------------------- Summary of changes: doc/po/ja/postgis-manual.po | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) hooks/post-receive -- PostGIS From trac at osgeo.org Mon Mar 30 23:09:27 2026 From: trac at osgeo.org (PostGIS) Date: Tue, 31 Mar 2026 06:09:27 -0000 Subject: [PostGIS] #6062: More error XX000: SQL/MM Spatial exception - geometry In-Reply-To: <050.cc9979242e6c0270b720ad1663c50b41@osgeo.org> References: <050.cc9979242e6c0270b720ad1663c50b41@osgeo.org> Message-ID: <065.b7944184304795da5dea2d776f2105d5@osgeo.org> #6062: More error XX000: SQL/MM Spatial exception - geometry --------------------------------+--------------------------- Reporter: Lars Aksel Opsahl | Owner: strk Type: defect | Status: new Priority: medium | Milestone: PostGIS 3.6.2 Component: topology | Version: 3.6.x Resolution: | Keywords: --------------------------------+--------------------------- Comment (by Lars Aksel Opsahl): I?ve tested this with different tolerance values and it works in some areas but fails in others. On the master PostGIS we now have very few errors, and this week I switched to minimum tolerance, since that seems both more stable and faster. As you also pointed out, using a TopoSnap function is a much safer approach. The caller can decide when to trigger it, choose the parameters, and do retry to add line. This also lets me log problem geometries to a table, which makes it much easier to check the results afterwards and not cover up problem lines. -- Ticket URL: PostGIS The PostGIS Trac is used for bug, enhancement & task tracking, a user and developer wiki, and a view into the subversion code repository of PostGIS project. From trac at osgeo.org Tue Mar 31 00:53:33 2026 From: trac at osgeo.org (PostGIS) Date: Tue, 31 Mar 2026 07:53:33 -0000 Subject: [PostGIS] #6062: More error XX000: SQL/MM Spatial exception - geometry In-Reply-To: <050.cc9979242e6c0270b720ad1663c50b41@osgeo.org> References: <050.cc9979242e6c0270b720ad1663c50b41@osgeo.org> Message-ID: <065.4bf9f7451ef43b0d402a3ba363c6d95b@osgeo.org> #6062: More error XX000: SQL/MM Spatial exception - geometry --------------------------------+--------------------------- Reporter: Lars Aksel Opsahl | Owner: strk Type: defect | Status: new Priority: medium | Milestone: PostGIS 3.6.2 Component: topology | Version: 3.6.x Resolution: | Keywords: --------------------------------+--------------------------- Comment (by strk): Replying to [comment:12 Lars Aksel Opsahl]: > What effect does this have on the running time ? The code in t6062-fix branch in its current state has unnoticeable effects on performance. Your original testcase completes without errors in 1m41.194s on my machine -- Ticket URL: PostGIS The PostGIS Trac is used for bug, enhancement & task tracking, a user and developer wiki, and a view into the subversion code repository of PostGIS project. From trac at osgeo.org Tue Mar 31 00:58:52 2026 From: trac at osgeo.org (PostGIS) Date: Tue, 31 Mar 2026 07:58:52 -0000 Subject: [PostGIS] #6062: More error XX000: SQL/MM Spatial exception - geometry In-Reply-To: <050.cc9979242e6c0270b720ad1663c50b41@osgeo.org> References: <050.cc9979242e6c0270b720ad1663c50b41@osgeo.org> Message-ID: <065.ccb9922fdfbc96253ecdc6884e6fab26@osgeo.org> #6062: More error XX000: SQL/MM Spatial exception - geometry --------------------------------+--------------------------- Reporter: Lars Aksel Opsahl | Owner: strk Type: defect | Status: new Priority: medium | Milestone: PostGIS 3.6.2 Component: topology | Version: 3.6.x Resolution: | Keywords: --------------------------------+--------------------------- Comment (by strk): I confirm using "automatic" tolerance (NOT passing a precision to the topology and not passing a tolerance to the population functions) is faster, and also works: real 0m16.824s (16 seconds vs. 1 minute 41 seconds) -- Ticket URL: PostGIS The PostGIS Trac is used for bug, enhancement & task tracking, a user and developer wiki, and a view into the subversion code repository of PostGIS project. From trac at osgeo.org Tue Mar 31 01:39:57 2026 From: trac at osgeo.org (PostGIS) Date: Tue, 31 Mar 2026 08:39:57 -0000 Subject: [PostGIS] #6062: More error XX000: SQL/MM Spatial exception - geometry In-Reply-To: <050.cc9979242e6c0270b720ad1663c50b41@osgeo.org> References: <050.cc9979242e6c0270b720ad1663c50b41@osgeo.org> Message-ID: <065.c7e57eed872a8b927c9f6d19a1dbb394@osgeo.org> #6062: More error XX000: SQL/MM Spatial exception - geometry --------------------------------+--------------------------- Reporter: Lars Aksel Opsahl | Owner: strk Type: defect | Status: new Priority: medium | Milestone: PostGIS 3.6.2 Component: topology | Version: 3.6.x Resolution: | Keywords: --------------------------------+--------------------------- Comment (by strk): Interesting enough, removing recursive snapping also fixes the full testcase -- Ticket URL: PostGIS The PostGIS Trac is used for bug, enhancement & task tracking, a user and developer wiki, and a view into the subversion code repository of PostGIS project. From git at osgeo.org Tue Mar 31 03:24:50 2026 From: git at osgeo.org (git at osgeo.org) Date: Tue, 31 Mar 2026 03:24:50 -0700 (PDT) Subject: [SCM] PostGIS branch master updated. 3.6.0rc2-416-g7ec560627 Message-ID: <20260331102450.F2606117B17@trac.osgeo.org> 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 7ec5606274655a330c0cd831d9a2dce3bcb046a9 (commit) from bdbc1535eda9730a93f3a58edaef92fec49650d7 (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 7ec5606274655a330c0cd831d9a2dce3bcb046a9 Author: Sandro Santilli Date: Tue Mar 31 11:52:59 2026 +0200 Simplify tests for #3412 and #3838 diff --git a/topology/test/regress/topogeo_addlinestring.sql b/topology/test/regress/topogeo_addlinestring.sql index c7ba53e90..2c1382048 100644 --- a/topology/test/regress/topogeo_addlinestring.sql +++ b/topology/test/regress/topogeo_addlinestring.sql @@ -326,16 +326,12 @@ SELECT 't3412.L1', TopoGeo_AddLinestring('bug3412', 599671.37 4889781.87 )' ::geometry); - --- TODO: answers different on 3.8 from older geos so revised test -/**SELECT 't3412.L2', TopoGeo_AddLinestring('bug3412', -'0102000000020000003AB42BBFEE4C22410010C5A997A6524167BB5DBDEE4C224117FE3DA85FA75241' -::geometry);**/ -SELECT 't3412.L2', COUNT(*) +SELECT 't3412.L2', COUNT(*) > 0 FROM TopoGeo_AddLinestring('bug3412', '0102000000020000003AB42BBFEE4C22410010C5A997A6524167BB5DBDEE4C224117FE3DA85FA75241' ::geometry); -SELECT 't3412.end', DropTopology('bug3412'); +SELECT 't3412.end.error', * FROM topology.ValidateTopology('bug3412'); +SELECT NULL FROM DropTopology('bug3412'); -- See http://trac.osgeo.org/postgis/ticket/3711 SELECT 't3371.start', topology.CreateTopology('bug3711', 0, 0, true) > 1; @@ -358,16 +354,12 @@ SELECT 't3838.L1', topology.TopoGeo_addLinestring('bug3838', 622598.73 6554996.23, 622591.53 6554995.96)' ::geometry , 1); --- TODO: answers in geos 3.8 different from older geos --- So just doing count instead of full test -/** SELECT 't3838.L2', topology.TopoGeo_addLinestring('bug3838', -'LINESTRING(622608 6554988, 622596 6554984)' -::geometry , 10);**/ -SELECT 't3838.L2', COUNT(*) +SELECT 't3838.L2', COUNT(*) > 0 FROM topology.TopoGeo_addLinestring('bug3838', 'LINESTRING(622608 6554988, 622596 6554984)' ::geometry , 10); -SELECT 't3838.end', topology.DropTopology('bug3838'); +SELECT 't3838.end.error', * FROM topology.ValidateTopology('bug3838'); +SELECT NULL FROM topology.DropTopology('bug3838'); -- See https://trac.osgeo.org/postgis/ticket/1855 -- Simplified case 1 diff --git a/topology/test/regress/topogeo_addlinestring_expected b/topology/test/regress/topogeo_addlinestring_expected index f80416f71..a9b3785f3 100644 --- a/topology/test/regress/topogeo_addlinestring_expected +++ b/topology/test/regress/topogeo_addlinestring_expected @@ -187,16 +187,14 @@ t3402.L2|3 t3402.end|Topology 'bug3402' dropped t3412.start|t t3412.L1|1 -t3412.L2|4 -t3412.end|Topology 'bug3412' dropped +t3412.L2|t t3371.start|t t3371.L1|1 t3371.L2|2 t3371.end|Topology 'bug3711' dropped t3838.start|t t3838.L1|1 -t3838.L2|6 -t3838.end|Topology 'bug3838' dropped +t3838.L2|t t1855_1.start|t t1855_1.0|1 t1855_1.end|Topology 'bug1855' dropped ----------------------------------------------------------------------- Summary of changes: topology/test/regress/topogeo_addlinestring.sql | 20 ++++++-------------- topology/test/regress/topogeo_addlinestring_expected | 6 ++---- 2 files changed, 8 insertions(+), 18 deletions(-) hooks/post-receive -- PostGIS From trac at osgeo.org Tue Mar 31 03:27:22 2026 From: trac at osgeo.org (PostGIS) Date: Tue, 31 Mar 2026 10:27:22 -0000 Subject: [PostGIS] #6062: More error XX000: SQL/MM Spatial exception - geometry In-Reply-To: <050.cc9979242e6c0270b720ad1663c50b41@osgeo.org> References: <050.cc9979242e6c0270b720ad1663c50b41@osgeo.org> Message-ID: <065.30e6650677f19ea4e06c43d27ae1794b@osgeo.org> #6062: More error XX000: SQL/MM Spatial exception - geometry --------------------------------+--------------------------- Reporter: Lars Aksel Opsahl | Owner: strk Type: defect | Status: new Priority: medium | Milestone: PostGIS 3.6.2 Component: topology | Version: 3.6.x Resolution: | Keywords: --------------------------------+--------------------------- Comment (by strk): I've now made the `t6062-fix` branch drop the recursive snapping, so that the unnoticeable performance difference should be favorable, if at all. -- Ticket URL: PostGIS The PostGIS Trac is used for bug, enhancement & task tracking, a user and developer wiki, and a view into the subversion code repository of PostGIS project. From trac at osgeo.org Tue Mar 31 03:38:15 2026 From: trac at osgeo.org (PostGIS) Date: Tue, 31 Mar 2026 10:38:15 -0000 Subject: [PostGIS] #6063: postgis_restore ignoring dchemaname when migrating database In-Reply-To: <050.ee3636c59d46f82690e15c2a5c3318e5@osgeo.org> References: <050.ee3636c59d46f82690e15c2a5c3318e5@osgeo.org> Message-ID: <065.7a6074cb0aba7e7d08b04e41713d89b6@osgeo.org> #6063: postgis_restore ignoring dchemaname when migrating database ---------------------------+----------------------------- Reporter: robopost | Owner: strk Type: defect | Status: reopened Priority: medium | Milestone: PostGIS 3.5.6 Component: upgrade/hard | Version: 3.5.x Resolution: | Keywords: postgis_restore ---------------------------+----------------------------- Changes (by strk): * resolution: wontfix => * status: closed => reopened Comment: It's still a bug if you're not using the extension based install, so re- opening. Component is properly set to upgrade/hard so I assume this is the case here. -- Ticket URL: PostGIS The PostGIS Trac is used for bug, enhancement & task tracking, a user and developer wiki, and a view into the subversion code repository of PostGIS project. From git at osgeo.org Tue Mar 31 03:39:11 2026 From: git at osgeo.org (git at osgeo.org) Date: Tue, 31 Mar 2026 03:39:11 -0700 (PDT) Subject: [SCM] PostGIS branch master updated. 3.6.0rc2-417-g67ff872e2 Message-ID: <20260331103912.2CA0B117FC2@trac.osgeo.org> 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 67ff872e2d4b8b46e6d412dae592e89480fc668c (commit) from 7ec5606274655a330c0cd831d9a2dce3bcb046a9 (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 67ff872e2d4b8b46e6d412dae592e89480fc668c Author: Teramoto Ikuhiro Date: Tue Mar 31 09:30:00 2026 +0000 Translated PostGIS Manual using Weblate (Japanese) Currently translated at 99.9% (5538 of 5542 strings) Translation: postgis/PostGIS Manual Translate-URL: https://weblate.osgeo.org/projects/postgis/postgis-manual/ja/ diff --git a/doc/po/ja/postgis-manual.po b/doc/po/ja/postgis-manual.po index fb2963a81..8bba9f185 100644 --- a/doc/po/ja/postgis-manual.po +++ b/doc/po/ja/postgis-manual.po @@ -10,7 +10,7 @@ msgstr "" "Project-Id-Version: postgis 3.5\n" "Report-Msgid-Bugs-To: https://bugs.kde.org\n" "POT-Creation-Date: 2025-11-13 16:23+0000\n" -"PO-Revision-Date: 2026-03-31 05:39+0000\n" +"PO-Revision-Date: 2026-03-31 10:39+0000\n" "Last-Translator: Teramoto Ikuhiro \n" "Language-Team: Japanese \n" @@ -6581,6 +6581,8 @@ msgid "" "documentation, alignment of PostGIS with PostgreSQL releases, X3D support, " "management functions." msgstr "" +"CI??????????????Windows?????????????????" +"PostGIS?PostgreSQL?????????X3D????????" #. Tag: term #, no-c-format @@ -11381,6 +11383,9 @@ msgid "" "clustering input geometries into connected sets using the relate pattern to " "determine whether the geometries are connected." msgstr "" +"???????????????????????????????????" +"??????????????????????????????????????" +"?????????????" #. Tag: para #, no-c-format @@ -11391,6 +11396,11 @@ msgid "" "possible to build a cluster of all objects that touch at boundaries, but " "exclude those that merely overlap." msgstr "" +"???????????????????????????????????" +"??????????????????????DE9IM??????????????" +"??????????????????????????????????????" +"??????????????????????????????????????" +"?????" #. Tag: para #, no-c-format @@ -40362,6 +40372,14 @@ msgid "" "tries to upgrade extensions postgis, postgis_raster, postgis_sfcgal, and " "postgis_topology." msgstr "" +"??????????????????????PostGIS?????????" +"?????????????????????????????????????" +"??????????????????????????????????????" +"?????PostGIS??????????????????????????????" +"???????PostGIS????????????????CREATE EXTENSION .. " +"FROM unpackaged???ALTER EXTENSION .. UPDATE???????????postgis, " +"postgis_raster, postgis_sfcgal, postgis_topology?????????????" +"???????????????" #. Tag: para #, no-c-format ----------------------------------------------------------------------- Summary of changes: doc/po/ja/postgis-manual.po | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) hooks/post-receive -- PostGIS From trac at osgeo.org Tue Mar 31 06:39:13 2026 From: trac at osgeo.org (PostGIS) Date: Tue, 31 Mar 2026 13:39:13 -0000 Subject: [PostGIS] #6061: segmentation fault when loading geometries In-Reply-To: <055.668df5469379b563df5e0230250b6b98@osgeo.org> References: <055.668df5469379b563df5e0230250b6b98@osgeo.org> Message-ID: <070.dfc99926a7a9129b57ec33071584f02a@osgeo.org> #6061: segmentation fault when loading geometries ----------------------------+--------------------------- Reporter: maxsynytsky1v | Owner: pramsey Type: defect | Status: new Priority: medium | Milestone: PostGIS 3.6.2 Component: postgis | Version: 3.6.x Resolution: | Keywords: ----------------------------+--------------------------- Comment (by maxsynytsky1v): sql.xz originally and retried today with just txt but it is still undeliverable and the error is the same. -- Ticket URL: PostGIS The PostGIS Trac is used for bug, enhancement & task tracking, a user and developer wiki, and a view into the subversion code repository of PostGIS project. From git at osgeo.org Tue Mar 31 14:16:30 2026 From: git at osgeo.org (git at osgeo.org) Date: Tue, 31 Mar 2026 14:16:30 -0700 (PDT) Subject: [SCM] PostGIS branch master updated. 3.6.0rc2-418-gdc09e5a11 Message-ID: <20260331211630.B5BE6136600@trac.osgeo.org> 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 dc09e5a11d71b0bebf763750b53036276778afa0 (commit) from 67ff872e2d4b8b46e6d412dae592e89480fc668c (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 dc09e5a11d71b0bebf763750b53036276778afa0 Author: Paul Ramsey Date: Tue Mar 31 14:07:27 2026 -0700 Ensure that functions called in upgrade script are fully qualified diff --git a/postgis/postgis.sql.in b/postgis/postgis.sql.in index 8c85013ab..e378a453d 100644 --- a/postgis/postgis.sql.in +++ b/postgis/postgis.sql.in @@ -3312,7 +3312,7 @@ BEGIN END; BEGIN - SELECT postgis_raster_scripts_installed() INTO rast_scr_ver; + SELECT @extschema at .postgis_raster_scripts_installed() INTO rast_scr_ver; EXCEPTION WHEN undefined_function THEN RAISE DEBUG 'Function postgis_raster_scripts_installed() not found. Is raster support enabled and rtpostgis.sql installed?'; @@ -3358,9 +3358,9 @@ BEGIN IF geosver IS NOT NULL THEN fullver = fullver || ' GEOS="' || geosver || '"'; - IF (string_to_array(geosver, '.'))[1:2] != (string_to_array(geosver_compiled, '.'))[1:2] + IF (pg_catalog.string_to_array(geosver, '.'))[1:2] != (pg_catalog.string_to_array(geosver_compiled, '.'))[1:2] THEN - fullver = format('%s (compiled against GEOS %s)', fullver, geosver_compiled); + fullver = pg_catalog.format('%s (compiled against GEOS %s)', fullver, geosver_compiled); END IF; END IF; @@ -3370,9 +3370,9 @@ BEGIN IF projver IS NOT NULL THEN fullver = fullver || ' PROJ="' || projver || '"'; - IF (string_to_array(projver, '.'))[1:3] != (string_to_array(projver_compiled, '.'))[1:3] + IF (pg_catalog.string_to_array(projver, '.'))[1:3] != (pg_catalog.string_to_array(projver_compiled, '.'))[1:3] THEN - fullver = format('%s (compiled against PROJ %s)', fullver, projver_compiled); + fullver = pg_catalog.format('%s (compiled against PROJ %s)', fullver, projver_compiled); END IF; END IF; ----------------------------------------------------------------------- Summary of changes: postgis/postgis.sql.in | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) hooks/post-receive -- PostGIS From git at osgeo.org Tue Mar 31 14:16:59 2026 From: git at osgeo.org (git at osgeo.org) Date: Tue, 31 Mar 2026 14:16:59 -0700 (PDT) Subject: [SCM] PostGIS branch stable-3.6 updated. 3.6.2-12-gb25865df6 Message-ID: <20260331211659.D4808136C5C@trac.osgeo.org> 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.6 has been updated via b25865df6950e117a859324e9d570de4b2292df6 (commit) from daf6a4fd267c0ba50598de359789ef7296dc1c1d (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 b25865df6950e117a859324e9d570de4b2292df6 Author: Paul Ramsey Date: Tue Mar 31 14:07:27 2026 -0700 Ensure that functions called in upgrade script are fully qualified diff --git a/postgis/postgis.sql.in b/postgis/postgis.sql.in index 1df639e7c..710c24e42 100644 --- a/postgis/postgis.sql.in +++ b/postgis/postgis.sql.in @@ -3274,7 +3274,7 @@ BEGIN END; BEGIN - SELECT postgis_raster_scripts_installed() INTO rast_scr_ver; + SELECT @extschema at .postgis_raster_scripts_installed() INTO rast_scr_ver; EXCEPTION WHEN undefined_function THEN RAISE DEBUG 'Function postgis_raster_scripts_installed() not found. Is raster support enabled and rtpostgis.sql installed?'; @@ -3320,9 +3320,9 @@ BEGIN IF geosver IS NOT NULL THEN fullver = fullver || ' GEOS="' || geosver || '"'; - IF (string_to_array(geosver, '.'))[1:2] != (string_to_array(geosver_compiled, '.'))[1:2] + IF (pg_catalog.string_to_array(geosver, '.'))[1:2] != (pg_catalog.string_to_array(geosver_compiled, '.'))[1:2] THEN - fullver = format('%s (compiled against GEOS %s)', fullver, geosver_compiled); + fullver = pg_catalog.format('%s (compiled against GEOS %s)', fullver, geosver_compiled); END IF; END IF; @@ -3332,9 +3332,9 @@ BEGIN IF projver IS NOT NULL THEN fullver = fullver || ' PROJ="' || projver || '"'; - IF (string_to_array(projver, '.'))[1:3] != (string_to_array(projver_compiled, '.'))[1:3] + IF (pg_catalog.string_to_array(projver, '.'))[1:3] != (pg_catalog.string_to_array(projver_compiled, '.'))[1:3] THEN - fullver = format('%s (compiled against PROJ %s)', fullver, projver_compiled); + fullver = pg_catalog.format('%s (compiled against PROJ %s)', fullver, projver_compiled); END IF; END IF; ----------------------------------------------------------------------- Summary of changes: postgis/postgis.sql.in | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) hooks/post-receive -- PostGIS From git at osgeo.org Tue Mar 31 14:17:15 2026 From: git at osgeo.org (git at osgeo.org) Date: Tue, 31 Mar 2026 14:17:15 -0700 (PDT) Subject: [SCM] PostGIS branch stable-3.5 updated. 3.5.5-11-gcb5334b7c Message-ID: <20260331211715.917EE1368B2@trac.osgeo.org> 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.5 has been updated via cb5334b7c736f9edc1e6e124d4688300111ab397 (commit) from 6eed59846d005a297a0986a5aa20a1d108bfe231 (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 cb5334b7c736f9edc1e6e124d4688300111ab397 Author: Paul Ramsey Date: Tue Mar 31 14:07:27 2026 -0700 Ensure that functions called in upgrade script are fully qualified diff --git a/postgis/postgis.sql.in b/postgis/postgis.sql.in index f210096a8..5041271f4 100644 --- a/postgis/postgis.sql.in +++ b/postgis/postgis.sql.in @@ -3274,7 +3274,7 @@ BEGIN END; BEGIN - SELECT postgis_raster_scripts_installed() INTO rast_scr_ver; + SELECT @extschema at .postgis_raster_scripts_installed() INTO rast_scr_ver; EXCEPTION WHEN undefined_function THEN RAISE DEBUG 'Function postgis_raster_scripts_installed() not found. Is raster support enabled and rtpostgis.sql installed?'; @@ -3320,9 +3320,9 @@ BEGIN IF geosver IS NOT NULL THEN fullver = fullver || ' GEOS="' || geosver || '"'; - IF (string_to_array(geosver, '.'))[1:2] != (string_to_array(geosver_compiled, '.'))[1:2] + IF (pg_catalog.string_to_array(geosver, '.'))[1:2] != (pg_catalog.string_to_array(geosver_compiled, '.'))[1:2] THEN - fullver = format('%s (compiled against GEOS %s)', fullver, geosver_compiled); + fullver = pg_catalog.format('%s (compiled against GEOS %s)', fullver, geosver_compiled); END IF; END IF; @@ -3332,9 +3332,9 @@ BEGIN IF projver IS NOT NULL THEN fullver = fullver || ' PROJ="' || projver || '"'; - IF (string_to_array(projver, '.'))[1:3] != (string_to_array(projver_compiled, '.'))[1:3] + IF (pg_catalog.string_to_array(projver, '.'))[1:3] != (pg_catalog.string_to_array(projver_compiled, '.'))[1:3] THEN - fullver = format('%s (compiled against PROJ %s)', fullver, projver_compiled); + fullver = pg_catalog.format('%s (compiled against PROJ %s)', fullver, projver_compiled); END IF; END IF; ----------------------------------------------------------------------- Summary of changes: postgis/postgis.sql.in | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) hooks/post-receive -- PostGIS From git at osgeo.org Tue Mar 31 14:20:31 2026 From: git at osgeo.org (git at osgeo.org) Date: Tue, 31 Mar 2026 14:20:31 -0700 (PDT) Subject: [SCM] PostGIS branch stable-3.4 updated. 3.4.5-13-g9441c6b61 Message-ID: <20260331212031.697BD136744@trac.osgeo.org> 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.4 has been updated via 9441c6b61df7799408119c3f2c912740a80405d6 (commit) from 082500dfb81518dd16746e34fba4c2ca81d4bac4 (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 9441c6b61df7799408119c3f2c912740a80405d6 Author: Paul Ramsey Date: Tue Mar 31 14:20:25 2026 -0700 Ensure that functions called in upgrade script are fully qualified diff --git a/postgis/postgis.sql.in b/postgis/postgis.sql.in index 27656e07c..142421860 100644 --- a/postgis/postgis.sql.in +++ b/postgis/postgis.sql.in @@ -3301,7 +3301,7 @@ BEGIN END; BEGIN - SELECT postgis_raster_scripts_installed() INTO rast_scr_ver; + SELECT @extschema at .postgis_raster_scripts_installed() INTO rast_scr_ver; EXCEPTION WHEN undefined_function THEN RAISE DEBUG 'Function postgis_raster_scripts_installed() not found. Is raster support enabled and rtpostgis.sql installed?'; @@ -3347,9 +3347,9 @@ BEGIN IF geosver IS NOT NULL THEN fullver = fullver || ' GEOS="' || geosver || '"'; - IF (string_to_array(geosver, '.'))[1:2] != (string_to_array(geosver_compiled, '.'))[1:2] + IF (pg_catalog.string_to_array(geosver, '.'))[1:2] != (pg_catalog.string_to_array(geosver_compiled, '.'))[1:2] THEN - fullver = format('%s (compiled against GEOS %s)', fullver, geosver_compiled); + fullver = pg_catalog.format('%s (compiled against GEOS %s)', fullver, geosver_compiled); END IF; END IF; ----------------------------------------------------------------------- Summary of changes: postgis/postgis.sql.in | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) hooks/post-receive -- PostGIS From git at osgeo.org Tue Mar 31 14:22:43 2026 From: git at osgeo.org (git at osgeo.org) Date: Tue, 31 Mar 2026 14:22:43 -0700 (PDT) Subject: [SCM] PostGIS branch stable-3.3 updated. 3.3.9-11-g9abdb5153 Message-ID: <20260331212243.33BDA136649@trac.osgeo.org> 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.3 has been updated via 9abdb5153690679b44cced668ba32c9cba833dc5 (commit) from f47c0154ed450c0d4c30f91daa9c8797d0f94c35 (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 9abdb5153690679b44cced668ba32c9cba833dc5 Author: Paul Ramsey Date: Tue Mar 31 14:22:38 2026 -0700 Ensure that functions called in upgrade script are fully qualified diff --git a/postgis/postgis.sql.in b/postgis/postgis.sql.in index ecde392fd..815f13c63 100644 --- a/postgis/postgis.sql.in +++ b/postgis/postgis.sql.in @@ -3156,7 +3156,7 @@ BEGIN END; BEGIN - SELECT postgis_raster_scripts_installed() INTO rast_scr_ver; + SELECT @extschema at .postgis_raster_scripts_installed() INTO rast_scr_ver; EXCEPTION WHEN undefined_function THEN RAISE DEBUG 'Function postgis_raster_scripts_installed() not found. Is raster support enabled and rtpostgis.sql installed?'; ----------------------------------------------------------------------- Summary of changes: postgis/postgis.sql.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) hooks/post-receive -- PostGIS From git at osgeo.org Tue Mar 31 14:59:04 2026 From: git at osgeo.org (git at osgeo.org) Date: Tue, 31 Mar 2026 14:59:04 -0700 (PDT) Subject: [SCM] PostGIS branch master updated. 3.6.0rc2-419-ga7c7a8378 Message-ID: <20260331215904.B1823136B40@trac.osgeo.org> 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 a7c7a837809bbed24ca7d5a474411ef784f555ee (commit) from dc09e5a11d71b0bebf763750b53036276778afa0 (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 a7c7a837809bbed24ca7d5a474411ef784f555ee Author: Paul Ramsey Date: Tue Mar 31 14:58:28 2026 -0700 Avoid build issue on PG19 diff --git a/postgis/gserialized_typmod.c b/postgis/gserialized_typmod.c index bee14bd15..8e5f63b56 100644 --- a/postgis/gserialized_typmod.c +++ b/postgis/gserialized_typmod.c @@ -32,6 +32,7 @@ #include #include #include +#include #include "utils/elog.h" #include "utils/array.h" ----------------------------------------------------------------------- Summary of changes: postgis/gserialized_typmod.c | 1 + 1 file changed, 1 insertion(+) hooks/post-receive -- PostGIS From git at osgeo.org Tue Mar 31 15:38:56 2026 From: git at osgeo.org (git at osgeo.org) Date: Tue, 31 Mar 2026 15:38:56 -0700 (PDT) Subject: [SCM] PostGIS branch master updated. 3.6.0rc2-420-gf92f80d77 Message-ID: <20260331223856.E1CA81371FA@trac.osgeo.org> 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 f92f80d776d2d8eb88b2c8f67908b69b2922251c (commit) from a7c7a837809bbed24ca7d5a474411ef784f555ee (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 f92f80d776d2d8eb88b2c8f67908b69b2922251c Author: Paul Ramsey Date: Tue Mar 31 15:36:29 2026 -0700 Add Window function ST_MinimumSpanningTree(geometry) Takes in SetOf LineString, builds a graph with start/end points as nodes, finds the MST for each connected graph, and returns an integer for each LineString, with a non-zero value indicating participation in the MST, and those numbers being distinct for each connected graph. diff --git a/doc/reference_cluster.xml b/doc/reference_cluster.xml index dfe7e90eb..e86b917a8 100644 --- a/doc/reference_cluster.xml +++ b/doc/reference_cluster.xml @@ -363,6 +363,68 @@ FROM clusterrelate; + + + ST_MinimumSpanningTree + + Window function that returns a tree id for each input geometry, clustering input geometries into connected trees using the Minimum Spanning Tree algorithm. + + + + + + integer ST_MinimumSpanningTree + geometry winset geom + + + + + + Description + + A window function that builds connected graphs of line strings based on the Minimum Spanning Tree (MST) of the input geometries. The return value is the cluster number that the geometry argument participates in, or zero if it is not part of the minimum tree. + The Minimum Spanning Tree connects all geometries in the window partition such that the total length of the connecting lines is minimized. If the graph is not fully connected (e.g. infinite distance between some geometries), it produces a Minimum Spanning Forest, and each connected component is assigned a unique tree ID. + + Availability: 3.7.0 + Requires GEOS >= 3.15.0 + + + + Examples + +SELECT id, ST_AsText(geom), ST_MinimumSpanningTree(geom) OVER () AS msp + FROM (VALUES + (1, 'LINESTRING(0 0,1 0)'::geometry), + (2, 'LINESTRING(0 0,0 1)'::geometry), + (3, 'LINESTRING(1 1,0 1)'::geometry), + (4, 'LINESTRING(1 1,1 0)'::geometry), + (5, 'LINESTRING(0 0,1 1)'::geometry), + (6, 'LINESTRING(1 0,0 1)'::geometry) +) AS t(id, geom); + + + id | st_astext | msp +----+---------------------+----- + 1 | LINESTRING(0 0,1 0) | 1 + 2 | LINESTRING(0 0,0 1) | 1 + 3 | LINESTRING(1 1,0 1) | 1 + 4 | LINESTRING(1 1,1 0) | 0 + 5 | LINESTRING(0 0,1 1) | 0 + 6 | LINESTRING(1 0,0 1) | 0 + + + + See Also + + , + , + + + + + + + diff --git a/postgis/lwgeom_window.c b/postgis/lwgeom_window.c index 920f2716d..2870527fe 100644 --- a/postgis/lwgeom_window.c +++ b/postgis/lwgeom_window.c @@ -1037,3 +1037,93 @@ Datum ST_CoverageUnion(PG_FUNCTION_ARGS) PG_RETURN_POINTER(result); } + +extern Datum ST_MinimumSpanningTree(PG_FUNCTION_ARGS); +PG_FUNCTION_INFO_V1(ST_MinimumSpanningTree); +Datum ST_MinimumSpanningTree(PG_FUNCTION_ARGS) +{ +#if POSTGIS_GEOS_VERSION < 31500 + lwpgerror("The GEOS version this PostGIS binary " + "was compiled against (%d) doesn't support " + "'ST_MinimumSpanningTree' function (3.15.0+ required)", + POSTGIS_GEOS_VERSION); + PG_RETURN_NULL(); +#else + + WindowObject win_obj = PG_WINDOW_OBJECT(); + uint32_t row = WinGetCurrentPosition(win_obj); + uint32_t ngeoms = WinGetPartitionRowCount(win_obj); + cluster_context* context = fetch_cluster_context(win_obj, ngeoms); + + if (row == 0) /* beginning of the partition; do all of the work now */ + { + uint32_t i; + GEOSGeometry** geoms = palloc(ngeoms * sizeof(GEOSGeometry*)); + size_t* cluster_ids; + + context->is_error = LW_TRUE; /* until proven otherwise */ + + initGEOS(lwpgnotice, lwgeom_geos_error); + + for (i = 0; i < ngeoms; i++) + { + bool geom_is_null; + geoms[i] = read_geos_from_partition(win_obj, i, &geom_is_null); + + if (!geoms[i]) + { + lwpgerror("Error reading geometry."); + PG_RETURN_NULL(); + } + + context->clusters[i].is_null = geom_is_null; + /* If read_geos_from_partition returned a value (even empty) for a + non-null input, we keep it. If it was null, is_null is true. */ + } + + /* Call GEOS */ + /* Note: GEOSMinimumSpanningTree signature assumed: + size_t* GEOSMinimumSpanningTree(GEOSGeometry* const* geoms, size_t ngeoms); + */ + cluster_ids = GEOSMinimumSpanningTree(geoms, ngeoms); + + if (cluster_ids) + { + context->is_error = LW_FALSE; + for (i = 0; i < ngeoms; i++) + { + context->clusters[i].cluster_id = (uint32_t)cluster_ids[i]; + } + /* Release the array returned by GEOS */ + GEOSFree(cluster_ids); + } + else + { + /* Usually GEOS functions return NULL on error, but also check for context error */ + /* However, if ngeoms is 0, it might return NULL but that's handled by loop */ + /* If GEOS failed, we error out */ + if (ngeoms > 0) + lwpgerror("GEOSMinimumSpanningTree failed"); + else + context->is_error = LW_FALSE; /* Empty set is fine */ + } + + for (i = 0; i < ngeoms; i++) + { + if (geoms[i]) GEOSGeom_destroy(geoms[i]); + } + pfree(geoms); + + if (context->is_error) + { + lwpgerror("Error during MST clustering"); + PG_RETURN_NULL(); + } + } + + if (context->clusters[row].is_null) + PG_RETURN_NULL(); + + PG_RETURN_INT32(context->clusters[row].cluster_id); +#endif +} diff --git a/postgis/postgis.sql.in b/postgis/postgis.sql.in index e378a453d..41a7ee22a 100644 --- a/postgis/postgis.sql.in +++ b/postgis/postgis.sql.in @@ -1948,6 +1948,13 @@ CREATE OR REPLACE FUNCTION ST_ClusterRelateWin(geom geometry, relate_matrix text LANGUAGE 'c' IMMUTABLE STRICT WINDOW PARALLEL SAFE _COST_HIGH; +-- Availability: 3.7.0 +CREATE OR REPLACE FUNCTION ST_MinimumSpanningTree(geometry) + RETURNS int + AS 'MODULE_PATHNAME', 'ST_MinimumSpanningTree' + LANGUAGE 'c' IMMUTABLE STRICT WINDOW PARALLEL SAFE + _COST_HIGH; + -- Availability: 1.2.2 CREATE OR REPLACE FUNCTION ST_LineMerge(geometry) RETURNS geometry diff --git a/regress/core/spanningtree.sql b/regress/core/spanningtree.sql new file mode 100644 index 000000000..063c18855 --- /dev/null +++ b/regress/core/spanningtree.sql @@ -0,0 +1,42 @@ + +-- Connected graph (all one cluster) +SELECT 'connected', id, ST_MinimumSpanningTree(geom) OVER (ORDER BY id) FROM (VALUES + (1, 'LINESTRING(0 0,1 0)'::geometry), + (2, 'LINESTRING(0 0,0 1)'::geometry), + (3, 'LINESTRING(1 1,0 1)'::geometry), + (4, 'LINESTRING(1 1,1 0)'::geometry), + (5, 'LINESTRING(0 0,1 1)'::geometry), + (6, 'LINESTRING(1 0,0 1)'::geometry) +) AS t(id, geom); + +-- Disconnected graph (two clusters) +SELECT 'disconnected', id, ST_MinimumSpanningTree(geom) OVER (ORDER BY id) FROM (VALUES + (1, 'LINESTRING(0 0,1 0)'::geometry), + (2, 'LINESTRING(0 0,0 1)'::geometry), + (3, 'LINESTRING(1 1,0 1)'::geometry), + (4, 'LINESTRING(11 11,11 10)'::geometry), + (5, 'LINESTRING(10 10,11 11)'::geometry), + (6, 'LINESTRING(11 10,10 11)'::geometry) +) AS t(id, geom); + + +-- NULL handling +SELECT 'nulls', id, ST_MinimumSpanningTree(geom) OVER (ORDER BY id), ST_AsText(geom) FROM (VALUES + (1, 'LINESTRING(0 0,1 0)'::geometry), + (2, 'LINESTRING(0 0,0 1)'::geometry), + (3, NULL::geometry), + (4, 'LINESTRING(1 1,1 0)'::geometry), + (5, 'LINESTRING(0 0,1 1)'::geometry), + (6, 'LINESTRING(1 0,0 1)'::geometry) +) AS t(id, geom); + +-- Empty geometry handling +SELECT 'empty', id, ST_MinimumSpanningTree(geom) OVER (ORDER BY id), ST_AsText(geom) FROM (VALUES + (1, 'LINESTRING(0 0,1 0)'::geometry), + (2, 'LINESTRING EMPTY'::geometry), + (3, 'LINESTRING EMPTY'::geometry), + (4, 'LINESTRING(1 1,1 0)'::geometry), + (5, 'LINESTRING(0 0,1 1)'::geometry), + (6, 'LINESTRING(1 0,0 1)'::geometry) +) AS t(id, geom); + diff --git a/regress/core/spanningtree_expected b/regress/core/spanningtree_expected new file mode 100644 index 000000000..8421fd061 --- /dev/null +++ b/regress/core/spanningtree_expected @@ -0,0 +1,24 @@ +connected|1|1 +connected|2|1 +connected|3|1 +connected|4|0 +connected|5|0 +connected|6|0 +disconnected|1|1 +disconnected|2|1 +disconnected|3|1 +disconnected|4|2 +disconnected|5|2 +disconnected|6|2 +nulls|1|1|LINESTRING(0 0,1 0) +nulls|2|1|LINESTRING(0 0,0 1) +nulls|3|| +nulls|4|1|LINESTRING(1 1,1 0) +nulls|5|0|LINESTRING(0 0,1 1) +nulls|6|0|LINESTRING(1 0,0 1) +empty|1|1|LINESTRING(0 0,1 0) +empty|2|0|LINESTRING EMPTY +empty|3|0|LINESTRING EMPTY +empty|4|1|LINESTRING(1 1,1 0) +empty|5|0|LINESTRING(0 0,1 1) +empty|6|1|LINESTRING(1 0,0 1) diff --git a/regress/core/tests.mk.in b/regress/core/tests.mk.in index a2f66dad1..d34642e3d 100644 --- a/regress/core/tests.mk.in +++ b/regress/core/tests.mk.in @@ -166,6 +166,11 @@ else $(top_srcdir)/regress/core/concave_hull endif +ifeq ($(shell expr "$(POSTGIS_GEOS_VERSION)" ">=" 31500),1) + TESTS += \ + $(top_srcdir)/regress/core/spanningtree +endif + ifeq ($(shell expr "$(POSTGIS_GEOS_VERSION)" ">=" 31200),1) TESTS += \ $(top_srcdir)/regress/core/coverage ----------------------------------------------------------------------- Summary of changes: doc/reference_cluster.xml | 62 ++++++++++++++++++++++++++ postgis/lwgeom_window.c | 90 ++++++++++++++++++++++++++++++++++++++ postgis/postgis.sql.in | 7 +++ regress/core/spanningtree.sql | 42 ++++++++++++++++++ regress/core/spanningtree_expected | 24 ++++++++++ regress/core/tests.mk.in | 5 +++ 6 files changed, 230 insertions(+) create mode 100644 regress/core/spanningtree.sql create mode 100644 regress/core/spanningtree_expected hooks/post-receive -- PostGIS From git at osgeo.org Tue Mar 31 15:39:54 2026 From: git at osgeo.org (git at osgeo.org) Date: Tue, 31 Mar 2026 15:39:54 -0700 (PDT) Subject: [SCM] PostGIS branch master updated. 3.6.0rc2-421-ge0a0fe251 Message-ID: <20260331223955.26433137532@trac.osgeo.org> 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 e0a0fe25159200cfb4105df1be51edffde4c73f5 (commit) from f92f80d776d2d8eb88b2c8f67908b69b2922251c (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 e0a0fe25159200cfb4105df1be51edffde4c73f5 Author: Paul Ramsey Date: Tue Mar 31 15:39:51 2026 -0700 Add News entry for MST function diff --git a/NEWS b/NEWS index 68f47de61..3158dfaca 100644 --- a/NEWS +++ b/NEWS @@ -17,6 +17,7 @@ This version requires GEOS 3.10 or higher * New Features * + - ST_MinimumSpanningTree, window function to calculat MST (Paul Ramsey) - #5993, [topology] Add max_edges parameter to TopoGeo_AddLinestring (Sandro Santilli) - #6001, support MultiLineString in ST_MakeLine (Paul Ramsey) ----------------------------------------------------------------------- Summary of changes: NEWS | 1 + 1 file changed, 1 insertion(+) hooks/post-receive -- PostGIS From git at osgeo.org Tue Mar 31 15:43:54 2026 From: git at osgeo.org (git at osgeo.org) Date: Tue, 31 Mar 2026 15:43:54 -0700 (PDT) Subject: [SCM] PostGIS branch master updated. 3.6.0rc2-422-geafd5af09 Message-ID: <20260331224354.D5728136850@trac.osgeo.org> 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 eafd5af097db3b2b0541342923431dbcd214c386 (commit) from e0a0fe25159200cfb4105df1be51edffde4c73f5 (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 eafd5af097db3b2b0541342923431dbcd214c386 Author: Paul Ramsey Date: Tue Mar 31 15:43:50 2026 -0700 Fix spelling error diff --git a/NEWS b/NEWS index 3158dfaca..be561f67a 100644 --- a/NEWS +++ b/NEWS @@ -17,7 +17,7 @@ This version requires GEOS 3.10 or higher * New Features * - - ST_MinimumSpanningTree, window function to calculat MST (Paul Ramsey) + - ST_MinimumSpanningTree, window function to calculate MST (Paul Ramsey) - #5993, [topology] Add max_edges parameter to TopoGeo_AddLinestring (Sandro Santilli) - #6001, support MultiLineString in ST_MakeLine (Paul Ramsey) ----------------------------------------------------------------------- Summary of changes: NEWS | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) hooks/post-receive -- PostGIS