[GRASSLIST:234] Re: Postgresql connectivity

Glynn Clements glynn.clements at virgin.net
Tue May 27 17:30:34 EDT 2003


Uttam Kumar wrote:

> hi,
>    I am currently working on Linux 7.1 platform with GRASS 5.0.0 environment 
> and Postgresql as database. I have created my login and password.GRASS is 
> working fine.When I want to work on database, I login as root (su and 
> password) in the GRASS prompt and then type the following line :
> /home/vaish/bin/postmaster -i -p 5432 -D /home/vaish/psqldata >logfile 2>&1 &
> where postmaster is in /home/vaish/bin directory and psqldatabase is in 
> /home/vaish directory (in my system).
> After executing the above line, I exit the root (through Ctrl-D) and try to 
> access a database by the command g.select.pg.
> By executing the command "g.select.pg database=test"  (for example taking 
> 'test' as a database). I get the following error:
> 
> Error: select Postgres:could not connect to server:Connection refused
>        IS the server runningon host localhost and accepting
>        TCP/IP connections on port 5432?
> Although g.select.pg -l is working fine and is displaying all the databases 
> in the  UNIX catalogue.
> 
> What is this error ?

I suspect that g.select.pg is attempting to use a TCP connection, but
the server isn't configured to accept it.

There is a known issue with the database handling: once you specify a
hostname via "g.select.pg host=...", the only way to revert to a local
connection (Unix domain socket) is to manually remove the PG_HOST
entry from the ~/.grassrc5 file.

-- 
Glynn Clements <glynn.clements at virgin.net>




More information about the grass-user mailing list