Comments (9)
version
--------------------------------------------------------------------------------------------------------------
PostgreSQL 9.3.14 on x86_64-unknown-linux-gnu, compiled by gcc (Ubuntu 4.8.4-2ubuntu1~14.04.3) 4.8.4, 64-bit
Looking at the dates of files, I believe I installed with the following script:
# script to create a postgis-enabled database
USER=edzer
DB=postgis
DIR=/usr/share/postgresql/9.3/contrib/postgis-2.2
dropdb --if-exists $DB
createdb $DB
createlang plpgsql $DB
psql -d $DB -f $DIR/postgis.sql
psql -d $DB -f $DIR/postgis_comments.sql
psql -d $DB -f $DIR/spatial_ref_sys.sql
psql -d $DB -f $DIR/rtpostgis.sql
psql -d $DB -f $DIR/raster_comments.sql
psql -d $DB -f $DIR/topology.sql
psql -d $DB -f $DIR/topology_comments.sql
from rpostgis.
The functions use pgPostGIS
to check if the PostGIS extension is installed in the database (if it isn't, then it tries to run the SQL CREATE EXTENSION postgis;
Try to run pgPostGIS(conn)
and see if you get the same error.
I'm guessing that maybe you have an older version of PostgreSQL/PostGIS installed, based on this reference:
http://gis.stackexchange.com/questions/112592/installed-postgis-extension-not-listed-for-database
from rpostgis.
(your link is missing)
select PostGIS_full_version();
gives me
POSTGIS="2.2.2 r14797" GEOS="3.5.0-CAPI-1.9.0 r4084" PROJ="Rel. 4.8.0, 6 March 2012" GDAL="GDAL 2.1.0, released 2016/04/25" LIBXML="2.9.1" LIBJSON="0.11.99" TOPOLOGY RASTER
and pgPostGIS(conn)
gives me
Installing PostGIS extension version 2.2.2:
Query executed:
CREATE EXTENSION postgis;
--
Error in postgresqlExecStatement(conn, statement, ...) :
RS-DBI driver: (could not Retrieve the result : ERROR: PostGIS is already installed in schema 'public', uninstall it first
)
from rpostgis.
Hey Edzer,
Thanks for the feedback! Can you give us the result of:
SELECT * FROM pg_available_extensions
WHERE name LIKE 'postgis';
Thanks.
from rpostgis.
name | default_version | installed_version | comment
---------+-----------------+-------------------+---------------------------------------------------------------------
postgis | 2.2.2 | | PostGIS geometry, geography, and raster spatial types and functions
from rpostgis.
Hi Edzer,
The result of your previous query is odd, given that PostGIS is installed (based on your SELECT postgis_full_versions();
result. Did you install/upgrade PostGIS from source, or use the method
CREATE EXTENSION postgis
to enable Postgis? If it is standard for "installed_version" to be empty when PostGIS is actually installed (but not through the CREATE EXTENSION
method, we will have to account for that.
Also could you provide your Postgresql version? (select version();
)
David
from rpostgis.
Ok, thanks. The method for enabling PostGIS since PostgreSQL 9.1/PostGIS 2.0 is using the CREATE EXTENSION postgis;
call:
Which will register it correctly in the pg_extension catalog and allow for easy upgrades using (e.g.):
ALTER EXTENSION postgis
UPDATE TO "2.2.x";
Since your situation appears to be normal when installing by calling the script directly, I'll alter rpostgis to account for this situation...
David
from rpostgis.
Maybe close this when you're done?
from rpostgis.
issue resolved on master (tag = v1.0.1), install using:
library(devtools)
install_github("mablab/rpostgis")
from rpostgis.
Related Issues (20)
- pgInsert hang with SPDF HOT 12
- ERROR: Geometry type (Polygon) does not match column type (MultiPolygon) HOT 3
- pgWriteRast SnapToGrid causes Raster resizing and mismatch HOT 2
- SSL mode with RPostgreSQL driver HOT 5
- pgInsert: No column name matches found in database table. HOT 2
- Support for RPostgres connection HOT 3
- Lines in raster after importing from Database HOT 7
- Feature Request: add clauses functionality to pgGetRast HOT 6
- terra support HOT 4
- pgGetRast() error HOT 3
- Error: PostGIS extension not available. (PostGIS is installed) HOT 1
- pgGetGeom() other.cols = TRUE by default restarts session HOT 1
- pgInsert using `sf` objects HOT 3
- Using "out db" cloud rasters for Cloud Optimize GeoTiff HOT 4
- Please remove dependencies on **rgdal**, **rgeos**, and/or **maptools** HOT 14
- About the future of `rpostgis` HOT 10
- dbSchema() returns NULL instead of FALSE when schema does not exist in database HOT 1
- pgWriteGeom() fails when writing a data frame with a timestamp column HOT 2
- Problem to install version 1.4.3 rpostgis in docker HOT 1
- temporary view in pgGetGeom
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rpostgis.