[GRASS-user] connect to postgreSQL
Stanislav Bek
bks at centrum.cz
Thu Oct 16 14:38:51 EDT 2008
I have uncommented a restarted the server, but db.test is again not OK.
socket is also 5433... ?
this is part of my .conf file:
#------------------------------------------------------------------------------
# CONNECTIONS AND AUTHENTICATION
#------------------------------------------------------------------------------
# - Connection Settings -
listen_addresses = 'localhost' # what IP address(es) to listen on;
# comma-separated list of addresses;
# defaults to 'localhost', '*' = all
# (change requires restart)
port = 5433 # (change requires restart)
max_connections = 100 # (change requires restart)
# Note: Increasing max_connections costs ~400 bytes of shared memory per
# connection slot, plus lock space (see max_locks_per_transaction). You might
# also need to raise shared_buffers to support more connections.
#superuser_reserved_connections = 3 # (change requires restart)
unix_socket_directory = '/var/run/postgresql' # (change requires restart)
#unix_socket_group = '' # (change requires restart)
unix_socket_permissions = 0777 # begin with 0 to use octal notation
# (change requires restart)
#bonjour_name = '' # defaults to the computer name
# (change requires restart)
______________________________________________________________
> Od: benoit.andre at bcgeol.be
> Komu: Stanislav Bek <bks at centrum.cz>
> CC: glynn at gclements.plus.com, grass-user at lists.osgeo.org
> Datum: 16.10.2008 19:29
> Předmět: Re: [GRASS-user] connect to postgreSQL
>
>Try to uncomment the line (cut out the #)
>
>#unix_socket_permissions = 0777 # begin with 0 to use octal notation
>
>to make it active, but I don't the problem is there
>
>Or look at the socket : 5432 or 5433. The 'normal' socket of psql is
>5432.
>
>And also : in the first lines of postgresql.conf, there is a line like
>this (the adress is in my case) :
>
>listen_addresses = '192.168.10.1'
>
>Is this line uncomment (without the #) ? And what are the adresses ?
>
>Benoit.
>
>Le jeudi 16 octobre 2008 à 18:54 +0200, Stanislav Bek a écrit :
>
>> >> I have problem to connect to postgreSQL server from grass.
>> >>
>> >> GRASS 6.3.0 (opava):~ > psql -l
>> >> List of databases
>> >> Name | Owner | Encoding
>> >> -----------+----------+----------
>> >> gis1 | bekas | UTF8
>> >> postgres | postgres | UTF8
>> >> template0 | postgres | UTF8
>> >> template1 | postgres | UTF8
>> >> (4 rows)
>> >>
>> >> GRASS 6.3.0 (opava):~ > db.connect driver=pg database=gis1
>> >>
>> >> GRASS 6.3.0 (opava):~ > db.test test=test1
>> >> create table grass_test1 (i1 integer, d1 double precision, c1 varchar(20))
>> >> DBMI-Postgres driver error:
>> >> Cannot connect to Postgres: could not connect to server: No such file or directory
>> >> Is the server running locally and accepting
>> >> connections on Unix domain socket "/var/run/postgresql/.s.PGSQL.5432"?
>> >
>> >Try:
>> >
>> > db.connect driver=pg database="host=localhost,dbname=gis1"
>>
>> With this, it does not work yet.
>>
>> >
>> >to connect using TCP.
>> >
>> >Also, "netstat -ax" will list active Unix-domain sockets. If
>> >postmaster is accepting local (Unix-domain) connections, its socket
>> >will be listed there. E.g. I have:
>> >
>> >unix 2 [ ACC ] STREAM LISTENING 3442 /tmp/.s.PGSQL.5432
>> >
>> >If it's listening on a Unix-domain socket, check that you have the
>> >necessary permissions on both the socket and its parent directories.
>> >
>> >--
>> >Glynn Clements <glynn at gclements.plus.com>
>>
>>
>> So I've done:
>>
>> GRASS 6.3.0 (opava):~/skripty > netstat -ax| grep post
>> unix 2 [ ACC ] STREAM LISTENING 13460 /var/run/postgresql/.s.PGSQL.5433
>> sudo chmod 777 /var/run/postgresql/.s.PGSQL.5433
>> sudo chmod 777 /var/run/postgresql/
>>
>> in postgresql.conf there is a line:
>> #unix_socket_permissions = 0777 # begin with 0 to use octal notation
>>
>> After that: db.test test=test1 again without success.
>>
>> Thank you very much for your help.
>> Best regards,
>> Stanislav
>>
>>
>>
>>
>>
>>
>>
>>
>>
>> _______________________________________________
>> grass-user mailing list
>> grass-user at lists.osgeo.org
>> http://lists.osgeo.org/mailman/listinfo/grass-user
>
>Benoit ANDRE
>Géologue - Hydrologue
>
>
>________________________________________________________________________
>
>
>
>
>
>Bureau Conseil en Géologie
>Rue de Leuze, 433
>B-5300 VEZIN
>BELGIQUE
>
>Tél.: +32 81 58 26 11
>Fax.: +32 81 58 26 12
>Contacter...
>Bureau Conseil en Géologie
>________________________________________________________________________
>
>
More information about the grass-user
mailing list