[PostGIS] #5771: address_standardizer_data_us upgrade sql script can be incorrect

PostGIS trac at osgeo.org
Tue Aug 27 19:13:01 PDT 2024


#5771: address_standardizer_data_us upgrade sql script can be incorrect
---------------------+---------------------------
 Reporter:  evsi     |      Owner:  pramsey
     Type:  defect   |     Status:  new
 Priority:  medium   |  Milestone:  PostGIS 3.4.3
Component:  postgis  |    Version:  3.4.x
 Keywords:           |
---------------------+---------------------------
 Hi, there seems to be a problem with the way the way that
 address_standardizer_data_us upgrade sql script is handled during the
 build step in 3.4.0 and up. The address_standardizer_data_us upgrade file
 can end up being identical to that of address_standardizer.

 To re-produce (I was using Amazon Linux 2 x86 GNU Make 3.82):

 {{{
 cd postgis-$POSTGIS_VERSION_NUM/extensions
 make
 touch ./address_standardizer/sql/address_standardizer_functions.sql
 make install
 diff address_standardizer/sql/address_standardizer--
 ANY--$POSTGIS_VERSION_NUM.sql
 address_standardizer/sql/address_standardizer_data_us--
 ANY--$POSTGIS_VERSION_NUM.sql | wc -l
 }}}
 and notice the result value is 0 (i.e. they are the exact same file),
 which is not expected.

 ----

 (From my own looking)

 When installation happens, the install-upgrade-paths target is called with
 EXTENSION set as address_standardizer_data_us
 [https://git.osgeo.org/gitea/postgis/postgis/src/tag/3.5.0alpha2/extensions/address_standardizer/Makefile.in#L134
 link]. This hits the generic target instead, which seems to be for
 address_standardizer
 [https://git.osgeo.org/gitea/postgis/postgis/src/branch/master/extensions/address_standardizer/Makefile.in#L116
 link], rather than the one specifically for data_us.

 When running make with parallelization the dependency
 'sql/address_standardizer_functions.sql' can be newer than the target
 `sql/address_standardizer_data_us--ANY--<version>.sql', so the latter gets
 replaced with wrong upgrade script. (Hence the reproduction example just
 touches the file after make, to force the install target to "update" the
 script.)
-- 
Ticket URL: <https://trac.osgeo.org/postgis/ticket/5771>
PostGIS <http://trac.osgeo.org/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.


More information about the postgis-tickets mailing list