[GRASS-user] strange Postgres/DBF table (layer 2) issue

peter.loewe at gmx.de peter.loewe at gmx.de
Fri Oct 17 11:39:13 EDT 2008


Hi,

I am using GRASS6.3.0 on OpenSuse.

The following effects were encountered when attempting to deal with a second table for a vector layer:

After connecting to Postgres using
 db.connect driver=pg database="host=localhost,dbname=postgres4grass"
and
 db.login user=gis 
the connection was verified from the GRASS side:

 echo 'create table soils (cat integer, soiltype varchar(10) )' | db.execute
creates a table, just as intended.

Trouble starts when trying to connect a vector layer  to an existing table:

  v.db.connect  map=landkreise_alpha table=neo key=cat layer=2
 The table <neo> is now part of vector map <landkreise_alpha> and may be 
 deleted or overwritten by GRASS modules
 DBMI-Postgres driver error:
 Cannot create index:
 create unique index neo_cat on neo ( cat )
 ERROR:  must be owner of relation neo

  WARNING: Cannot create index
 DBMI-Postgres driver error:
 Cannot grant on table:
 grant select on neo to public
 ERROR:  permission denied for relation neo

 WARNING: Cannot grant privileges on table neo 
 Select privileges were granted on the table

There might be login-related issues: Since the table "neo" was set up in psql using the same account/role as is used when connecting from GRASS, how can such issues tracked down/verified ? Are there best practices/recipes known ?  


Trying it from the other side by creating a new table by v.db.addtable also causes trouble:

 v.db.addtable map=landkreise_alpha table=smith layer=2 'columns=cat integer,id_int integer,id_varchar varchar(10),name varchar(30)'

 produces indeed a new table, but surprisingly NOT IN POSTGRES:

GRASS 6.3.0 (foo):~ > v.db.addtable map=landkreise_alpha table=smith layer=2 'columns=cat integer,id_int integer,id_varchar varchar(10),name varchar(30)'
Using user specified table name: smith
Creating table with columns (cat integer, id_int integer,id_varchar
varchar(10),name varchar(30))
The table <smith> is now part of vector map <landkreise_alpha> and may be
deleted or overwritten by GRASS modules
Select privileges were granted on the table
Updating database...
 100%
1 categories read from map
0 records selected from table
0 categories read from map exist in selection from table
0 categories read from map don't exist in selection from table
0 records updated/inserted
0 update/insert errors
Current attribute table links:
Vector map <landkreise_alpha> is connected by:
layer <1> table <landkreise_alpha> in database </home/pel/sandbox/locations/alpha/dbf/> through driver <dbf> with key <cat>
layer <2> table <smith> in database </home/pel/sandbox/locations/alpha/dbf/> through driver <dbf> with key <cat>

^^^--- why, oh why is the new table set up through the dbf-Driver when the whole mapset has been switched to the PG-driver ?

Cheers,
Peter

FWIW: I noticed that login data is successively concatenated in the file .grasslogin6. Say, after loging in three times under three different user names, the file will contain three lines holding the three usernames and the associated passwords. Is this a bugfeature ?   

-- 
Dr. Peter Löwe
<peter.loewe at gmx.de>





Psssst! Schon vom neuen GMX MultiMessenger gehört? Der kann`s mit allen: http://www.gmx.net/de/go/multimessenger


More information about the grass-user mailing list