Cidree / rpostgis

rpostgis: R Interface to a 'PostGIS' Database
http://cidree.github.io/rpostgis/
77 stars 14 forks source link

Error: PostGIS extension not available. (PostGIS is installed) #23

Closed minorsecond closed 4 years ago

minorsecond commented 4 years ago

I'm running R 4.0.01 with the latest rpostgis. I've verified that I have postgis installed on my PG server. SELECT PostGIS_Version() returns 3.0 USE_GEOS=1 USE_PROJ=1 USE_STATS=1.

When I run the following:

con <- dbConnect("PostgreSQL", dbname="ross_projects", host="192.168.3.21", user="rwardrup", password="REDACTED")
pgInsert(con, name=c("arlington_restaurants", "restaurant_locations"), data.obj = data, overwrite = TRUE)

I get Error in pgPostGIS(conn) : PostGIS extension not available. I'm able to run postgis queries straight on the DB, so I'm guessing that the postgis installation is fine. Is there anything I can check on the R side?

minorsecond commented 4 years ago

Fixed by dropping postgis from the DB, running sudo apt install --reinstall postgresql-10-postgis-3-scripts on the host, and recreating postgis extensions.