db.connect driver=pg database=“host=aaa,dbname=bbb” schema=administrative
db.login user=_____ ‘password=******’
db.connect -p
driver:pg
database:host=aaa,dbname=bbb
schema:administrative
group:
db.tables -p
…
administrative.test
…
v.in.ogr dsn=./ layer=test output=prova1
ERROR: Unable to open data source <./>
I’m using GRASS 6.4.0. Command such
v.in.ogr dsn=‘PG:host=aaa dbname=bbb user=____ password=*****’ output=prova layer=prova
worked since prova is in the public schema.
Hi,
I tried to import a postgis layer from a non public schema.
I used this commands according to the documentation
(http://grass.fbk.eu/gdp/html_grass64/v.in.ogr.html):
> db.connect driver=pg database="host=aaa,dbname=bbb"
schema=administrative
> db.login user=_____ 'password=******'
> db.connect -p
driver:pg
database:host=aaa,dbname=bbb
schema:administrative
group:
> db.tables -p
...
administrative.test
...
> v.in.ogr dsn=./ layer=test output=prova1
ERROR: Unable to open data source <./>
If you are trying to import from PostgreSQL, dsn shouldn't be './', or ?
Moritz
I'm using GRASS 6.4.0. Command such
v.in.ogr dsn='PG:host=aaa dbname=bbb user=____ password=*****'
output=prova layer=prova
worked since prova is in the public schema.
db.connect driver=pg database=“host=aaa,dbname=bbb”
schema=administrative
db.login user=_____ ‘password=******’
db.connect -p
driver:pg
database:host=aaa,dbname=bbb
schema:administrative
group:
db.tables -p
…
administrative.test
…
v.in.ogr dsn=./ layer=test output=prova1
ERROR: Unable to open data source <./>
If you are trying to import from PostgreSQL, dsn shouldn’t be ‘./’, or ?
Moritz
I’m using GRASS 6.4.0. Command such
v.in.ogr dsn=‘PG:host=aaa dbname=bbb user=____ password=*****’
output=prova layer=prova
worked since prova is in the public schema.
I'm using GRASS 6.4.0. Command such
v.in.ogr dsn='PG:host=aaa dbname=bbb user=____ password=*****' output=prova
layer=prova
worked since prova is in the public schema.
db.tables -p
…
administrative.test
…
v.in.ogr dsn=./ layer=test output=prova1
ERROR: Unable to open data source <./>
I’m using GRASS 6.4.0. Command such
v.in.ogr dsn=‘PG:host=aaa dbname=bbb user=____ password=*****’ output=prova
layer=prova
worked since prova is in the public schema.
`./` means that OGR tries to open current directory as a data-source.
AFAICT, the example of the man page is about importing a shapefile 'river' into GRASS using a PostgreSQL database backend, not about importing a PostGIS layer from PostgreSQL into GRASS. I agree that this is not very clear, though.
AFAIK db.connect and db.login do not make any difference for importing data from PostGIS.
In order to import data from a PostGIS database into GRASS using schemas, you have to use the active_schema parameter in the connection string, i.e. (using the PostGIS import example from the v.in.ogr man page):
Yes it works also in GRASS 6! I tried with a layer that wasn’t in the table geometry_columns of postgis, so it failed. With another one it works…
Moritz Lennert wrote:
In order to import data from a PostGIS database into GRASS using schemas, you have to use the active_schema parameter in the connection string, i.e. (using > the PostGIS import example from the v.in.ogr man page):