[postgis-tickets] [PostGIS] #5253: postgis_extensions_upgrade is broken for upgrade from 3.4.0dev to 3.4.0dev

PostGIS trac at osgeo.org
Sat Oct 1 14:27:28 PDT 2022


#5253: postgis_extensions_upgrade is broken for upgrade from 3.4.0dev to 3.4.0dev
------------------------------------+---------------------------
  Reporter:  robe                   |      Owner:  strk
      Type:  defect                 |     Status:  new
  Priority:  blocker                |  Milestone:  PostGIS 3.4.0
 Component:  build/upgrade/install  |    Version:  master
Resolution:                         |   Keywords:
------------------------------------+---------------------------
Description changed by robe:

Old description:

> 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
>                                 );
> }}}

New description:

 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
                                 );
 }}}

--
-- 
Ticket URL: <https://trac.osgeo.org/postgis/ticket/5253#comment:1>
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