Skip to content

Can't connect to PostGIS using st_read() #60

@jguelat

Description

@jguelat

I can't connect to my PostGIS database using the following command (the same dsn works with ogrinfo):

pol <- st_read("PG:dbname='gis' host='localhost' port=5432 user='mylogin' password='mypassword'", "p1")

I get the following error: Error in eval(substitute(expr), envir, enclos) : Open failed

However the following query is OK with st_read_db():

dbcon <- dbConnect(dbDriver("PostgreSQL"), dbname = "gis", host = "localhost", user = "mylogin", password = "mypassword")
pol <- st_read_db(dbcon, query = "select * from p1")

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions