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?
Best Answer
I just had the same problem on Ubuntu Server 14.04. I installed the
postgis
extension from the official Ubuntu repositories usingapt-get install postgis
.Then,
find /usr -name postgis.control
didn't return any results.The reason was
extension/postgis.control
wasn't installed because postgis-scripts wasn't.The solution is to install it.
On debian-like distros:
The aptitude package manager will automatically determine the correct package versions to install. The postgis-doc will be installed too.
You can check the success of the operation by running the following command:
On my server, it now returns:
You can now enable the extension on any database on your postgres server:
CREATE EXTENSION postgis;
Your public schema now contains all postgis objects and functions.