The Linux machine I use has SuSE 12.1 with Postgres 9.4 installed (as root). I was able to compile and install the PostGIS 2.5 extension in a user area. Under this installation, I see, among other things, contrib folder, some sql files and .so files etc.
I can launch Postgres using my personal user. How can I let Postgres know to refer to this directory where all the PostGIS extension related files/objects are available?
When I try creating the extension, I get the following error:
ERROR: could not open extension control file "/usr/share/postgresql94/extension/postgis.control": No such file or directory
Of course, some error is expected as Postgres doesn't know about my PostGIS installation. But the latter does not have such a file, postgis.control.
I am guessing the solution is to ensure Postgres can see the .so files (may be set LD_LIBRARY_PATH?) or create a postgis.control file with all the relevant details etc.
Any assistance including simply pointing to documentation will be appreciated.
I see a few similar questions but no one seems to address my issue of the extension - PostGIS - in a separate directory. They assume root access.
Like every extension, PostGIS has to be installed in the PostgreSQL extension subdirectory (under share).
When PostGIS is configured, it looks for pg_config on the PATH, or you can explicitly specify the --with-pgconfig option to configure.
Once you have built PostGIS, make install will automatically put all files in the proper place.
You are not very specific how you built PostGIS, but you must have strayed from the correct path somewhere. If you share some details, we might be able to figure out what went wrong.
Re-reading your question I get the impression that you installed PostGIS somewhere outside the PostgreSQL software directory because you lack the necessary root privilege. That simply won't work, and there is no workaround.
You'd have to install PostgreSQL somewhere where you have write access.
Related
I was packaging an windows application installer by NSIS.
An postgresql binary file was included in this install package.
But the official binary file is too large 172MB.
The zip archive is download from
https://www.enterprisedb.com/download-postgresql-binaries
The inside structure is like
pgsql
bin
doc
include
lib
pgAdmin4
share
StackBuilder
symbols
In my opinion, pgAdmin4 is no need for my installer.
There are only CRUD operations in between application and SQL.
If I remove this directory, the binary zip can down to 41MB.
So could I simply remove directory pgAdmin4 and re-compress
to achieve this?
So could I simply remove directory pgAdmin4 and re-compress to achieve this?
Yes, and you can remove StackBuilder too if you want. Also symbols if you don't want to do in-place debugging if the postgres server crashes.
Please, please install your bundled PostgreSQL on a non-default port (not 5432) and if you run it as a service use a name associated with your application, so users know where it came from. See Installation of postgresql with NSIS . Put the PostgreSQL install directory within your app install directory.
i tried to create extension for postgis in postgresql 9.5. I've already follow from here
But it doesn't work like i expected. I got error ERROR: could not load library "/usr/pgsql-9.5/lib/rtpostgis-2.2.so": libhdf5.so.6: cannot open shared object file: No such file or directory when i execute CREATE EXTENSION postgis
I have had install this on my other machine which run ubuntu. But this machine using centos 6. am i missing something? please help.
Looks like the package you need is hdf5
There have been a fair number of problems reported with this library (a quick google search is helpful), but you may try making sure you can find libhdf5.so.6 on your system and if not reinstalling the rpm.
If that doesn't work, build the library from source or find an alternate version for download?
I'm new to Postgresql and am going to install on A directory for my Application.
After building a package including the Application and Postgresql, I should deliver it to other user(by Installer but Postresql is not embedded).
I was wondering if it is okay for me to just copy Postgresql to other directory without any consideration of registry or environment variables on Windows.
Does it work by copying the all of directories to other directory or server?
If you stop the running PostgreSQL service, and you preserve file permissions when copying/moving, and the destination is also a NTFS filesystem, it will work. But you'll have to adjust the service definition or create a new one to start from the new location; PostgreSQL won't know where the data directory is until you tell it.
However.
You should simply initdb PostgreSQL where it needs to be in the first place. There's no need to copy or move the data directory. Ask the user where they want it to be put and then put it there from the start.
I strongly recommend that you bundle PostgreSQL binaries in your installer rather than having the user run a PostgreSQL installer first. Then have your app initdb its own private PostgreSQL data directory for its use.
See Installation of postgresql with NSIS (it doesn't matter if you're not using NSIS, the principles are the same).
I am trying to install the pg_similarity extension for Windows PostgreSQL 9.1 x64.
I believe I have placed the necessary files into the /share/contrib directory and also the /share/extension directory as instructed in the documentation.
When running CREATE EXTENSION pg_similarity; I get this error:
ERROR: could not access file "$libdir/pg_similarity": No such file or directory
I believe this is because I do not have the pg_similarity.dll file in the /lib/ directory.
The instructions at https://github.com/eulerto/pg_similarity (for Windows) say to generate that file by "executing pg_config --libdir" which obviously does not work in and of itself. I assume other steps are implied or left out.
Could someone please explain how to complete that part of the installation and/or generate the needed .dll file and provide it? The installation instructions for Windows are not very detailed.
The only other part of the instructions I did not follow was:
"Edit contrib/Makefile and add pg_similarity to SUBDIRS variable;" however that file already contains a line subdir = contrib/pg_similarity which sounds as though that has already been set. If not I certainly don't know what needs to be changed and that's all there is to the explanation of what to change.
I'm trying to install plpython on a postgres server on a Windows machine. When I issue the command CREATE EXTENSION plpython3u; in postgres, I get the following error, which I'm trying to find the source of.
ERROR: could not load library "C:/Program Files/PostgreSQL/9.3/lib/plpython3.dll": The specified module could not be found.
This file exists, which I presume means that Windows can't find one of the files it depends on. When I open the plpython3.dll with Dependency Walker, it tells me it can't locate the GPSVC.dll.
Is it likely that this missing dll would cause the CREATE EXTENSION command to fail? I found a .dll with the same name in C:\Windows\System32 and copied it over to C:\Windows\SysWOW64, but this did not resolve the probelm, and although dependency walker now finds the .dll, it raises several other errors about having modules with different CPU types.
I know this is an old question, but thought I would post to save someone the headaches I went through trying to fix this...
I had the same error trying to add pl python using Postgres 9.5. Dependency walker showed that plpython3.dll was looking for python33.dll, so I installed python 3.3 and added the install directory into my path and that seems to have fixed the problem.
Use specific python version on Windows. I could get it running with python 3.2.x with postgres 9.3