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

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

Related

PostGIS Installation "could not open extension control file"

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

PostGIS extension on Postgres-xl

I'm trying to deploy a PostGIS cluster using Postgres-XL on AWS, for this I have the next architecture:
SO: ubuntu
1 GTM (172.31.45.190)
1 Coordinator (172.31.45.191)
2 Datanodes (172.31.45.192 and 172.31.45.193)
I had my cluster running but I can't manage to make PostGIS work, I tried the installation with sudo apt-get install postgis but when I try to create the extension inside my db (CREATE EXTENSION postgis;) I got the next error:
ERROR: could not open extension control file "/usr/local/pgsql/share/extension/postgis.control": No such file or directory
The postgis.control file installed by apt-get is in: "/usr/share/postgresql/9.5/extension/postgis.control" so I think is just a problem with the paths but I'm a little lost on that configuration
Thank you in advance for any help!
In case anyone is running in this issue, I solved following this steps:
Install Postgres-xl and PostGIS dependencies to compile (Be sure to install the package postgresql-server-dev-9.5 in this step, otherwise it's going to brake your postgres-xl installation)
Build and install Postgres-XL with ./configure -prefix=/usr/lib/postgresql/9.5
Build and install PostGIS
Start your cluster
You're using a version of PostgreSQL (in this case PostgreSQL-XL) that was installed from somewhere other than the Ubuntu repositories (similar to this issue). The /usr/local/pgsql/share is the configured $SHAREDIR for your installation of PostgreSQL. The default on Ubuntu for PostgreSQL 9.5 should be /usr/share/postgresql/9.5. As far as I can tell $SHAREDIR is configured at compile time and can't easily be changed.
PostGIS gets compiled against the version of PostgreSQL it's going to be used against. So in this case the Ubuntu version of PostGIS isn't going to be compatible with the version of PostgreSQL-XL you're running.
You have two options for fixing the issue:
Install PostgreSQL from the Ubuntu software repository (make sure you back up your database first!) and use that instead of PostgreSQL-XL.
Install PostGIS manually into PostgreSQL-XL.

Timescale not finding pg_config on AMI

I created a machine in AWS Cloud9 and I want to install timescale on that instance. I have previously installed and setup postgres 9.6 using yum.
OS version is:
Amazon Linux AMI release 2018.03
.
When I run 'which pg_config', it is found here:
/usr/bin/pg_config
Looking at the install instructions on the timescale website, I came up with this:
sudo yum install -y
https://download.postgresql.org/pub/repos/yum/9.6/redhat/rhel-6-x86_64/pgdg-ami201503-96-9.6-2.noarch.rpm
wget
https://timescalereleases.blob.core.windows.net/rpm/timescaledb-0.9.2-postgresql-9.6-0.x86_64.rpm
sudo yum install timescaledb-0.9.2-postgresql-9.6-0.x86_64.rpm
after the last command I get the following error:
Running transaction Installing :
timescaledb-0.9.2-0.el7.centos.x86_64
1/1 ERROR: Could not find pg_config, expected it at
/usr/pgsql-9.6/bin/pg_config. Please fix and try again.
warning: %post(timescaledb-0.9.2-0.el7.centos.x86_64) scriptlet
failed, exit status 1 Non-fatal POSTIN scriptlet failure in rpm
package timescaledb-0.9.2-0.el7.centos.x86_64
Do you have any more details on how you installed PostgreSQL on CentOS? I suspect this may have something to do with a mismatch between your pg_config installation and your PostgreSQL 9.6 installation, similar to the user in this issue.
I'd recommend uninstalling your current postgresql-devel and explicitly installing it for 9.6:
yum install postgresql96-devel
It seems the AMI is setup a bit differently than a normal CentOS install so PostgreSQL is installed in a different place than our installer expected. I've gone ahead and updated the RPMs to use a more robust method of finding the correct place to put the files. If you could re-download the latest RPM and confirm that it works that'd be great.
I've met exactly the same problem.
I solve this by manually linking them together.
sudo ln -s /usr/lib64/pgsql96/bin/pg_config /usr/pgsql-9.6/bin/pg_config

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.

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.