losthorse
losthorse

Reputation: 1570

Error when trying to run Create Extension postgis

I have installed PostgreSQL 9.x and PostGIS 1.5/2.0 several times and have never had this problem.

I just got a new CentOS 6.3 server up and running and and I have Postgres 9.3 functioning as expected. I have run

yum install postgis2_93

and I can see the files in

/usr/pgsql-9.3/share/contrib/

however, when I run

CREATE EXTENSION postgis;

I receive

ERROR:  could not open extension control file "/usr/pgsql-9.3/share/extension/postgis.control": No such file or directory

the tutorials (#1, #2) I have used don't show any steps between installing PostGIS and creating the extension.

What am I missing?

Upvotes: 9

Views: 8335

Answers (4)

Damith Asanka
Damith Asanka

Reputation: 964

I have same issue, so i fixed that using below steps

my environment is

Windows 10 , postgres sql 11 server and pgAdmin 4

  1. download binary from (zip file not installer) http://download.osgeo.org/postgis/windows/pg11/postgis-bundle-pg11-2.5.3x64.zip
  2. Extract zip file into folder
  3. change the setting in "makepostgisdb_using_extensions.bat"
  4. Run the file as Administrator if above steps gives error manually copy files based "makepostgisdb_using_extensions.bat" copy file in the Xcopy section eg. xcopy bin*.* "%PGBIN%" is equals to

extract_folder\bin into C:\Program Files\PostgreSQL\11\pgAdmin 4\bin

follow each xcopy command copy the relevant files 5. Restart postgre server 6. Run the 4 step in above sequence 7. or else you can create gis extension through the pgAdmin UI

========= Good luck

Upvotes: 0

Vlad
Vlad

Reputation: 3597

For Postgresql 9.6 please try this commands:

yum install postgis
yum install postgis-client 
yum install postgresql96-contrib

Upvotes: 0

daryl
daryl

Reputation: 1200

The postgis2_93 RPM provided by http://yum.pgrpms.org/ is missing extension support. I reported this to Devrim earlier this week and he has been attempting to fix it.

http://svn.pgrpms.org/changeset/299

Hopefully the next push of RPMS to the website resolves this.

Update: postgis2_93-2.1.0-3 was released, which solved this issue but placed a rpm requirement for gdal 1.9, which EPEL does not provide. I got it from ELGIS.

Upvotes: 2

DFE
DFE

Reputation: 51

UPDATE: the TEAM has just released the postgis.2.1.0-3 RPM package that solve the issue: now the extension is available:

/usr/pgsql-9.3/share/extension/postgis.control

END UPDATE. [...]

I resolved compiling POSTGIS from source. This is the step-by-step for CentOS 6.4 64bit:

wget http://download.osgeo.org/postgis/source/postgis-2.1.0.tar.gz
tar xvf postgis-2.1.0.tar.gz
cd postgis-2.1.0
./configure --with-pgconfig=/usr/pgsql-9.3/bin/pg_config --without-raster
make
make comments
make install
make install-comments
su - postgres 
cd /usr/pgsql-9.3/share/contrib/postgis-2.1/
psql -d postgres -f postgis.sql
psql -d postgres -f spatial_ref_sys.sql
psql -d postgres -f postgis_comments.sql
psql -d postgres -f topology.sql
psql -d postgres -f topology_comments.sql

Upvotes: 3

Related Questions