[GRASS-user] Migrating to new RDBMS

Markus Metz markus.metz.giswork at gmail.com
Tue Oct 30 14:46:01 PDT 2018


On Tue, Oct 30, 2018 at 10:37 PM Rich Shepard <rshepard at appl-ecosys.com>
wrote:
>
> On Tue, 30 Oct 2018, Rich Shepard wrote:
>
> > I was thinking of working within grass rather than at the bash prompt.
> > You're right: I know the difference between double and single quotes but
> > blew it on this instance.
>
>    I'm still missing something.
>
>    From the grass shell the command, db.connect driver=pg
> database=willamette_river_hg, apparently completes because there's no
> warning or error displayed.

db.connect only sets the default database, it does not test if it exists or
is accessible. For PG, you need to use db.login first in order to actually
use the PG database.

HTH,

Markus M

>
>    However, the db.copy command still cannot find the database:
>
> GRASS 7.7.svn (willamette_basin):~/data/grassdata/willamette_basin >
db.copy from_driver=sqlite
from_database="$HOME/data/grassdata/willamette_basin/mercury/sqlite/sqlite.db"
from_table=all_species to_driver=pg to_database="willamette_river_hg"
to_table=all_species.pg
> DBMI-PostgreSQL driver error:
> Connection failed.
> FATAL:  database "willamette_river_hg" does not exist
>
> DBMI-PostgreSQL driver error:
> Connection failed.
> FATAL:  database "willamette_river_hg" does not exist
>
> WARNING: Unable to open database <willamette_river_hg> by driver <pg>
> no database is open
> no database is open
> WARNING: Copy table failed
>
>    I access the database with psql from the bash prompt with no issues:
>
> $ psql willamette-river-hg
> psql (10.3)
> Type "help" for help.
>
> willamette-river-hg=#
>
>    Germane to quotation marks, the examples on the db.copy page use both,
> sometimes in the same example.
>
> Regards,
>
> Rich
> _______________________________________________
> grass-user mailing list
> grass-user at lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/grass-user
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/grass-user/attachments/20181030/abf659de/attachment-0001.html>


More information about the grass-user mailing list