1

This is a follow up on a previous question on the storage of vectors layers imported from PostGIS.

To importing a spatial table from PostGIS I use, sucessfully, the following formulation with v.in.ogr:

> v.in.ogr input="PG:host=pg-server dbname=dsm user=duque004 password=secret" layer="observations.profiles" output=profiles -o
Over-riding projection check
Check if OGR layer <observations.profiles> contains polygons...
ERROR 1: Could not fetch SRS: 
 100%
Creating attribute table for layer <observations.profiles>...
Importing 141584 features (OGR layer <observations.profiles>)...
 100%
-----------------------------------------------------
Building topology for vector map <profiles@test>...
Registering primitives...

But if I feed the same parameters to db.in.ogr, it fails to find the table:

> db.in.ogr input="PG:host=pg-server dbname=dsm user=duque004 password=secret" db_table="observations.profiles" output=profiles
ERROR: Unable to open data source <observations.profiles>
ERROR: Input table <observations.profiles> not found or not
       readable

What is going on here?

Edit: these outputs report to GRASS 7.6.0

Update 01-05-2019: This issue is now reported in ticket 3836.

  • in your PG: portion, can you try to add schemas=observations and then just use db_table=profiles – SaultDon Mar 22 at 23:19
  • Please tell us which GRASS GIS version you use – markusN Mar 24 at 21:31
  • @SaultDon schemas is not a valid parameter; neither is schema. – Luís de Sousa Mar 26 at 9:14
  • @markusN I am working with GRASS 7.6.0, I updated the answer. – Luís de Sousa Mar 26 at 9:15
0

I think you are hit by a SQL restriction:

No dots are allowed as SQL does not support '.' (dots) in table names.

See also the related help text at:

https://grass.osgeo.org/grass76/manuals/sql.html#database-table-name-restrictions

  • observations is the name of the schema where the table resides; the name of the table in question is simply profiles. As far asI know, there is no other way to pass the database schema in the connection string. In Postgres and Oracle every table must be in a schema, this dot might not be avoidable. – Luís de Sousa Apr 25 at 11:48
  • I'd suggest to open a ticket at trac.osgeo.org/grass to get this clarified. – markusN Apr 25 at 15:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.