[postgis-devel] Minor upgrades now support OPERATOR CLASS additions

Sandro Santilli strk at keybit.net
Wed Feb 18 04:01:25 PST 2015

I've committed an enanchement in the proc_upgrade.pl script
that allows generating correct upgrade scripts whenever
support function and operators are added to an OPERATOR CLASS.

In order to trigger it, "Availability" info need be added at
the sub-object level, as in this example:

   -- Availability: 2.1.0
   CREATE OPERATOR CLASS gist_fake_ops
        FOR TYPE geometry USING GIST AS
        STORAGE         gidx,
        OPERATOR        3        &&&,
        -- Availability: 2.2.0
        OPERATOR        13       <-> FOR ORDER BY pg_catalog.float_ops,
        FUNCTION        1        geometry_gist_consistent_nd (internal, geometry, int4),
        -- Availability: 2.2.0
        FUNCTION        8        geometry_gist_distance_nd (internal, geometry, int4);

The upgrade script for the above would CREATE the operator class
when the installed version is < 2.1.0, otherwise would ALTER the
corresponding operator family adding the component that were made
available in versions above the installed one.

Unfortunately we still have no build bot testing upgrade procedures
between different versions [1] so it takes great care when editing the
sql file to ensure labels are correctly placed.

Manual tests can be performed like this:
 regress/run_test.pl -v --extension --upgrade-path 2.1.0--2.2.0dev test.sql

[1] http://trac.osgeo.org/postgis/ticket/2688


  ()   Free GIS & Flash consultant/developer
  /\   http://strk.keybit.net/services.html

More information about the postgis-devel mailing list