ERROR: could not open extension control file "/usr/share/postgresql/9.1/extension/postgis.control": No such file or directory
Is what I get when I try to CREATE EXTENSION postgis;
can anybody tell me why is it so and what can I do to fix it?
asked Sep 9, 2013 at 10:20
3
The following will get you a working postgis install on Ubuntu 12.04 (Note: also tested on 13.10)
echo "deb http://apt.postgresql.org/pub/repos/apt/ precise-pgdg main" | sudo tee /etc/apt/sources.list.d/postgis.list
wget --quiet -O - http://apt.postgresql.org/pub/repos/apt/ACCC4CF8.asc | sudo apt-key add -
sudo apt-get update
sudo apt-get install postgresql-9.3 postgresql-9.3-postgis-2.1 postgresql-client-9.3
sudo -u postgres psql -c 'create extension postgis;'
Based on the docs at https://wiki.postgresql.org/wiki/Apt
answered Nov 20, 2013 at 11:43
dwurfdwurf
12.3k6 gold badges29 silver badges42 bronze badges
5
You need to install postgresql-9.1-postgis-scripts
. In Ubuntu or Debian, you need to run the following command as root:
apt-get install postgresql-9.1-postgis-scripts
This adds the files needed to create the postgis
extensions.
Arman H
5,35810 gold badges50 silver badges75 bronze badges
answered Apr 30, 2014 at 21:01
4
Installing this package did the trick for me on my Linux Mint 16 box:
# install hstore postgresql extension.
sudo apt-get install postgresql-contrib
answered Oct 16, 2014 at 18:01
AlirezaAlireza
2,59117 silver badges18 bronze badges
4
Daniel Vérité is close to the truth, but not enough. The package missing is postgresql-9.1-postgis-2.0
:
sudo apt-get install postgresql-9.1-postgis-2.0
answered Nov 27, 2013 at 9:42
Luís de SousaLuís de Sousa
5,28810 gold badges46 silver badges82 bronze badges
2
Presumably the postgis
version you installed is 1.5.x which doesn’t come as an extension, but as a couple of SQL scripts that need to be manually applied to create the necessary SQL objects.
Also the postgis
package is not enough, it contains only stuff that doesn’t depend on PG version, you need postgresql-9.1-postgis
(dpkg -L package-name
is handy to check out the files provided by any particular package).
Once the installation paths are known, the official install documentation should be good enough to set up the template database.
answered Sep 12, 2013 at 14:10
Daniel VéritéDaniel Vérité
56k15 gold badges125 silver badges150 bronze badges
Just resolved it.
You have to uninstall postgis-1.5. You installed it instaed of PostGIS 2.0. As soon as you will install postgis-2.0
you will see corrected libraries in extension directory.
Before installing you should to add a correct repository (see http://docs.pgrouting.org/2.0/en/doc/src/installation/index.html#ubuntu-debian). Use ppa:ubuntugis/ubuntugis-unstable
for PostGIS 2.0.
Try one of
apt-get remove postgis
apt-get remove postgresql-9.1-postgis
apt-get install postgresql-9.1-postgis
I couldn’t remove and install because of dependencies error.
After a few attmpts, I just removed postgresql-9.1-postgis
and apt-get offer me upgrade it to 2.0.
answered Jan 10, 2014 at 12:57
1
I had the same problem on my Window 8.1 setup.
I solved it by simply using Application StackBuilder
which comes with Postgres and installing PostGIS again (despite not having uninstalled it)
Works fine now!
answered Sep 10, 2014 at 14:41
CodyBugsteinCodyBugstein
20.9k59 gold badges200 silver badges351 bronze badges
0
In C:Program FilesPostgreSQL9.4 I found uninstall-postgis-bundle-pg94x64-2.1.5-2.exe. Running that fixed my problem, which was caused by a reinstall of PostgreSQL without first uninstalling, and without installing PostGIS the second time around. That’s what happens when you more than one person installing stuff..
answered Mar 26, 2015 at 9:18
Make sure that you have installed this
sudo apt-get install postgresql-9.3-postgis
I was facing same issue due to missing this package.
answered Sep 24, 2014 at 12:34
Try this
apt-get install postgis
answered Sep 4, 2018 at 6:01
Susaj S NSusaj S N
9001 gold badge9 silver badges22 bronze badges
0
CentOS needs a different package for this problem. For CentOS 6, if you’re using the PGDG yum repository at http://yum.pgdgrpms.org/9.3/redhat/, install the postgresql93-contrib package with the command ‘yum install postgresql93-contrib.
Update and edit as necessary for PostgreSQL 9.4.
answered Dec 1, 2014 at 20:06
I had my worst nightmare while installing Postgis 2.X on SLES 12 SP1. which doesnt have compatible package in zypper repo
Here is how is resolved it on my Postgres server instance running 9.4.X
Prerequsite packages which i have installed prior to PostGis based on the errors
Proj 4 Download source cold, Build --> make install
install Gdal andjibson by adding zypper repo zypper addrepo http://download.opensuse.org/repositories/Application:Geo/SLE_12_SP1_Backports/Application:Geo.repo
zypper install gdal gdal-devel libjson-c-devel libjson
Installing Postgis
Download postgis source code (http://download.osgeo.org/postgis/source/postgis-2.3.0rc1.tar.gz)
Go to Postgis folder
./configure --with-pgconfig=/usr/lib/postgresql94/bin/pg_config --with-geosconfig=/usr/local/bin/geos-config
make
make install
now if you goto postgress DB and create extension postgis; it will work
Important while configuring you should specify pg-config path and geosconfig path and You SHOULD NOT include «without Raster» as RASTER plays main role in creating the postgis extension
answered Sep 21, 2016 at 5:36
this work for me
SELECT PostGIS_full_version();
To create postgisis run above query in query panel
And for remove postgis from your database run bellow query
drop extension postgis
answered May 10, 2017 at 10:09
Sameer KaziSameer Kazi
16.9k2 gold badges34 silver badges46 bronze badges
if you are using windows system download the postgis.bundle.exe
and manually install in C:/(PostgreSQLdirectory/version/ )
and that’s all .
answered Nov 1, 2017 at 16:00
2
I am receiving this error when I create extension postgis;
:
SQL Error [58P01]: ERROR: could not open extension control file
«C:/POSTGR~1/10.5/pg10/../pg10/share/postgresql/extension/postgis.control»:
No such file or directory
The cause appears to be an incorrect path (an extra postgresql). It should be:
"C:/POSTGR~1/10.5/pg10/../pg10/share/extension/postgis.control"
This PostGIS installer that I used is: http://download.osgeo.org/postgis/windows/pg10/postgis-bundle-pg10x64-setup-2.5.0-1.exe
And I am running PostgreSQL 10.5 on x86_64-pc-mingw64, compiled by gcc.exe (Rev5, Built by MSYS2 project) 4.9.2, 64-bit
While my question is a near duplicate of https://gis.stackexchange.com/a/71476/31, the issue is specific to PostgreSQL 10/PostGIS 2.5, and I don’t think the answer is necessarily the same (since there is no spatial_ref_sys.sql file).
Is there way to correct the error? If not, which files in the extension directory have to run (and in which order) to create the PostGIS extension?
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and
privacy statement. We’ll occasionally send you account related emails.
Already on GitHub?
Sign in
to your account
Comments
Hi,
I tried to run CREATE EXTENSION postgis;
on the image mdillon/postgis:9.4
from the docker hub. It complained that it couldn’t find the file /usr/share/postgresql/9.4/extension/postgis.control
running bash inside the container reveals that in fact this file exists!
I already tried the following things:
- building from this repository
- changing ownership of
/usr/share/postgresql/9.4/extension/
to thepostgres
user (RUN chown -R postgres:postgres /usr/share/postgresql/9.4/extension/
)
Could you please look into this?
Cheers
How did you run the CREATE EXTENSION
statement? Did you connect to the container with psql
or did you do something else?
Copy link
Contributor
Author
I am using fig (http://fig.sh) for running a ruby on rails app which uses postgis. When I am running fig run app rake db:migrate
rails tries to create the posgis extension with CREATE EXTENSION postgis;
which then fails.
I just tested this successfully:
$ docker pull mdillon/postgis:9.4
# Time passes...
$ docker run -d --name some-postgis -e POSTGRES_PASSWORD=p mdillon/postgis:9.4
4825867790a1583c8bd9c58498ed876197795166855c513fca501d7c78a53f83
$ docker run -it --link some-postgis:postgres --rm postgres
sh -c 'exec env PGPASSWORD="$POSTGRES_ENV_POSTGRES_PASSWORD"
psql -h "$POSTGRES_PORT_5432_TCP_ADDR"
-p "$POSTGRES_PORT_5432_TCP_PORT" -U postgres'
psql (9.4.0, server 9.4.1)
Type "help" for help.
postgres=# create database postgis;
CREATE DATABASE
postgres=# c postgis
psql (9.4.0, server 9.4.1)
You are now connected to database "postgis" as user "postgres".
postgis=# create extension postgis;
CREATE EXTENSION
Can you post your fig.yml
? It might also be relevant to find out what version of Fig you’re using, but probably not.
Copy link
Contributor
Author
fig --version
returns fig 1.0.0
my fig.yml is
db: image: mdillon/postgis:9.4 ports: - "5432" environment: - POSTGRES_PASSWORD=yoloswag app: build: . links: - db environment: - RAILS_ENV=production - DEVISE_SECRET_KEY=swaghettiYolonaise - SECRET_KEY_BASE=swaghettiYolonaise - OAUTH_FACEBOOK_KEY=swaghettiYolonaise - OAUTH_FACEBOOK_SECRET=swaghettiYolonaise - OAUTH_TWITTER_KEY=swaghettiYolonaise - OAUTH_TWITTER_SECRET=swaghettiYolonaise - OAUTH_GOOGLE_KEY=swaghettiYolonaise - OAUTH_GOOGLE_SECRET=swaghettiYolonaise - HOSTNAME=localhost:3000 - SMTP_HOST=smtp.mandrillapp.com - SMTP_PORT=25 - SMTP_USER=SOMEUSER - SMTP_PASSWORD=SOMEPASS - EMAIL_FROM=some-email@provider.com - SENTRY_DSN=http://localhost
the dockerfile for the app
installs postgresql-client
I can’t see anything there that would affect whether or not the extension control file would be found or readable by the Postgres process.
Any chance you could post the exact error you get back when you run fig run app rake db:migrate
? You may also want to look at what fig logs db
has to say after the failure.
Copy link
Contributor
Author
the error rails produces:
== 20140418190245 CreateFeatures: migrating ===================================
-- enable_extension("postgis")
rake aborted!
StandardError: An error has occurred, this and all later migrations canceled:
PG::UndefinedFile: ERROR: could not open extension control file "/usr/share/postgresql/9.4/extension/postgis.control": No such file or directory
: CREATE EXTENSION IF NOT EXISTS "postgis"/usr/local/bundle/gems/activerecord-4.1.9/lib/active_record/connection_adapters/postgresql_adapter.rb:822:in `async_exec'
/usr/local/bundle/gems/activerecord-4.1.9/lib/active_record/connection_adapters/postgresql_adapter.rb:822:in `block in exec_no_cache'
/usr/local/bundle/gems/activerecord-4.1.9/lib/active_record/connection_adapters/abstract_adapter.rb:373:in `block in log'
/usr/local/bundle/gems/activesupport-4.1.9/lib/active_support/notifications/instrumenter.rb:20:in `instrument'
/usr/local/bundle/gems/activerecord-4.1.9/lib/active_record/connection_adapters/abstract_adapter.rb:367:in `log'
/usr/local/bundle/gems/activerecord-4.1.9/lib/active_record/connection_adapters/postgresql_adapter.rb:822:in `exec_no_cache'
/usr/local/bundle/gems/activerecord-4.1.9/lib/active_record/connection_adapters/postgresql/database_statements.rb:137:in `exec_query'
/usr/local/bundle/gems/activerecord-4.1.9/lib/active_record/connection_adapters/postgresql_adapter.rb:663:in `enable_extension'
/usr/local/bundle/gems/activerecord-4.1.9/lib/active_record/migration.rb:656:in `block in method_missing'
/usr/local/bundle/gems/activerecord-4.1.9/lib/active_record/migration.rb:628:in `block in say_with_time'
/usr/local/bundle/gems/activerecord-4.1.9/lib/active_record/migration.rb:628:in `say_with_time'
/usr/local/bundle/gems/activerecord-4.1.9/lib/active_record/migration.rb:648:in `method_missing'
/usr/src/app/db/migrate/20140418190245_create_features.rb:3:in `change'
/usr/local/bundle/gems/activerecord-4.1.9/lib/active_record/migration.rb:602:in `exec_migration'
/usr/local/bundle/gems/activerecord-4.1.9/lib/active_record/migration.rb:586:in `block (2 levels) in migrate'
/usr/local/bundle/gems/activerecord-4.1.9/lib/active_record/migration.rb:585:in `block in migrate'
/usr/local/bundle/gems/activerecord-4.1.9/lib/active_record/connection_adapters/abstract/connection_pool.rb:294:in `with_connection'
/usr/local/bundle/gems/activerecord-4.1.9/lib/active_record/migration.rb:584:in `migrate'
/usr/local/bundle/gems/activerecord-4.1.9/lib/active_record/migration.rb:759:in `migrate'
/usr/local/bundle/gems/activerecord-4.1.9/lib/active_record/migration.rb:998:in `block in execute_migration_in_transaction'
/usr/local/bundle/gems/activerecord-4.1.9/lib/active_record/migration.rb:1044:in `block in ddl_transaction'
/usr/local/bundle/gems/activerecord-4.1.9/lib/active_record/connection_adapters/abstract/database_statements.rb:201:in `block in transaction'
/usr/local/bundle/gems/activerecord-4.1.9/lib/active_record/connection_adapters/abstract/database_statements.rb:209:in `within_new_transaction'
/usr/local/bundle/gems/activerecord-4.1.9/lib/active_record/connection_adapters/abstract/database_statements.rb:201:in `transaction'
/usr/local/bundle/gems/activerecord-4.1.9/lib/active_record/transactions.rb:208:in `transaction'
/usr/local/bundle/gems/activerecord-4.1.9/lib/active_record/migration.rb:1044:in `ddl_transaction'
/usr/local/bundle/gems/activerecord-4.1.9/lib/active_record/migration.rb:997:in `execute_migration_in_transaction'
/usr/local/bundle/gems/activerecord-4.1.9/lib/active_record/migration.rb:959:in `block in migrate'
/usr/local/bundle/gems/activerecord-4.1.9/lib/active_record/migration.rb:955:in `each'
/usr/local/bundle/gems/activerecord-4.1.9/lib/active_record/migration.rb:955:in `migrate'
/usr/local/bundle/gems/activerecord-4.1.9/lib/active_record/migration.rb:814:in `up'
/usr/local/bundle/gems/activerecord-4.1.9/lib/active_record/migration.rb:792:in `migrate'
/usr/local/bundle/gems/activerecord-4.1.9/lib/active_record/railties/databases.rake:34:in `block (2 levels) in <top (required)>'
ActiveRecord::StatementInvalid: PG::UndefinedFile: ERROR: could not open extension control file "/usr/share/postgresql/9.4/extension/postgis.control": No such file or directory
: CREATE EXTENSION IF NOT EXISTS "postgis"
/usr/local/bundle/gems/activerecord-4.1.9/lib/active_record/connection_adapters/postgresql_adapter.rb:822:in `async_exec'
/usr/local/bundle/gems/activerecord-4.1.9/lib/active_record/connection_adapters/postgresql_adapter.rb:822:in `block in exec_no_cache'
/usr/local/bundle/gems/activerecord-4.1.9/lib/active_record/connection_adapters/abstract_adapter.rb:373:in `block in log'
/usr/local/bundle/gems/activesupport-4.1.9/lib/active_support/notifications/instrumenter.rb:20:in `instrument'
/usr/local/bundle/gems/activerecord-4.1.9/lib/active_record/connection_adapters/abstract_adapter.rb:367:in `log'
/usr/local/bundle/gems/activerecord-4.1.9/lib/active_record/connection_adapters/postgresql_adapter.rb:822:in `exec_no_cache'
/usr/local/bundle/gems/activerecord-4.1.9/lib/active_record/connection_adapters/postgresql/database_statements.rb:137:in `exec_query'
/usr/local/bundle/gems/activerecord-4.1.9/lib/active_record/connection_adapters/postgresql_adapter.rb:663:in `enable_extension'
/usr/local/bundle/gems/activerecord-4.1.9/lib/active_record/migration.rb:656:in `block in method_missing'
/usr/local/bundle/gems/activerecord-4.1.9/lib/active_record/migration.rb:628:in `block in say_with_time'
/usr/local/bundle/gems/activerecord-4.1.9/lib/active_record/migration.rb:628:in `say_with_time'
/usr/local/bundle/gems/activerecord-4.1.9/lib/active_record/migration.rb:648:in `method_missing'
/usr/src/app/db/migrate/20140418190245_create_features.rb:3:in `change'
/usr/local/bundle/gems/activerecord-4.1.9/lib/active_record/migration.rb:602:in `exec_migration'
/usr/local/bundle/gems/activerecord-4.1.9/lib/active_record/migration.rb:586:in `block (2 levels) in migrate'
/usr/local/bundle/gems/activerecord-4.1.9/lib/active_record/migration.rb:585:in `block in migrate'
/usr/local/bundle/gems/activerecord-4.1.9/lib/active_record/connection_adapters/abstract/connection_pool.rb:294:in `with_connection'
/usr/local/bundle/gems/activerecord-4.1.9/lib/active_record/migration.rb:584:in `migrate'
/usr/local/bundle/gems/activerecord-4.1.9/lib/active_record/migration.rb:759:in `migrate'
/usr/local/bundle/gems/activerecord-4.1.9/lib/active_record/migration.rb:998:in `block in execute_migration_in_transaction'
/usr/local/bundle/gems/activerecord-4.1.9/lib/active_record/migration.rb:1044:in `block in ddl_transaction'
/usr/local/bundle/gems/activerecord-4.1.9/lib/active_record/connection_adapters/abstract/database_statements.rb:201:in `block in transaction'
/usr/local/bundle/gems/activerecord-4.1.9/lib/active_record/connection_adapters/abstract/database_statements.rb:209:in `within_new_transaction'
/usr/local/bundle/gems/activerecord-4.1.9/lib/active_record/connection_adapters/abstract/database_statements.rb:201:in `transaction'
/usr/local/bundle/gems/activerecord-4.1.9/lib/active_record/transactions.rb:208:in `transaction'
/usr/local/bundle/gems/activerecord-4.1.9/lib/active_record/migration.rb:1044:in `ddl_transaction'
/usr/local/bundle/gems/activerecord-4.1.9/lib/active_record/migration.rb:997:in `execute_migration_in_transaction'
/usr/local/bundle/gems/activerecord-4.1.9/lib/active_record/migration.rb:959:in `block in migrate'
/usr/local/bundle/gems/activerecord-4.1.9/lib/active_record/migration.rb:955:in `each'
/usr/local/bundle/gems/activerecord-4.1.9/lib/active_record/migration.rb:955:in `migrate'
/usr/local/bundle/gems/activerecord-4.1.9/lib/active_record/migration.rb:814:in `up'
/usr/local/bundle/gems/activerecord-4.1.9/lib/active_record/migration.rb:792:in `migrate'
/usr/local/bundle/gems/activerecord-4.1.9/lib/active_record/railties/databases.rake:34:in `block (2 levels) in <top (required)>'
PG::UndefinedFile: ERROR: could not open extension control file "/usr/share/postgresql/9.4/extension/postgis.control": No such file or directory
/usr/local/bundle/gems/activerecord-4.1.9/lib/active_record/connection_adapters/postgresql_adapter.rb:822:in `async_exec'
/usr/local/bundle/gems/activerecord-4.1.9/lib/active_record/connection_adapters/postgresql_adapter.rb:822:in `block in exec_no_cache'
/usr/local/bundle/gems/activerecord-4.1.9/lib/active_record/connection_adapters/abstract_adapter.rb:373:in `block in log'
/usr/local/bundle/gems/activesupport-4.1.9/lib/active_support/notifications/instrumenter.rb:20:in `instrument'
/usr/local/bundle/gems/activerecord-4.1.9/lib/active_record/connection_adapters/abstract_adapter.rb:367:in `log'
/usr/local/bundle/gems/activerecord-4.1.9/lib/active_record/connection_adapters/postgresql_adapter.rb:822:in `exec_no_cache'
/usr/local/bundle/gems/activerecord-4.1.9/lib/active_record/connection_adapters/postgresql/database_statements.rb:137:in `exec_query'
/usr/local/bundle/gems/activerecord-4.1.9/lib/active_record/connection_adapters/postgresql_adapter.rb:663:in `enable_extension'
/usr/local/bundle/gems/activerecord-4.1.9/lib/active_record/migration.rb:656:in `block in method_missing'
/usr/local/bundle/gems/activerecord-4.1.9/lib/active_record/migration.rb:628:in `block in say_with_time'
/usr/local/bundle/gems/activerecord-4.1.9/lib/active_record/migration.rb:628:in `say_with_time'
/usr/local/bundle/gems/activerecord-4.1.9/lib/active_record/migration.rb:648:in `method_missing'
/usr/src/app/db/migrate/20140418190245_create_features.rb:3:in `change'
/usr/local/bundle/gems/activerecord-4.1.9/lib/active_record/migration.rb:602:in `exec_migration'
/usr/local/bundle/gems/activerecord-4.1.9/lib/active_record/migration.rb:586:in `block (2 levels) in migrate'
/usr/local/bundle/gems/activerecord-4.1.9/lib/active_record/migration.rb:585:in `block in migrate'
/usr/local/bundle/gems/activerecord-4.1.9/lib/active_record/connection_adapters/abstract/connection_pool.rb:294:in `with_connection'
/usr/local/bundle/gems/activerecord-4.1.9/lib/active_record/migration.rb:584:in `migrate'
/usr/local/bundle/gems/activerecord-4.1.9/lib/active_record/migration.rb:759:in `migrate'
/usr/local/bundle/gems/activerecord-4.1.9/lib/active_record/migration.rb:998:in `block in execute_migration_in_transaction'
/usr/local/bundle/gems/activerecord-4.1.9/lib/active_record/migration.rb:1044:in `block in ddl_transaction'
/usr/local/bundle/gems/activerecord-4.1.9/lib/active_record/connection_adapters/abstract/database_statements.rb:201:in `block in transaction'
/usr/local/bundle/gems/activerecord-4.1.9/lib/active_record/connection_adapters/abstract/database_statements.rb:209:in `within_new_transaction'
/usr/local/bundle/gems/activerecord-4.1.9/lib/active_record/connection_adapters/abstract/database_statements.rb:201:in `transaction'
/usr/local/bundle/gems/activerecord-4.1.9/lib/active_record/transactions.rb:208:in `transaction'
/usr/local/bundle/gems/activerecord-4.1.9/lib/active_record/migration.rb:1044:in `ddl_transaction'
/usr/local/bundle/gems/activerecord-4.1.9/lib/active_record/migration.rb:997:in `execute_migration_in_transaction'
/usr/local/bundle/gems/activerecord-4.1.9/lib/active_record/migration.rb:959:in `block in migrate'
/usr/local/bundle/gems/activerecord-4.1.9/lib/active_record/migration.rb:955:in `each'
/usr/local/bundle/gems/activerecord-4.1.9/lib/active_record/migration.rb:955:in `migrate'
/usr/local/bundle/gems/activerecord-4.1.9/lib/active_record/migration.rb:814:in `up'
/usr/local/bundle/gems/activerecord-4.1.9/lib/active_record/migration.rb:792:in `migrate'
/usr/local/bundle/gems/activerecord-4.1.9/lib/active_record/railties/databases.rake:34:in `block (2 levels) in <top (required)>'
Tasks: TOP => db:migrate
(See full trace by running task with --trace)
and fig logs db
...
db_1 | LOG: received smart shutdown request
db_1 | LOG: autovacuum launcher shutting down
db_1 | LOG: shutting down
db_1 | LOG: database system is shut down
db_1 | LOG: database system was shut down at 2015-02-14 00:01:24 UTC
db_1 | LOG: autovacuum launcher started
db_1 | LOG: database system is ready to accept connections
db_1 | ERROR: could not open extension control file "/usr/share/postgresql/9.4/extension/postgis.control": No such file or directory
db_1 | STATEMENT: CREATE EXTENSION IF NOT EXISTS "postgis"
And you said you were able to confirm that /usr/share/postgresql/9.4/extension/postgis.control
exists with that exact path? Could you provide the output of docker exec $CONTAINERID ls -l /usr/share/postgresql/9.4/extension/postgis.control
?
BTW, you probably don’t want that ports: "5432"
. That’s exposing your container Postgres on the Docker host’s IP with a random port. The linked container will work directly with port 5432 inside the container with the ports
declaration.
Copy link
Contributor
Author
It seems fig doesn’t recognize changes in the fig yml. Earlier I had image: postgres
and now it starts the postgres image After I changed the name of the db to postgis fig recognized the different image. It now works
Sorry I’ve bothered you This is a flaw in fig.
Glad you figured it out. Since we took the time to debug it, it may be worth seeing if the issue has been reported at https://github.com/docker/fig
md5
mentioned this issue
Feb 16, 2015
2 participants
Warning: session_start(): Cannot start session when headers already sent in /qa-include/app/users.php on line 162
Warning: Cannot modify header information — headers already sent by (output started at /qa-include/qa-base.php:1170) in /qa-include/app/users.php on line 1282
Notice: Trying to access array offset on value of type null in /qa-include/pages/question-view.php on line 1131
Warning: Cannot modify header information — headers already sent by (output started at /qa-include/qa-base.php:1170) in /qa-include/app/page.php on line 356
Unable to create PostGIS extension in pgAdmin — RiverGIS Q&A
asked
Nov 25, 2016
by
edited
Nov 25, 2016
Hello all,
I’m following the instructions provided on the RiverGIS website, but have been getting issues right at the start. When I try to create the PostGIS extensions from the SQL query editor, I get the following error message:
ERROR: could not open extension control file «C:/Program Files/PostgreSQL/9.6/share/extension/postgis.control»: No such file or directory
********** Error **********
ERROR: could not open extension control file «C:/Program Files/PostgreSQL/9.6/share/extension/postgis.control»: No such file or directory
SQL state: 58P01
I have tried the install on two different computers, Windows 10, and keep getting this issue. Can anyone help?
Thanks,
Mix
Your answer
…
У меня был худший кошмар при установке Postgis 2.X на SLES 12 SP1. у которого нет совместимого пакета в репозитории zypper
Вот как это решается на моем экземпляре сервера Postgres под управлением 9.4.X
Предварительные пакеты, которые я установил до PostGis на основе ошибок
Proj 4 Download source cold, Build --> make install
install Gdal andjibson by adding zypper repo zypper addrepo http://download.opensuse.org/repositories/Application:Geo/SLE_12_SP1_Backports/Application:Geo.repo
zypper install gdal gdal-devel libjson-c-devel libjson
Установка Постгиса
Download postgis source code (http://download.osgeo.org/postgis/source/postgis-2.3.0rc1.tar.gz)
Go to Postgis folder
./configure --with-pgconfig=/usr/lib/postgresql94/bin/pg_config --with-geosconfig=/usr/local/bin/geos-config
make
make install
теперь, если вы перейдете к базе данных postgress и создадите расширение postgis; это будет работать
Важнo при настройке вы должны указать путь pg-config и путь geosconfig, и НЕ ДОЛЖНЫ включать «без растра», так как RASTER играет основную роль в создании расширения postgis
Hi @bk211
There are several issues with your setup. When you check psql on the Advanced tab, it fails sooner as we first check its presence, and indeed psql is not available on the DSS image by default. When you uncheck it, your SQL script just fails later on the destination Postgres instance because of missing binaries there. So here are items you need to fix:
1) Missing postgis.control binary on the destination PostgreSQL docker container.
ERROR: could not open extension control file "/usr/share/postgresql/13/extension/postgis.control": No such file or directory
To get this fixed you will need to have PostGIS installed (or build a new image from the base one with PostGIS installed) on the destination PostgreSQL container.
2) Missing psql binary on the DSS container:
Cannot run program "psql": error=2, No such file or directory, caused by: IOException: error=2, No such file or directory
You will need to install psql or rebuild the DSS image with installing it during docker runtime so it will be available via PATH.
Here my DSS image with psql installed:
git:(master) ✗ docker exec -it dss_psql /bin/bash
[dataiku@f9a00b233ef1 ~]$ psql -V
psql (PostgreSQL) 13.3
And here are two recipe execution snippets (with and without psql) executed on the separate PostgreSQL container:
# WITH psql:
[22:37:15] [INFO] [dku.flow.sql] - SQL runner running
[22:37:15] [INFO] [dku.flow.sql] - Executing with psql: psql -h postgres -U dataiku -f /home/dataiku/dss/jobs/DKU_TUTORIAL_AUTOMATION/Build_PSQL_test_2021-07-02T22-37-14.441/compute_PSQL_test_NP/sql-recipe/script.sql -p 5432 dataiku --set ON_ERROR_STOP=1
[22:37:15] [INFO] [dku.utils] - CREATE TABLE
# NO psql (JDBC driver used):
[22:42:22] [INFO] [dku.flow.sql] - SQL runner running
[22:42:22] [INFO] [dku.connections.sql.provider] - Connecting to jdbc:postgresql://postgres:5432/dataiku with props: {"user":"dataiku","password":"***"} conn=postgres-YgVHs56
[22:42:22] [DEBUG] [dku.connections.sql.driver] - Driver version 9.0
[22:42:22] [INFO] [dku.connections.sql.provider] - Driver: PostgreSQL Native Driver (JDBC 4.0) PostgreSQL 9.0 JDBC4 (build 801) (9.0)
3) You don’t need to upload any PostgreSQL drivers to DSS as indeed we bundle one by default. The above test confirms that.
Нет такого файла или каталога
-
Crackfox
- Активный участник
- Сообщения: 131
- Зарегистрирован: 02 мар 2016, 20:29
- Репутация: 17
- Ваше звание: разрядник
- Откуда: Москва
- Контактная информация:
Нет такого файла или каталога
Добрый день!
Пытаюсь накатить миграции из django.
В ответ получаю postgresql’вский визг
Код: Выделить всё
ERROR: could not access file "$libdir/postgis-2.2": Нет такого файла или каталога
postgis установлен, обновлен, определен в проекте. Не понятно что ему надобно.
Имеем: Mint 18.3, postgresql 9.5.14, django 2.1.5
-
gamm
- Гуру
- Сообщения: 3822
- Зарегистрирован: 15 окт 2010, 08:33
- Репутация: 996
- Ваше звание: программист
- Откуда: Казань
Re: Нет такого файла или каталога
Сообщение
gamm » 24 янв 2019, 16:20
Crackfox писал(а): ↑
24 янв 2019, 16:12
$libdir
посмотреть, что в этой переменной окружения (через параметры уиндовс). И посмотреть, существует ли соответствующий путь.
-
Crackfox
- Активный участник
- Сообщения: 131
- Зарегистрирован: 02 мар 2016, 20:29
- Репутация: 17
- Ваше звание: разрядник
- Откуда: Москва
- Контактная информация:
Re: Нет такого файла или каталога
Сообщение
Crackfox » 25 янв 2019, 12:30
Конфликт никак не лечился, интернеты не помогли. Помогла переустановка постгреса.
Дальше оффтоп:
В процессе установки столкнулся с такой шляпой
Код: Выделить всё
could not open extension control file "/usr/pgsql-9.3/share/extension/postgis.control": No such file or directory
лечится установкой данного пакета:
Код: Выделить всё
sudo apt-get install postgresql-9.6-postgis-scripts