[GRASSLIST:8797] Re: switching to postgres

Stephan Holl holl at gdf-hannover.de
Fri Oct 28 04:38:42 EDT 2005


Hello Kirk, 

On Thu, 27 Oct 2005 13:23:23 -0500 "Kirk R. Wythers" <kwythers at umn.edu>
wrote:

> When switching from dbf to postgresql, besides these steps:
> 
> PostgreSQL database
> 
> To (re)set GRASS to connect to PostgreSQL, run:
> 
> 
> #define database settings:
> db.connect driver=pg database="host=myserver.itc.it,dbname=mydb"
> 
> #define login settings:
> db.login user=myname pass=secret
> 
> #list available tables
> db.tables -p
> 
> 
> Do the database and tables need to be created in with CREATE
> DATABASE and CREATE TABLE in postgresql before you set the connection
> with db.connect and v.db.connect?

AFAIK the database needs to be created before. If you would just
copying your existing tables to PG, you should consider using db.copy
and reconnect the newly created tables in PG with your dataset (with
v.db.connect)

> 
> Also, for some reason, the host argument on my system only seems to  
> work if I use "host=localhost". Is that ok?

I think this depends on your PG-configuration, but I am not sure. Check
your pg_hba.conf for this.

Best
	Stephan


-- 
GDF Hannover - Solutions for spatial data analysis and remote sensing
Hannover Office      -     Mengendamm 16d      -     D-30177 Hannover
Internet: www.gdf-hannover.de      -      Email: holl at gdf-hannover.de
Phone : ++49-(0)511.39088507       -        Fax: ++49-(0)511.39088508




More information about the grass-user mailing list