[postgis-tickets] [PostGIS] #5165: CREATE EXTENSION scripts should use CREATE instead of CREATE OR REPLACE

PostGIS trac at osgeo.org
Mon Jun 6 03:35:45 PDT 2022


#5165: CREATE EXTENSION scripts should use CREATE instead of CREATE OR REPLACE
------------------------------------+---------------------------
  Reporter:  robe                   |      Owner:  strk
      Type:  defect                 |     Status:  new
  Priority:  medium                 |  Milestone:  PostGIS 3.3.0
 Component:  build/upgrade/install  |    Version:  master
Resolution:                         |   Keywords:
------------------------------------+---------------------------
Comment (by strk):

 I would like to know more about the rationale for this.
 Using `CREATE` without `OR REPLACE` would imply using a `DROP` of the
 function when the function *body* changed across PostGIS versions, which
 in turn would prevent upgrades when the function is used in views.

 Granted we DO now have a way to somehow handle the views (activated via
 `replaces xxxx` comments) but that handling would leave stale/old
 signatures in the database which is not very clean and fail to have the
 view use the *updated*/new function.

 I think we DO WANT to actually _REPLACE_ our own functions, so if that's a
 dangerous thing to do we'd better handle the dangers, in our upgrade
 script, and continue to do the actual UPGRADE (and we want support for `OR
 REPLACE` in more objects too!)
-- 
Ticket URL: <https://trac.osgeo.org/postgis/ticket/5165#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