[GRASS-dev] [GRASS GIS] #2626: v.out.ogr does not suggest db.connect and db.login when not set

#2626: v.out.ogr does not suggest db.connect and db.login when not set
-------------------------------------------+--------------------------------
Reporter: wenzeslaus | Owner: grass-dev@…
     Type: defect | Status: new
Priority: normal | Milestone: 7.1.0
Component: Vector | Version: svn-trunk
Keywords: PostgreSQL, postgres, PostGIS | Platform: Linux
      Cpu: Unspecified |
-------------------------------------------+--------------------------------
When there is no connection set using `db.connect` or authentication using
`db.login`, `v.out.ogr` does not say what's wrong. Instead a misleading
(?) error about database creation is shown:

{{{
$ v.out.ogr in=lakes@PERMANENT output=PG:dbname=gis format=PostgreSQL
type=area
ERROR 1: PQconnectdb failed.
could not connect to server: No such file or directory
         Is the server running locally and accepting
         connections on Unix domain socket
"/var/run/postgresql/.s.PGSQL.5432"?

ERROR 1: PostgreSQL driver doesn't currently support database creation.
Please create database with the `createdb' command.
ERROR: Unable to open OGR data source 'PG:dbname=gis'
}}}

Executing `db.connect` and `db.login` actually does not solve the problem
for me: `db.tables -p` lists tables but `v.out.ogr` still says the same. I
suppose this might be my problem, I might have misinterpreted the manual,
but in any case the initial message is wrong.

The special thing about my environment is that I'm using PostgreSQL
database in a Docker container from
[https://registry.hub.docker.com/u/kartoza/postgis/ kartoza/postgis]. I
used their steps to run it and `psql` works for me (in GRASS session):

{{{
psql -h localhost -U docker -p 25432 -l
}}}

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/2626&gt;
GRASS GIS <http://grass.osgeo.org>

#2626: v.out.ogr does not suggest db.connect and db.login when not set
-------------------------------------------+--------------------------------
Reporter: wenzeslaus | Owner: grass-dev@…
     Type: defect | Status: new
Priority: normal | Milestone: 7.1.0
Component: Vector | Version: svn-trunk
Keywords: PostgreSQL, postgres, PostGIS | Platform: Linux
      Cpu: Unspecified |
-------------------------------------------+--------------------------------

Comment(by neteler):

Small note: The error message comes from OGR, not GRASS GIS (here a random
link to a similar problem: http://lists.osgeo.org/pipermail/gdal-
dev/2012-November/034530.html).

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/2626#comment:1&gt;
GRASS GIS <http://grass.osgeo.org>

#2626: v.out.ogr does not suggest db.connect and db.login when not set
-------------------------------------------+--------------------------------
Reporter: wenzeslaus | Owner: martinl
     Type: defect | Status: assigned
Priority: normal | Milestone: 7.1.0
Component: Vector | Version: svn-trunk
Keywords: PostgreSQL, postgres, PostGIS | Platform: Linux
      Cpu: Unspecified |
-------------------------------------------+--------------------------------
Changes (by martinl):

* cc: grass-dev@… (added)
  * owner: grass-dev@… => martinl
  * status: new => assigned

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/2626#comment:2&gt;
GRASS GIS <http://grass.osgeo.org>