<!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.&nbsp; 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 &#224; 18:54 +0200, Stanislav Bek a &#233;crit&nbsp;:
<BLOCKQUOTE TYPE=CITE>
<PRE>
<FONT COLOR="#000000">&gt;&gt; I have problem to connect to postgreSQL server from grass.</FONT>
<FONT COLOR="#000000">&gt;&gt; </FONT>
<FONT COLOR="#000000">&gt;&gt; GRASS 6.3.0 (opava):~ &gt; psql -l</FONT>
<FONT COLOR="#000000">&gt;&gt;         List of databases</FONT>
<FONT COLOR="#000000">&gt;&gt;    Name    |  Owner   | Encoding </FONT>
<FONT COLOR="#000000">&gt;&gt; -----------+----------+----------</FONT>
<FONT COLOR="#000000">&gt;&gt;  gis1      | bekas    | UTF8</FONT>
<FONT COLOR="#000000">&gt;&gt;  postgres  | postgres | UTF8</FONT>
<FONT COLOR="#000000">&gt;&gt;  template0 | postgres | UTF8</FONT>
<FONT COLOR="#000000">&gt;&gt;  template1 | postgres | UTF8</FONT>
<FONT COLOR="#000000">&gt;&gt; (4 rows)</FONT>
<FONT COLOR="#000000">&gt;&gt; </FONT>
<FONT COLOR="#000000">&gt;&gt; GRASS 6.3.0 (opava):~ &gt; db.connect driver=pg database=gis1 </FONT>
<FONT COLOR="#000000">&gt;&gt; </FONT>
<FONT COLOR="#000000">&gt;&gt; GRASS 6.3.0 (opava):~ &gt; db.test test=test1</FONT>
<FONT COLOR="#000000">&gt;&gt; create table grass_test1 (i1 integer, d1 double precision, c1 varchar(20))</FONT>
<FONT COLOR="#000000">&gt;&gt; DBMI-Postgres driver error:</FONT>
<FONT COLOR="#000000">&gt;&gt; Cannot connect to Postgres: could not connect to server: No such file or directory</FONT>
<FONT COLOR="#000000">&gt;&gt;         Is the server running locally and accepting</FONT>
<FONT COLOR="#000000">&gt;&gt;         connections on Unix domain socket &quot;/var/run/postgresql/.s.PGSQL.5432&quot;?</FONT>
<FONT COLOR="#000000">&gt;</FONT>
<FONT COLOR="#000000">&gt;Try:</FONT>
<FONT COLOR="#000000">&gt;</FONT>
<FONT COLOR="#000000">&gt;        db.connect driver=pg database=&quot;host=localhost,dbname=gis1&quot;</FONT>

<FONT COLOR="#000000">With this, it does not work yet.</FONT>

<FONT COLOR="#000000">&gt;</FONT>
<FONT COLOR="#000000">&gt;to connect using TCP.</FONT>
<FONT COLOR="#000000">&gt;</FONT>
<FONT COLOR="#000000">&gt;Also, &quot;netstat -ax&quot; will list active Unix-domain sockets. If</FONT>
<FONT COLOR="#000000">&gt;postmaster is accepting local (Unix-domain) connections, its socket</FONT>
<FONT COLOR="#000000">&gt;will be listed there. E.g. I have:</FONT>
<FONT COLOR="#000000">&gt;</FONT>
<FONT COLOR="#000000">&gt;unix  2      [ ACC ]     STREAM     LISTENING     3442     /tmp/.s.PGSQL.5432</FONT>
<FONT COLOR="#000000">&gt;</FONT>
<FONT COLOR="#000000">&gt;If it's listening on a Unix-domain socket, check that you have the</FONT>
<FONT COLOR="#000000">&gt;necessary permissions on both the socket and its parent directories.</FONT>
<FONT COLOR="#000000">&gt;</FONT>
<FONT COLOR="#000000">&gt;-- </FONT>
<FONT COLOR="#000000">&gt;Glynn Clements &lt;<A HREF="mailto:glynn@gclements.plus.com">glynn@gclements.plus.com</A>&gt;</FONT>


<FONT COLOR="#000000">So I've done:</FONT>

<FONT COLOR="#000000">GRASS 6.3.0 (opava):~/skripty &gt; 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&#233;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&#233;ologie</B><BR>
Rue de Leuze, 433<BR>
<B><U>B-5300 VEZIN</U></B><BR>
<B><U>BELGIQUE</U></B><BR>
<BR>
T&#233;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&#233;ologie</A> 
<HR SIZE="4">

</TD>
</TR>
</TABLE>
</BODY>
</HTML>