Opened 19 months ago

Closed 19 months ago

Last modified 19 months ago

#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 robe)

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 robe, 19 months ago

Description: modified (diff)

comment:2 by robe, 19 months ago

We should also add a test for this, but not sure which would be the appropriate since it covers all extensions.

comment:3 by robe, 19 months 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:4 by Regina Obe <lr@…>, 19 months ago

In 138d591d/git:

Fix postgis_extensions_upgrade for same version to same version.
Tests still needed
References #5253 for PostGIS 3.4.0dev

comment:5 by robe, 19 months 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:6 by Regina Obe <lr@…>, 19 months ago

Resolution: fixed
Status: newclosed

In 34ddeb15/git:

1) Oops forgot to declare from version.
2) Add extension SELECT postgis_extensions_upgrade() to dronie
Closes #5253 for PostGIS 3.4.0dev

comment:7 by Regina Obe <lr@…>, 19 months ago

In 9c61439/git:

Github ci latest is too old. Upgrade test with pg13 instead. References #5253 for PostGIS 3.4.0dev

comment:8 by Regina Obe <lr@…>, 19 months ago

In b9439d2/git:

Fix current / current test. References #5253

comment:9 by Regina Obe <lr@…>, 19 months ago

In 27b9a8f0/git:

Take out upgrade for GHA. Need to allow sudo on docker before we can. References #5253

in reply to:  8 comment:10 by strk, 19 months ago

Replying to Regina Obe <lr@…>:

In b9439d2/git:

Fix current / current test. References #5253

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)

comment:11 by robe, 19 months ago

okay created #5256

Note: See TracTickets for help on using tickets.