[postgis-tickets] [PostGIS] #3081: Upgrade from 2.0.5: ERROR: type "rastbandarg" already exists
PostGIS
trac at osgeo.org
Tue Mar 17 03:35:48 PDT 2015
#3081: Upgrade from 2.0.5: ERROR: type "rastbandarg" already exists
-----------------------------------+----------------------------------------
Reporter: strk | Owner: strk
Type: defect | Status: new
Priority: medium | Milestone:
Component: build/upgrade/install | Version: 2.1.x
Keywords: |
-----------------------------------+----------------------------------------
Changes (by strk):
* cc: robe (added)
Comment:
The problem is that rtpostgis_upgrade.sql contains two different code
blocks taking care of creating types. One is the postgis_proc_upgrade.pl
generated block:
{{{
-- Type rastbandarg -- LastUpdated: 201
DO LANGUAGE 'plpgsql'
$postgis_proc_upgrade$
BEGIN
IF 201 > version_from_num FROM _postgis_upgrade_info THEN
EXECUTE $postgis_proc_upgrade_parsed_def$ CREATE TYPE rastbandarg AS (
rast raster,
nband integer
);
$postgis_proc_upgrade_parsed_def$;
END IF;
END
$postgis_proc_upgrade$;
}}}
The other one is what I belive being a manually crafted block:
{{{
-- create rastbandarg type if it does not exist
IF NOT EXISTS(SELECT typname
FROM pg_type
WHERE typname = 'rastbandarg') THEN
CREATE TYPE rastbandarg AS (
rast raster,
nband integer
);
END IF;
}}}
--
Ticket URL: <http://trac.osgeo.org/postgis/ticket/3081#comment:4>
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