PostGIS Installation "could not open extension control file" - postgresql

I've been scouring posts trying to figure out how to resolve this issue - could not open extension control file "/usr/local/share/postgresql/extension/postgis.control": No such file or directory
I'm installing PostgreSQL and PostGIS with apt-get install postgresql-12 postgis postgresql-12-postgis-3 into a Docker container running python:latest. I'd initially been running Alpine however it seemed there were a number of issues getting PostGIS installed successfully on Alpine distributions.
I've located the file with find /usr -name postgis.control under /usr/share/postgresql/12/extension/postgis.control. I've attempted to move this to the directory PostGIS expects, but I'm still seeing the same error.
It's been driving me totally mad!
Any help is appreciated, and happy to answer any questions that will help me find an answer.

I was never able to resolve this issue, so I ended up switching to the official postGIS docker image which worked flawlessly. Would recommend it to anyone else in a similar situation.

I had the same issue, but installing PostGIS on the ubuntu machine worked for me.
apt-get install postgis*
After the installation above, I was able to create the extension as expected.
CREATE EXTENSION postgis

Related

How I can open pgadmin4 in fedora 36?

Good evening people, I am trying to install pgadmin4 on fedora 36, I followed all the steps in the documentation and pgadmin4 and its dependencies were installed correctly but I do not know how to start it, or open it and it does not let me configure it on the web because I do not create the directory described in the final step to configure the web version.
I had the same problem. I solved it installing pgadmin4 from linux-pachages
https://linux-packages.com/fedora-36/package/pgadmin4-qtx86-64
I followed the same instructions but mistakenly changing "yum" to "dnf" out of force of habit. I found I got an install out of it which seemed OK at a glance, but it was just documentation and not an executable, and there was no shortcut added to run pgAdmin. Perhaps you might have inadvertently done something similar? After uninstalling, I tried again using "yum" exactly as documented and the latest executable installed without any issue. So the steps to install that would work for me were as follows. (Desktop version in my case.)
sudo rpm -e pgadmin4-fedora-repo
sudo rpm -i https://ftp.postgresql.org/pub/pgadmin/pgadmin4/yum/pgadmin4-fedora-repo-2-1.noarch.rpm
sudo yum install pgadmin4-desktop
The QT workaround also mentioned as an answer worked for me, but I wanted to avoid that since it is an earlier release (6.9) than the current 6.11, isn't officially supported and fires a warning about that every time on start up saying some functionality may be missing, which is not good for clients to see potentially in my case.
Same problem - couldn't open it after installing. You have to install pgadmin4-desktop not pgadmin4.

Postgresql 12 doesn´t find PostGIS extension on CentOS 8

I´m trying to get PostGIS working, but it seems that Postgresql doesn´t find the extension. My server is running on CentOS 8, the Postgresql is version 12. I installed Postgresql 12 first via dnf module enable postgresql:12 etc..
Afterwards I installed PostGIS and followed the description on the PostGIS website (https://people.planetpostgresql.org/devrim/index.php?/archives/102-Installing-PostGIS-3.0-and-PostgreSQL-12-on-CentOS-8.html). But when I try to run CREATE EXTENSION postgis; I get the error ERROR: could not access file "$libdir/postgis-3": No such file or directory SQL state: 58P01 I figured out that the needed files reside in a subdirectory "bitcode". Therefore I tried to symlink the content in the $libdir directory above - but didn´t help. Even copying them in the directory didn´t - same error. What am I missing?
Thank you and best regards,
Goetz
You have a mix of packages installed: Some from the CentOS distribution, some from the PostgreSQL site. That will lead to trouble.
Uninstall the PostgreSQL packages that do not have PGDG in them and make sure to disable them as shown in the link you show. Then install the PGDG packages for PostGIS

Installing/activitating pgsql.so extension in CentOS 6

I am trying to install a student information system (RosarioSIS) that is PostgreSQL-driven. After installing PostgreSQL 9.6 , the system asks me to install and activate a php extension (pgsql.so). I tried 'yum install php-pgsql' command, but it didn't work for some reason. I have tried all the suggested solutions on Stackoverflow and other forums, but still no luck. The last thing I tried is unarchiving a copy of php 5.4.45 and compiling the extension manually using:
phpize
./configure
make
sudo make install
This also did not manage to add the pgsql.so to the folder extension. What do you suggest I do in order to add the required extension (pgsql.so) to where it belongs?
PHP 5.6 release date is far earlier than PostgrSQL 9.6 (PG96). When PHP56 is released, it wasn't knowing about PG96. Try installing PostgreSQL 9.3 and you'll see everything works great. BTW, even PHP7.1 doesn't have client library for PG96 in FreeBSD ports tree.

Postgres 9.3.10 - /usr/share/postgresql/9.3/extension/postgis.control

I have searched all over around on google but still didnt find the solution so posting here. Every help will be appreciated.
In my project, I am using
"./scripts/create"
to create Database. as am using PostgreSQL. While creating it i got an error
could not open extension control file
"/usr/share/postgresql/9.3/extension/postgis.control": No such file or
directory
I tried to install this extension through anyway. but all in vain. it needs a dependency which is libgdal1, I am totally unable to find it for Ubuntu 14.04.
PS : Have tried every answer over stackoverflow.
The packages libgdal1h and postgresql-9.3-postgis-scripts have been installed.
When I ran sudo apt-get install postgresql-9.3-postgis-2.1, I got an error
postgresql-9.3-postgis-2.1 : Depends: libgdal1 (>= 1.9.0) but it is not going to be installed ,
PostgreSQL packages are broken in ubuntu 14.04, so you have to purge every postgresql package from your system:
sudo apt-get purge 'postgresql-.*'
Important: this will remove not only package but all databases and configs from your machine.
After that follow official install guide from postgresql wiki: http://wiki.postgresql.org/wiki/Apt

Postgis - Failed to install it on linux mint mate 17

I install postgis via sudo apt-get install postgis postgresql-9.3-postgis-2.1
Then execute CREATE EXTENSION postgis; but got following error tip:
ERROR: could not load library "/usr/lib/postgresql/9.3/lib/postgis-2.1.so":
/usr/lib/postgresql/9.3/lib/postgis-2.1.so: undefined symbol: HeapTupleHeaderGetDatum
I am using postgresql 9.3.4, and postgis-2.1.
I did google for over an hour, but didn't found a solution that really solve my issue.
Any help?
I spend another hour, and finally tried to install it from source code, and succeed like a charm, no single issue occur!
Here is the link provide detail steps to install postgis from source code:
http://trac.osgeo.org/postgis/wiki/UsersWikiPostGIS21Ubuntu1404src
It also works for my Linux mint mate 17, which is base on ubuntu 14.04.
The first two hits seem to say basically the same thing to me:
http://www.postgresql.org/message-id/A9A6BC42-D2E2-471B-BFB0-F6A72EF42911#conundrum.com
https://github.com/pgRouting/pgrouting/issues/271
It sounds to me like your version of postgis was built against a version of postgresql later than 9.3.4 which included a bugfix that included "HeapTupleHeaderGetDatum". So - upgrade your postgresql (you do have something more recent than .4?) and/or make sure you get postgis from the same repo as your postgresql packages.
See if that helps.