<!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>
What is the result of a <BR>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ps ax | grep pos <BR>
<BR>
in an bash shell ?<BR>
<BR>
Le jeudi 16 octobre 2008 &#224; 20:38 +0200, Stanislav Bek a &#233;crit&nbsp;:
<BLOCKQUOTE TYPE=CITE>
<PRE>
<FONT COLOR="#000000">I have uncommented a restarted the server, but db.test is again not OK.</FONT>
<FONT COLOR="#000000">socket is also 5433... ?</FONT>

<FONT COLOR="#000000">this is part of my .conf file:</FONT>
<FONT COLOR="#000000">#------------------------------------------------------------------------------</FONT>
<FONT COLOR="#000000"># CONNECTIONS AND AUTHENTICATION</FONT>
<FONT COLOR="#000000">#------------------------------------------------------------------------------</FONT>

<FONT COLOR="#000000"># - Connection Settings -</FONT>

<FONT COLOR="#000000">listen_addresses = 'localhost'                # what IP address(es) to listen on;</FONT>
<FONT COLOR="#000000">                                        # comma-separated list of addresses;</FONT>
<FONT COLOR="#000000">                                        # defaults to 'localhost', '*' = all</FONT>
<FONT COLOR="#000000">                                        # (change requires restart)</FONT>
<FONT COLOR="#000000">port = 5433                                # (change requires restart)</FONT>
<FONT COLOR="#000000">max_connections = 100                        # (change requires restart)</FONT>
<FONT COLOR="#000000"># Note:  Increasing max_connections costs ~400 bytes of shared memory per </FONT>
<FONT COLOR="#000000"># connection slot, plus lock space (see max_locks_per_transaction).  You might</FONT>
<FONT COLOR="#000000"># also need to raise shared_buffers to support more connections.</FONT>
<FONT COLOR="#000000">#superuser_reserved_connections = 3        # (change requires restart)</FONT>
<FONT COLOR="#000000">unix_socket_directory = '/var/run/postgresql'                # (change requires restart)</FONT>
<FONT COLOR="#000000">#unix_socket_group = ''                        # (change requires restart)</FONT>
<FONT COLOR="#000000">unix_socket_permissions = 0777                # begin with 0 to use octal notation</FONT>
<FONT COLOR="#000000">                                        # (change requires restart)</FONT>
<FONT COLOR="#000000">#bonjour_name = ''                        # defaults to the computer name</FONT>
<FONT COLOR="#000000">                                        # (change requires restart)</FONT>






<FONT COLOR="#000000">______________________________________________________________</FONT>
<FONT COLOR="#000000">&gt; Od: <A HREF="mailto:benoit.andre@bcgeol.be">benoit.andre@bcgeol.be</A></FONT>
<FONT COLOR="#000000">&gt; Komu: Stanislav Bek &amp;lt;<A HREF="mailto:bks@centrum.cz">bks@centrum.cz</A>&amp;gt;</FONT>
<FONT COLOR="#000000">&amp;gt; CC: <A HREF="mailto:glynn@gclements.plus.com">glynn@gclements.plus.com</A>, <A HREF="mailto:grass-user@lists.osgeo.org">grass-user@lists.osgeo.org</A></FONT>
<FONT COLOR="#000000">&gt; Datum: 16.10.2008 19:29</FONT>
<FONT COLOR="#000000">&gt; P&#345;edm&#283;t: Re: [GRASS-user] connect to postgreSQL</FONT>
<FONT COLOR="#000000">&gt;</FONT>
<FONT COLOR="#000000">&gt;Try to uncomment the line (cut out the #)</FONT>
<FONT COLOR="#000000">&gt;</FONT>
<FONT COLOR="#000000">&gt;#unix_socket_permissions = 0777                # begin with 0 to use octal notation</FONT>
<FONT COLOR="#000000">&gt;</FONT>
<FONT COLOR="#000000">&gt;to make it active, but I don't the problem is there</FONT>
<FONT COLOR="#000000">&gt;</FONT>
<FONT COLOR="#000000">&gt;Or look at the socket : 5432 or 5433.  The 'normal' socket of psql is</FONT>
<FONT COLOR="#000000">&gt;5432.</FONT>
<FONT COLOR="#000000">&gt;</FONT>
<FONT COLOR="#000000">&gt;And also : in the first lines of postgresql.conf, there is a line like</FONT>
<FONT COLOR="#000000">&gt;this (the adress is in my case) : </FONT>
<FONT COLOR="#000000">&gt;</FONT>
<FONT COLOR="#000000">&gt;listen_addresses = '192.168.10.1'</FONT>
<FONT COLOR="#000000">&gt;</FONT>
<FONT COLOR="#000000">&gt;Is this line uncomment (without the #) ? And what are the adresses ?</FONT>
<FONT COLOR="#000000">&gt;</FONT>
<FONT COLOR="#000000">&gt;Benoit.</FONT>
<FONT COLOR="#000000">&gt;</FONT>
<FONT COLOR="#000000">&gt;Le jeudi 16 octobre 2008 &#224; 18:54 +0200, Stanislav Bek a &#233;crit :</FONT>
<FONT COLOR="#000000">&gt;</FONT>
<FONT COLOR="#000000">&gt;&gt; &gt;&gt; I have problem to connect to postgreSQL server from grass.</FONT>
<FONT COLOR="#000000">&gt;&gt; &gt;&gt; </FONT>
<FONT COLOR="#000000">&gt;&gt; &gt;&gt; GRASS 6.3.0 (opava):~ &gt; psql -l</FONT>
<FONT COLOR="#000000">&gt;&gt; &gt;&gt;         List of databases</FONT>
<FONT COLOR="#000000">&gt;&gt; &gt;&gt;    Name    |  Owner   | Encoding </FONT>
<FONT COLOR="#000000">&gt;&gt; &gt;&gt; -----------+----------+----------</FONT>
<FONT COLOR="#000000">&gt;&gt; &gt;&gt;  gis1      | bekas    | UTF8</FONT>
<FONT COLOR="#000000">&gt;&gt; &gt;&gt;  postgres  | postgres | UTF8</FONT>
<FONT COLOR="#000000">&gt;&gt; &gt;&gt;  template0 | postgres | UTF8</FONT>
<FONT COLOR="#000000">&gt;&gt; &gt;&gt;  template1 | postgres | UTF8</FONT>
<FONT COLOR="#000000">&gt;&gt; &gt;&gt; (4 rows)</FONT>
<FONT COLOR="#000000">&gt;&gt; &gt;&gt; </FONT>
<FONT COLOR="#000000">&gt;&gt; &gt;&gt; GRASS 6.3.0 (opava):~ &gt; db.connect driver=pg database=gis1 </FONT>
<FONT COLOR="#000000">&gt;&gt; &gt;&gt; </FONT>
<FONT COLOR="#000000">&gt;&gt; &gt;&gt; GRASS 6.3.0 (opava):~ &gt; db.test test=test1</FONT>
<FONT COLOR="#000000">&gt;&gt; &gt;&gt; create table grass_test1 (i1 integer, d1 double precision, c1 varchar(20))</FONT>
<FONT COLOR="#000000">&gt;&gt; &gt;&gt; DBMI-Postgres driver error:</FONT>
<FONT COLOR="#000000">&gt;&gt; &gt;&gt; Cannot connect to Postgres: could not connect to server: No such file or directory</FONT>
<FONT COLOR="#000000">&gt;&gt; &gt;&gt;         Is the server running locally and accepting</FONT>
<FONT COLOR="#000000">&gt;&gt; &gt;&gt;         connections on Unix domain socket &quot;/var/run/postgresql/.s.PGSQL.5432&quot;?</FONT>
<FONT COLOR="#000000">&gt;&gt; &gt;</FONT>
<FONT COLOR="#000000">&gt;&gt; &gt;Try:</FONT>
<FONT COLOR="#000000">&gt;&gt; &gt;</FONT>
<FONT COLOR="#000000">&gt;&gt; &gt;        db.connect driver=pg database=&quot;host=localhost,dbname=gis1&quot;</FONT>
<FONT COLOR="#000000">&gt;&gt; </FONT>
<FONT COLOR="#000000">&gt;&gt; With this, it does not work yet.</FONT>
<FONT COLOR="#000000">&gt;&gt; </FONT>
<FONT COLOR="#000000">&gt;&gt; &gt;</FONT>
<FONT COLOR="#000000">&gt;&gt; &gt;to connect using TCP.</FONT>
<FONT COLOR="#000000">&gt;&gt; &gt;</FONT>
<FONT COLOR="#000000">&gt;&gt; &gt;Also, &quot;netstat -ax&quot; will list active Unix-domain sockets. If</FONT>
<FONT COLOR="#000000">&gt;&gt; &gt;postmaster is accepting local (Unix-domain) connections, its socket</FONT>
<FONT COLOR="#000000">&gt;&gt; &gt;will be listed there. E.g. I have:</FONT>
<FONT COLOR="#000000">&gt;&gt; &gt;</FONT>
<FONT COLOR="#000000">&gt;&gt; &gt;unix  2      [ ACC ]     STREAM     LISTENING     3442     /tmp/.s.PGSQL.5432</FONT>
<FONT COLOR="#000000">&gt;&gt; &gt;</FONT>
<FONT COLOR="#000000">&gt;&gt; &gt;If it's listening on a Unix-domain socket, check that you have the</FONT>
<FONT COLOR="#000000">&gt;&gt; &gt;necessary permissions on both the socket and its parent directories.</FONT>
<FONT COLOR="#000000">&gt;&gt; &gt;</FONT>
<FONT COLOR="#000000">&gt;&gt; &gt;-- </FONT>
<FONT COLOR="#000000">&gt;&gt; &gt;Glynn Clements &lt;<A HREF="mailto:glynn@gclements.plus.com">glynn@gclements.plus.com</A>&gt;</FONT>
<FONT COLOR="#000000">&gt;&gt; </FONT>
<FONT COLOR="#000000">&gt;&gt; </FONT>
<FONT COLOR="#000000">&gt;&gt; So I've done:</FONT>
<FONT COLOR="#000000">&gt;&gt; </FONT>
<FONT COLOR="#000000">&gt;&gt; GRASS 6.3.0 (opava):~/skripty &gt; netstat -ax| grep post</FONT>
<FONT COLOR="#000000">&gt;&gt; unix  2      [ ACC ]     STREAM     LISTENING     13460    /var/run/postgresql/.s.PGSQL.5433</FONT>
<FONT COLOR="#000000">&gt;&gt; sudo chmod 777  /var/run/postgresql/.s.PGSQL.5433</FONT>
<FONT COLOR="#000000">&gt;&gt; sudo chmod 777  /var/run/postgresql/</FONT>
<FONT COLOR="#000000">&gt;&gt; </FONT>
<FONT COLOR="#000000">&gt;&gt; in postgresql.conf there is a line:</FONT>
<FONT COLOR="#000000">&gt;&gt; #unix_socket_permissions = 0777                # begin with 0 to use octal notation</FONT>
<FONT COLOR="#000000">&gt;&gt; </FONT>
<FONT COLOR="#000000">&gt;&gt; After that:  db.test test=test1 again without success.</FONT>
<FONT COLOR="#000000">&gt;&gt; </FONT>
<FONT COLOR="#000000">&gt;&gt; Thank you very much for your help.</FONT>
<FONT COLOR="#000000">&gt;&gt; Best regards,</FONT>
<FONT COLOR="#000000">&gt;&gt; Stanislav </FONT>
<FONT COLOR="#000000">&gt;&gt; </FONT>
<FONT COLOR="#000000">&gt;&gt; </FONT>
<FONT COLOR="#000000">&gt;&gt; </FONT>
<FONT COLOR="#000000">&gt;&gt; </FONT>
<FONT COLOR="#000000">&gt;&gt; </FONT>
<FONT COLOR="#000000">&gt;&gt; </FONT>
<FONT COLOR="#000000">&gt;&gt; </FONT>
<FONT COLOR="#000000">&gt;&gt; </FONT>
<FONT COLOR="#000000">&gt;&gt; </FONT>
<FONT COLOR="#000000">&gt;&gt; _______________________________________________</FONT>
<FONT COLOR="#000000">&gt;&gt; grass-user mailing list</FONT>
<FONT COLOR="#000000">&gt;&gt; <A HREF="mailto:grass-user@lists.osgeo.org">grass-user@lists.osgeo.org</A></FONT>
<FONT COLOR="#000000">&gt;&gt; <A HREF="http://lists.osgeo.org/mailman/listinfo/grass-user">http://lists.osgeo.org/mailman/listinfo/grass-user</A></FONT>
<FONT COLOR="#000000">&gt;</FONT>
<FONT COLOR="#000000">&gt;Benoit ANDRE</FONT>
<FONT COLOR="#000000">&gt;G&#233;ologue - Hydrologue</FONT>
<FONT COLOR="#000000">&gt;</FONT>
<FONT COLOR="#000000">&gt;</FONT>
<FONT COLOR="#000000">&gt;________________________________________________________________________</FONT>
<FONT COLOR="#000000">&gt;</FONT>
<FONT COLOR="#000000">&gt;</FONT>
<FONT COLOR="#000000">&gt;</FONT>
<FONT COLOR="#000000">&gt;</FONT>
<FONT COLOR="#000000">&gt;</FONT>
<FONT COLOR="#000000">&gt;Bureau Conseil en G&#233;ologie</FONT>
<FONT COLOR="#000000">&gt;Rue de Leuze, 433</FONT>
<FONT COLOR="#000000">&gt;B-5300 VEZIN</FONT>
<FONT COLOR="#000000">&gt;BELGIQUE</FONT>
<FONT COLOR="#000000">&gt;</FONT>
<FONT COLOR="#000000">&gt;T&#233;l.: +32 81 58 26 11</FONT>
<FONT COLOR="#000000">&gt;Fax.: +32 81 58 26 12</FONT>
<FONT COLOR="#000000">&gt;Contacter...</FONT>
<FONT COLOR="#000000">&gt;Bureau Conseil en G&#233;ologie </FONT>
<FONT COLOR="#000000">&gt;________________________________________________________________________</FONT>
<FONT COLOR="#000000">&gt;</FONT>
<FONT COLOR="#000000">&gt;</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:1224186641.10968.2.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>