[GRASS-user] Grass 7 and postgresql

Moritz Lennert mlennert at club.worldonline.be
Fri Sep 2 05:19:41 PDT 2016


On 02/09/16 12:51, Benoit ANDRE wrote:
> Moritz,
>
> First, I move from 6 to 7 with /v.build/ or /v.build.all/ (depends on
> locations)
>
> Here, connections are already gone...
>
> I connect with :
> /db.connect driver=pg database="host=192.168.1.200,dbname=administration"/
>
> /db.connect -p/ :
> driver: pg
> database: host=192.168.1.200,dbname=administration
> schema: public
> group:
>
> /db.login --overwrite user=benoit/
> ATTENTION: DB connection <pg/host=192.168.1.200,dbname=administration>
>            already exists and will be overwritten
>
>
> When I try a /db.tables -p/, I get :
> DBMI-PostgreSQL erreur de pilote :
> Connection failed.
> n'a pas pu se connecter au serveur : Aucun fichier ou dossier de ce type
>     Le serveur est-il actif localement et accepte-t-il les connexions sur la
>      socket Unix « /var/run/postgresql/.s.PGSQL.5432 » ?
>
>
> DBMI-PostgreSQL erreur de pilote :
> Connection failed.
> n'a pas pu se connecter au serveur : Aucun fichier ou dossier de ce type
>     Le serveur est-il actif localement et accepte-t-il les connexions sur la
>      socket Unix « /var/run/postgresql/.s.PGSQL.5432 » ?
>
>
> ERREUR :Unable to open database <host=192.168.1.200,dbname=administration>
>
>
> /v.db.connect/ (dialog box) isn't usable, because the field 'Name of
> attribute table' is empty...
>
> Il I try : /v.db.connect -o map=survey_bcg at benoit table=survey_bcg
> key=cat layer=1/ (for facility, table name is the same as map name),
> result is
> DBMI-PostgreSQL erreur de pilote :
> Connection failed.
> n'a pas pu se connecter au serveur : Aucun fichier ou dossier de ce type
>     Le serveur est-il actif localement et accepte-t-il les connexions sur la
>      socket Unix « /var/run/postgresql/.s.PGSQL.5432 » ?
>
>
> DBMI-PostgreSQL erreur de pilote :
> Connection failed.
> n'a pas pu se connecter au serveur : Aucun fichier ou dossier de ce type
>     Le serveur est-il actif localement et accepte-t-il les connexions sur la
>      socket Unix « /var/run/postgresql/.s.PGSQL.5432 » ?
>
>
> ATTENTION: Impossible d'ouvrir la base de données
>            <host=192.168.1.200,dbname=administration> avec le driver <pg>
> ATTENTION: Impossible d'ouvrir la base de données
>            <host=192.168.1.200,dbname=administration> avec le driver <pg>
> ERREUR :La table <survey_bcg7> n'existe pas dans la base de données
>
> ***********************
>
> On my computer (192.168.1.11) :  psql -V is psql (PostgreSQL) 9.2.8
> The server (192.168.1.200) : psql -V is psql (PostgreSQL) 9.2.15
>
>
> All the other programs using postresql, including grass 6.4.4 work fine

Weird.

I tried to reproduce using the GRASS 6 data subset [1]:

grass64 -c /data/GRASS/DATA/nc_basic_spm/gisdemo_ncspm/pg
db.connect driver=pg database="host=127.0.0.1,dbname=testgrass"
db.login user=mlennert
for map in $(g.mlist type=vect pat="*" mapset=PERMANENT); do g.copy 
vect=$map,${map}_pg; done

grass70 /data/GRASS/DATA/nc_basic_spm/gisdemo_ncspm/pg
v.build.all

All database connections are still there and I can connect to the 
database without any problems.

So, I don't understand why all your database connections were lost after 
v.build/v.build.all.

Martin, any idea ?

[1] https://grass.osgeo.org/sampledata/north_carolina/nc_basic_spm.tar.gz



More information about the grass-user mailing list