[GRASS-user] connect to postgreSQL

Jhon Ortiz eljhonjhon at hotmail.com
Sat Oct 4 12:43:41 EDT 2008


> On 04/10/08 16:39, Stanislav Bek wrote:
>> Hi,
>> 
>> I have problem to connect to postgreSQL server from grass.
>> 
>> GRASS 6.3.0 (opava):~> psql -l
>>         List of databases
>>    Name    |  Owner   | Encoding 
>> -----------+----------+----------
>>  gis1      | bekas    | UTF8
>>  postgres  | postgres | UTF8
>>  template0 | postgres | UTF8
>>  template1 | postgres | UTF8
>> (4 rows)
>> 
>> GRASS 6.3.0 (opava):~> db.connect driver=pg database=gis1 
>> 
>> GRASS 6.3.0 (opava):~> db.test test=test1
>> create table grass_test1 (i1 integer, d1 double precision, c1 varchar(20))
>> DBMI-Postgres driver error:
>> Cannot connect to Postgres: could not connect to server: No such file or directory
>> 	Is the server running locally and accepting
>> 	connections on Unix domain socket "/var/run/postgresql/.s.PGSQL.5432"?

in the error said, the server is running locally..

Try

GRASS 6.3.0 (opava):~> db.connect driver=pg database="host=localhost,dbname=gis1"
db.login user=your user  pass=your password 
db.connect -p
db.tables -p

if not is connection posible. follow you the advice Moritz

John

>> 
>> 
>> ERROR: Unable to open database 
>> ERROR: EXECUTE: ******** ERROR ********
>> 
>> etc.
>> 
>> I use PostgreSQL 8.3.3.
>> 
>> Don't you have an idea why it is not working?
> 
> The error message is quite clear:
> 
> "could not connect to server: No such file or directory
>   	Is the server running locally and accepting
>   	connections on Unix domain socket "/var/run/postgresql/.s.PGSQL.5432"?"
> 
> This is a PostgreSQL issue (you will probably get the same message if 
> you try to connect with 'psql -h localhost gis1').
> 
> This means that PostgreSQL is not installed to accept connections via 
> tcp/. You can change that in the relevant config file (probably 
> something like /etc/postgresql/8.3/main/postgresql.conf - but that 
> depends on your distribution).
> 
> Moritz
> _______________________________________________
> grass-user mailing list
> grass-user at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/grass-user

_________________________________________________________________
¡Entra en el Club oficial de Messenger y te enterarás de todas las novedades! 
http://www.vivelive.com/ilovemessenger


More information about the grass-user mailing list