GithubHelp home page GithubHelp logo

Comments (9)

edzer avatar edzer commented on August 10, 2024 1
                                                   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.

dnbucklin avatar dnbucklin commented on August 10, 2024

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.

edzer avatar edzer commented on August 10, 2024

(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.

basille avatar basille commented on August 10, 2024

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.

edzer avatar edzer commented on August 10, 2024
  name   | default_version | installed_version |                               comment                               
---------+-----------------+-------------------+---------------------------------------------------------------------
 postgis | 2.2.2           |                   | PostGIS geometry, geography, and raster spatial types and functions

from rpostgis.

dnbucklin avatar dnbucklin commented on August 10, 2024

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.

dnbucklin avatar dnbucklin commented on August 10, 2024

Ok, thanks. The method for enabling PostGIS since PostgreSQL 9.1/PostGIS 2.0 is using the CREATE EXTENSION postgis; call:

http://postgis.net/install/

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.

edzer avatar edzer commented on August 10, 2024

Maybe close this when you're done?

from rpostgis.

dnbucklin avatar dnbucklin commented on August 10, 2024

issue resolved on master (tag = v1.0.1), install using:

library(devtools)
install_github("mablab/rpostgis")

from rpostgis.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.