It is likely that this is caused by one of the following reasons:
- Postgis was installed at a pre-GPDB 6 level and the DB is now upgraded to GPDB 6
- Postgis was installed at a GPDB 6 level but was using the pre-GPDB 6 method with the postgis_manager.sh script.
To get the Postgis extension installed correctly in GPDB, follow the steps below.
Make sure the Postgis is fully installed using the pre-GPDB6 method, as only some of the Postgis might be installed:
psql -d DB_name -f $GPHOME/share/postgresql/contrib/postgis-X.X/install/postgis.sql
psql -d DB_name -f $GPHOME/share/postgresql/contrib/postgis-X.X/install/postgis_comments.sql
psql -d DB_name -f $GPHOME/share/postgresql/contrib/postgis-X.X/install/rtpostgis.sql
psql -d DB_name -f $GPHOME/share/postgresql/contrib/postgis-X.X/install/raster_comments.sql
Note: Replace the
DB_name with the database name and
X.X with the Postgis version.
Use the
postgis_manager script to upgrade the Postgis:
$GPHOME/share/postgresql/contrib/postgis-X.X/postgis_manager.sh DB_name upgrade
Note: Replace the
DB_name with the database name and
X.X with the Postgis version.
The command should give the following output:
Postgis version 2.5 already installed.
CREATE EXTENSION
Now the Postgis is correctly installed. There is no need to run the
CREATE EXTENSION command in the DB.