<!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>
Perhaps : check and adjust the port in the .conf file.<BR>
<BR>
Value in your .conf is port = <B>5433</B>, <BR>
<BR>
but message says no connection on <FONT COLOR="#000000">Is the server running locally and accepting</FONT> <FONT COLOR="#000000">connections on Unix domain socket "/var/run/postgresql/.s.PGSQL.</FONT><FONT COLOR="#000000"><B>5432</B></FONT> <FONT COLOR="#000000">?</FONT><BR>
<BR>
or try uncommenting the line<BR>
<BR>
<FONT COLOR="#000000">#listen_addresses = 'localhost'</FONT><BR>
<BR>
in the .conf file<BR>
<BR>
<BR>
<BR>
<BR>
Le samedi 04 octobre 2008 à 21:35 +0200, Stanislav Bek a écrit :
<BLOCKQUOTE TYPE=CITE>
<PRE>
<FONT COLOR="#000000">>> Hi,</FONT>
<FONT COLOR="#000000">>> > I have problem to connect to postgreSQL server from grass.</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">>> 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">>> > GRASS 6.3.0 (opava):~ > db.connect driver=pg database=gis1 > > 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">>> > > ERROR: Unable to open database <gis1></FONT>
<FONT COLOR="#000000">>> ERROR: EXECUTE: ******** ERROR ********</FONT>
<FONT COLOR="#000000">>> > etc.</FONT>
<FONT COLOR="#000000">>> > I use PostgreSQL 8.3.3.</FONT>
<FONT COLOR="#000000">>> > Don't you have an idea why it is not working?</FONT>
<FONT COLOR="#000000">></FONT>
<FONT COLOR="#000000">>The error message is quite clear:</FONT>
<FONT COLOR="#000000">></FONT>
<FONT COLOR="#000000">>"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">>This is a PostgreSQL issue (you will probably get the same message if you try to connect with 'psql -h localhost gis1').</FONT>
<FONT COLOR="#000000">'psql -h localhost gis1' works, I enter psql environment with this.</FONT>
<FONT COLOR="#000000">></FONT>
<FONT COLOR="#000000">>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).</FONT>
<FONT COLOR="#000000">I' ve tried to change some items but without success. (I am using Ubuntu Hardy Heron.)</FONT>
<FONT COLOR="#000000">I am sending the important part of the postgresql.conf file:</FONT>
<FONT COLOR="#000000">Thank you very much for your help.</FONT>
<FONT COLOR="#000000">#------------------------------------------------------------------------------</FONT>
<FONT COLOR="#000000"># FILE LOCATIONS</FONT>
<FONT COLOR="#000000">#------------------------------------------------------------------------------</FONT>
<FONT COLOR="#000000"># The default values of these variables are driven from the -D command-line</FONT>
<FONT COLOR="#000000"># option or PGDATA environment variable, represented here as ConfigDir.</FONT>
<FONT COLOR="#000000">data_directory = '/var/lib/postgresql/8.3/main'                # use data in another directory</FONT>
<FONT COLOR="#000000">                                        # (change requires restart)</FONT>
<FONT COLOR="#000000">hba_file = '/etc/postgresql/8.3/main/pg_hba.conf'        # host-based authentication file</FONT>
<FONT COLOR="#000000">                                        # (change requires restart)</FONT>
<FONT COLOR="#000000">ident_file = '/etc/postgresql/8.3/main/pg_ident.conf'        # ident configuration file</FONT>
<FONT COLOR="#000000">                                        # (change requires restart)</FONT>
<FONT COLOR="#000000"># If external_pid_file is not explicitly set, no extra PID file is written.</FONT>
<FONT COLOR="#000000">external_pid_file = '/var/run/postgresql/8.3-main.pid'                # write an extra PID file</FONT>
<FONT COLOR="#000000">                                        # (change requires restart)</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"># - Security and Authentication -</FONT>
<FONT COLOR="#000000">#authentication_timeout = 1min                # 1s-600s</FONT>
<FONT COLOR="#000000">ssl = true                                # (change requires restart)</FONT>
<FONT COLOR="#000000">#ssl_ciphers = 'ALL:!ADH:!LOW:!EXP:!MD5:@STRENGTH'        # allowed SSL ciphers</FONT>
<FONT COLOR="#000000">                                        # (change requires restart)</FONT>
<FONT COLOR="#000000">#password_encryption = on</FONT>
<FONT COLOR="#000000">#db_user_namespace = off</FONT>
<FONT COLOR="#000000"># Kerberos and GSSAPI</FONT>
<FONT COLOR="#000000">#krb_server_keyfile = ''                # (change requires restart)</FONT>
<FONT COLOR="#000000">#krb_srvname = 'postgres'                # (change requires restart, Kerberos only)</FONT>
<FONT COLOR="#000000">#krb_server_hostname = ''                # empty string matches any keytab entry</FONT>
<FONT COLOR="#000000">                                        # (change requires restart, Kerberos only)</FONT>
<FONT COLOR="#000000">#krb_caseins_users = off                # (change requires restart)</FONT>
<FONT COLOR="#000000">#krb_realm = ''                 # (change requires restart)</FONT>
<FONT COLOR="#000000"># - TCP Keepalives -</FONT>
<FONT COLOR="#000000"># see "man 7 tcp" for details</FONT>
<FONT COLOR="#000000">#tcp_keepalives_idle = 0                # TCP_KEEPIDLE, in seconds;</FONT>
<FONT COLOR="#000000">                                        # 0 selects the system default</FONT>
<FONT COLOR="#000000">#tcp_keepalives_interval = 0                # TCP_KEEPINTVL, in seconds;</FONT>
<FONT COLOR="#000000">                                        # 0 selects the system default</FONT>
<FONT COLOR="#000000">#tcp_keepalives_count = 0                # TCP_KEEPCNT;</FONT>
<FONT COLOR="#000000">                                        # 0 selects the system default</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:1223161525.4327.83.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>