Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to alter the path for Postgres looking for extensions?

I installed Postgres on a Windows machine, downloaded the binary installer for PostGIS and installed it. I only have one version of Postgres, so there is no messing up possible.

Installing PostGIS using the binary installer is straight forward and you cannot mess up the installation directory either. it has to go into the Postgres directory.

Now, when I want to create the PostGIS extension I am getting the following error:

ERROR:  could not open extension control file "C:/APPS/POSTGR~1/pg96/../pg96/share/postgresql/extension/postgis.control": No such file or directory
********** Error **********

ERROR: could not open extension control file "C:/APPS/POSTGR~1/pg96/../pg96/share/postgresql/extension/postgis.control": No such file or directory
SQL state: 58P01

Though when I go into the directory C:\APPS\PostgreSQL\pg96\share\extension then I do have a postgis.control file present.

How do I get the extension to work? I checked the content of the zipped PostGIS binaries and it looks like as if the structure is well preserved and all files are copied into the appropriate directories during the install process via the binary installer.

like image 421
TomGeo Avatar asked Mar 15 '17 10:03

TomGeo


People also ask

Where can I find PostgreSQL extension?

Get a list of all the extensions installed on a database by using the \dx command. For example, the output for \dx when run on the Databases for PostgreSQL default database shows the only installed extension.

How do I enable PostgreSQL extension?

To activate and use an extension, you must download and install the necessary files (if not delivered with the standard download) and issue the command CREATE EXTENSION <extension_name>; within an SQL client like psql . To control which extensions are already installed use: \dx within psql .

What is the extension of PostgreSQL files?

Each PSQL database table is a separate file with a default file extension of . mkd.


1 Answers

It seems that the case is still the same with latest versions of postgres (PostgreSQL-9.6.3-1-win64-bigsql.exe) and postgis (postgis-bundle-pg96x64-setup-2.3.2-1.exe). I copied the files around until all the paths could be resolved:

  1. Everything from C:\PostgreSQL\pg96\share\extension to C:\PostgreSQL\pg96\share\postgresql\extension
  2. postgis_topology-2.3.dll, postgis-2.3.dll, rtpostgis-2.3.dll, address_standardizer-2.3.dll and ogr_fdw.dll from C:\PostgreSQL\pg96\lib to C:\PostgreSQL\pg96\lib\postgresql
like image 168
LKallipo Avatar answered Oct 06 '22 07:10

LKallipo