<!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>
ps ax | grep pos <BR>
<BR>
in an bash shell ?<BR>
<BR>
Le jeudi 16 octobre 2008 à 20:38 +0200, Stanislav Bek a écrit :
<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">> Od: <A HREF="mailto:benoit.andre@bcgeol.be">benoit.andre@bcgeol.be</A></FONT>
<FONT COLOR="#000000">> Komu: Stanislav Bek &lt;<A HREF="mailto:bks@centrum.cz">bks@centrum.cz</A>&gt;</FONT>
<FONT COLOR="#000000">&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">> Datum: 16.10.2008 19:29</FONT>
<FONT COLOR="#000000">> Předmět: Re: [GRASS-user] connect to postgreSQL</FONT>
<FONT COLOR="#000000">></FONT>
<FONT COLOR="#000000">>Try to uncomment the line (cut out the #)</FONT>
<FONT COLOR="#000000">></FONT>
<FONT COLOR="#000000">>#unix_socket_permissions = 0777                # begin with 0 to use octal notation</FONT>
<FONT COLOR="#000000">></FONT>
<FONT COLOR="#000000">>to make it active, but I don't the problem is there</FONT>
<FONT COLOR="#000000">></FONT>
<FONT COLOR="#000000">>Or look at the socket : 5432 or 5433. The 'normal' socket of psql is</FONT>
<FONT COLOR="#000000">>5432.</FONT>
<FONT COLOR="#000000">></FONT>
<FONT COLOR="#000000">>And also : in the first lines of postgresql.conf, there is a line like</FONT>
<FONT COLOR="#000000">>this (the adress is in my case) : </FONT>
<FONT COLOR="#000000">></FONT>
<FONT COLOR="#000000">>listen_addresses = '192.168.10.1'</FONT>
<FONT COLOR="#000000">></FONT>
<FONT COLOR="#000000">>Is this line uncomment (without the #) ? And what are the adresses ?</FONT>
<FONT COLOR="#000000">></FONT>
<FONT COLOR="#000000">>Benoit.</FONT>
<FONT COLOR="#000000">></FONT>
<FONT COLOR="#000000">>Le jeudi 16 octobre 2008 à 18:54 +0200, Stanislav Bek a écrit :</FONT>
<FONT COLOR="#000000">></FONT>
<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">>> </FONT>
<FONT COLOR="#000000">>> With this, it does not work yet.</FONT>
<FONT COLOR="#000000">>> </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">>> </FONT>
<FONT COLOR="#000000">>> </FONT>
<FONT COLOR="#000000">>> So I've done:</FONT>
<FONT COLOR="#000000">>> </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">>> </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">>> </FONT>
<FONT COLOR="#000000">>> After that: db.test test=test1 again without success.</FONT>
<FONT COLOR="#000000">>> </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">>> </FONT>
<FONT COLOR="#000000">>> </FONT>
<FONT COLOR="#000000">>> </FONT>
<FONT COLOR="#000000">>> </FONT>
<FONT COLOR="#000000">>> </FONT>
<FONT COLOR="#000000">>> </FONT>
<FONT COLOR="#000000">>> </FONT>
<FONT COLOR="#000000">>> </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>
<FONT COLOR="#000000">></FONT>
<FONT COLOR="#000000">>Benoit ANDRE</FONT>
<FONT COLOR="#000000">>Géologue - Hydrologue</FONT>
<FONT COLOR="#000000">></FONT>
<FONT COLOR="#000000">></FONT>
<FONT COLOR="#000000">>________________________________________________________________________</FONT>
<FONT COLOR="#000000">></FONT>
<FONT COLOR="#000000">></FONT>
<FONT COLOR="#000000">></FONT>
<FONT COLOR="#000000">></FONT>
<FONT COLOR="#000000">></FONT>
<FONT COLOR="#000000">>Bureau Conseil en Géologie</FONT>
<FONT COLOR="#000000">>Rue de Leuze, 433</FONT>
<FONT COLOR="#000000">>B-5300 VEZIN</FONT>
<FONT COLOR="#000000">>BELGIQUE</FONT>
<FONT COLOR="#000000">></FONT>
<FONT COLOR="#000000">>Tél.: +32 81 58 26 11</FONT>
<FONT COLOR="#000000">>Fax.: +32 81 58 26 12</FONT>
<FONT COLOR="#000000">>Contacter...</FONT>
<FONT COLOR="#000000">>Bureau Conseil en Géologie </FONT>
<FONT COLOR="#000000">>________________________________________________________________________</FONT>
<FONT COLOR="#000000">></FONT>
<FONT COLOR="#000000">></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: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é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>