<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 TRANSITIONAL//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; CHARSET=UTF-8">
<META NAME="GENERATOR" CONTENT="GtkHTML/3.16.3">
</HEAD>
<BODY>
<BR>
Try to uncomment the line (cut out the #)<BR>
<BR>
<FONT COLOR="#000000">#unix_socket_permissions = 0777                # begin with 0 to use octal notation</FONT><BR>
<BR>
to make it active, but I don't the problem is there<BR>
<BR>
Or look at the socket : 5432 or 5433. The 'normal' socket of psql is 5432.<BR>
<BR>
And also : in the first lines of postgresql.conf, there is a line like this (the adress is in my case) : <BR>
<BR>
listen_addresses = '192.168.10.1'<BR>
<BR>
Is this line uncomment (without the #) ? And what are the adresses ?<BR>
<BR>
Benoit.<BR>
<BR>
Le jeudi 16 octobre 2008 à 18:54 +0200, Stanislav Bek a écrit :
<BLOCKQUOTE TYPE=CITE>
<PRE>
<FONT COLOR="#000000">>> I have problem to connect to postgreSQL server from grass.</FONT>
<FONT COLOR="#000000">>> </FONT>
<FONT COLOR="#000000">>> GRASS 6.3.0 (opava):~ > psql -l</FONT>
<FONT COLOR="#000000">>> List of databases</FONT>
<FONT COLOR="#000000">>> Name | Owner | Encoding </FONT>
<FONT COLOR="#000000">>> -----------+----------+----------</FONT>
<FONT COLOR="#000000">>> gis1 | bekas | UTF8</FONT>
<FONT COLOR="#000000">>> postgres | postgres | UTF8</FONT>
<FONT COLOR="#000000">>> template0 | postgres | UTF8</FONT>
<FONT COLOR="#000000">>> template1 | postgres | UTF8</FONT>
<FONT COLOR="#000000">>> (4 rows)</FONT>
<FONT COLOR="#000000">>> </FONT>
<FONT COLOR="#000000">>> GRASS 6.3.0 (opava):~ > db.connect driver=pg database=gis1 </FONT>
<FONT COLOR="#000000">>> </FONT>
<FONT COLOR="#000000">>> GRASS 6.3.0 (opava):~ > db.test test=test1</FONT>
<FONT COLOR="#000000">>> create table grass_test1 (i1 integer, d1 double precision, c1 varchar(20))</FONT>
<FONT COLOR="#000000">>> DBMI-Postgres driver error:</FONT>
<FONT COLOR="#000000">>> Cannot connect to Postgres: could not connect to server: No such file or directory</FONT>
<FONT COLOR="#000000">>>         Is the server running locally and accepting</FONT>
<FONT COLOR="#000000">>>         connections on Unix domain socket "/var/run/postgresql/.s.PGSQL.5432"?</FONT>
<FONT COLOR="#000000">></FONT>
<FONT COLOR="#000000">>Try:</FONT>
<FONT COLOR="#000000">></FONT>
<FONT COLOR="#000000">>        db.connect driver=pg database="host=localhost,dbname=gis1"</FONT>
<FONT COLOR="#000000">With this, it does not work yet.</FONT>
<FONT COLOR="#000000">></FONT>
<FONT COLOR="#000000">>to connect using TCP.</FONT>
<FONT COLOR="#000000">></FONT>
<FONT COLOR="#000000">>Also, "netstat -ax" will list active Unix-domain sockets. If</FONT>
<FONT COLOR="#000000">>postmaster is accepting local (Unix-domain) connections, its socket</FONT>
<FONT COLOR="#000000">>will be listed there. E.g. I have:</FONT>
<FONT COLOR="#000000">></FONT>
<FONT COLOR="#000000">>unix 2 [ ACC ] STREAM LISTENING 3442 /tmp/.s.PGSQL.5432</FONT>
<FONT COLOR="#000000">></FONT>
<FONT COLOR="#000000">>If it's listening on a Unix-domain socket, check that you have the</FONT>
<FONT COLOR="#000000">>necessary permissions on both the socket and its parent directories.</FONT>
<FONT COLOR="#000000">></FONT>
<FONT COLOR="#000000">>-- </FONT>
<FONT COLOR="#000000">>Glynn Clements <<A HREF="mailto:glynn@gclements.plus.com">glynn@gclements.plus.com</A>></FONT>
<FONT COLOR="#000000">So I've done:</FONT>
<FONT COLOR="#000000">GRASS 6.3.0 (opava):~/skripty > netstat -ax| grep post</FONT>
<FONT COLOR="#000000">unix 2 [ ACC ] STREAM LISTENING 13460 /var/run/postgresql/.s.PGSQL.5433</FONT>
<FONT COLOR="#000000">sudo chmod 777 /var/run/postgresql/.s.PGSQL.5433</FONT>
<FONT COLOR="#000000">sudo chmod 777 /var/run/postgresql/</FONT>
<FONT COLOR="#000000">in postgresql.conf there is a line:</FONT>
<FONT COLOR="#000000">#unix_socket_permissions = 0777                # begin with 0 to use octal notation</FONT>
<FONT COLOR="#000000">After that: db.test test=test1 again without success.</FONT>
<FONT COLOR="#000000">Thank you very much for your help.</FONT>
<FONT COLOR="#000000">Best regards,</FONT>
<FONT COLOR="#000000">Stanislav </FONT>
<FONT COLOR="#000000">_______________________________________________</FONT>
<FONT COLOR="#000000">grass-user mailing list</FONT>
<FONT COLOR="#000000"><A HREF="mailto:grass-user@lists.osgeo.org">grass-user@lists.osgeo.org</A></FONT>
<FONT COLOR="#000000"><A HREF="http://lists.osgeo.org/mailman/listinfo/grass-user">http://lists.osgeo.org/mailman/listinfo/grass-user</A></FONT>
</PRE>
</BLOCKQUOTE>
<TABLE CELLSPACING="0" CELLPADDING="0" WIDTH="100%">
<TR>
<TD>
<TABLE CELLSPACING="0" CELLPADDING="0" WIDTH="100%">
<TR>
<TD>
<B>Benoit ANDRE</B><BR>
<I>Géologue - Hydrologue</I>
</TD>
<TD ALIGN="right">
<A HREF="http://www.bcgeol.be"><IMG SRC="cid:1224178122.4555.98.camel@slump" ALIGN="middle" BORDER="0"></A>
</TD>
</TR>
</TABLE>
<HR SIZE="4">
<BR>
<BR>
<BR>
<BR>
<BR>
<BR>
<B>Bureau Conseil en Géologie</B><BR>
Rue de Leuze, 433<BR>
<B><U>B-5300 VEZIN</U></B><BR>
<B><U>BELGIQUE</U></B><BR>
<BR>
Tél.: +32 81 58 26 11<BR>
Fax.: +32 81 58 26 12<BR>
<A HREF="mailto:benoit.andre@bcgeol.be">Contacter...</A><BR>
<A HREF="http://www.bcgeol.be">Bureau Conseil en Géologie</A>
<HR SIZE="4">
</TD>
</TR>
</TABLE>
</BODY>
</HTML>