[GRASS-dev] [GRASS GIS] #3806: db.copy: fails with pg as to_driver

#3806: db.copy: fails with pg as to_driver
----------------------+-------------------------
Reporter: sbl | Owner: grass-dev@…
     Type: defect | Status: new
Priority: normal | Milestone: 7.8.0
Component: Database | Version: unspecified
Keywords: db.copy | CPU: Unspecified
Platform: Linux |
----------------------+-------------------------
db.copy fails to open a pg connection.

Tried syntax from the example as well as syntax as used in v.out.ogr.

Might make sense to unify the way DB connection strings are handled in
different modules... As the pg driver usage in db.copyis inconsistent with
e.g. v.in.ogr or v.out.ogr.

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

#3806: db.copy: fails with pg as to_driver
--------------------------+-------------------------
  Reporter: sbl | Owner: grass-dev@…
      Type: defect | Status: new
  Priority: normal | Milestone: 7.8.0
Component: Database | Version: unspecified
Resolution: | Keywords: db.copy
       CPU: Unspecified | Platform: Linux
--------------------------+-------------------------

Comment (by mmetz):

Replying to [ticket:3806 sbl]:
> db.copy fails to open a pg connection.

The pg connection needs to be registered first with db.login
>
> Tried syntax from the example as well as syntax as used in v.out.ogr.
>
> Might make sense to unify the way DB connection strings are handled in
different modules... As the pg driver usage in db.copyis inconsistent with
e.g. v.in.ogr or v.out.ogr.

v.[in|out].ogr use the OGR syntax which is different from the GRASS
syntax. In GRASS, you only need to specify the driver and the database
name, whereas in OGR you need to use a syntax like
"PG:"dbname='databasename' host='addr' port='5432' user='x' password='y'"

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

#3806: db.copy: fails with pg as to_driver
--------------------------+-------------------------
  Reporter: sbl | Owner: grass-dev@…
      Type: defect | Status: new
  Priority: normal | Milestone: 7.8.0
Component: Database | Version: unspecified
Resolution: | Keywords: db.copy
       CPU: Unspecified | Platform: Linux
--------------------------+-------------------------

Comment (by sbl):

Thanks for the info. Will try and update the manual accordingly as it
currently lacks info about the required db.login step...

It might be still worth considering to unify module syntax (e.g. using
whitespace instead of comma for separating elements of the connection
string) as well as using .pgpass file... Even if it is just minor
cosmetics, it would help making things a bit more intuitive...

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