[GRASS-user] Finding why postgres database cannot be opened
Rich Shepard
rshepard at appl-ecosys.com
Thu Nov 8 06:07:26 PST 2018
On Thu, 8 Nov 2018, st_kiefer at web.de wrote:
> if you use a postgres database (driver=pg) you have to specify the full
> connection string to the database. You can see this in the manual for
> db.connect (look for PostgreSQL):
Stefan,
Each time I think that I have the path requirement differences between
db.connect and v.db.connect understood there's aninstance when I mix them up
unintentionally. I've changed the db.connect line in the script to use
localhost rather than the absolute path.
As I responded to Markus M, I don't know how to fix the absolute path
returned by v.db.connect
> db.connect driver=pg database="host=localhost,dbname=willamette-river-hg"
> db.connect -p
driver: pg
database: host=localhost,dbname=willamette-river-hg
schema:
group:
> v.db.connect -p map=stations
Vector map <stations> is connected by:
layer <1/stations> table <stations> in database
</home/rshepard/data/grassdata/willamette_basin/willamette-river-hg> through
driver <pg> with key <cat>
Trying again:
> db.connect driver=pg database=$HOME/data/grassdata/willamette_basin/willamette-river-hg
> v.db.connect -p map=stations
Vector map <stations> is connected by:
layer <1/stations> table <stations> in database
</home/rshepard/data/grassdata/willamette_basin/willamette-river-hg> through
driver <pg> with key <cat>
What am I still doing incorrectly with db.connect?
Thanks,
Rich
More information about the grass-user
mailing list