#5253 closed defect (fixed)
postgis_extensions_upgrade is broken for upgrade from 3.4.0dev to 3.4.0dev
Reported by: | robe | Owned by: | strk |
---|---|---|---|
Priority: | blocker | Milestone: | PostGIS 3.4.0 |
Component: | build | Version: | master |
Keywords: | Cc: |
Description (last modified by )
I guess we don't have a test for this cause the test should have caught it.
When I run this on my setup after a fresh install of 3.4.0dev
SELECT postgis_extensions_upgrade();
I get this error:
NOTICE: Updating extension postgis 3.4.0dev ERROR: syntax error at or near "ANY" LINE 1: ...TENSION "ALTER EXTENSION %1$I UPDATE TO %2$I" UPDATE TO ANY; ^ QUERY: ALTER EXTENSION "ALTER EXTENSION %1$I UPDATE TO %2$I" UPDATE TO ANY; CONTEXT: PL/pgSQL function postgis_extensions_upgrade() line 89 at EXECUTE SQL state: 42601
On closer inspection, the problem is this format expression:
sql = format( 'ALTER EXTENSION %1$I UPDATE TO ANY;', 'ALTER EXTENSION %1$I UPDATE TO %2$I', rec.name, target_version );
I think should be:
sql = format( 'ALTER EXTENSION %1$I UPDATE TO "ANY";' 'ALTER EXTENSION %1$I UPDATE TO %2$I', rec.name, target_version );
Change History (11)
comment:1 by , 2 years ago
Description: | modified (diff) |
---|
comment:2 by , 2 years ago
comment:3 by , 2 years ago
Description: | modified (diff) |
---|
oops I changed the wrong example the ANY also needs to be single or double quoted. Easier to double-quote
comment:5 by , 2 years ago
strk mentioned there is a test, but it appears no bots are testing it.
I was able to do a test with
perl regress/run_test.pl --extension -v --upgrade-path "3.4.0dev--:auto!" regress/loader/Polygon
To confirm that the before failed and the patched works.
I'll an auto upgrade test to GHA
comment:10 by , 2 years ago
Replying to Regina Obe <lr@…>:
In b9439d2/git:
I think this commit should not be needed, could you please file a separate ticket for the issue you saw of CI not testing what it should test ?
The check_all_upgrades.sh script takes the target as a parameter, so whether or not script-based is used depends on the parameter (:auto!
uses the function while :auto
does not)
We should also add a test for this, but not sure which would be the appropriate since it covers all extensions.