[GRASSLIST:8931] db.copy fails with DBMI driver error

Jed O. Kaplan jed.kaplan at ips.unibe.ch
Tue Nov 8 05:24:07 EST 2005


Hello all,

Hardware/Software:

5 Nov 2005 CVS binary of GRASS 6.x (Lorenzo Moretti) on Mac OS X (10.4).

Summary:

db.execute and db.copy fail while db.select and db.tables work.  Any  
advice you may be able to give me on this problem would be much  
appreciated.

Problem:

I would like to use the command db.copy to transfer a table from a  
dbf database to a postgresql database.  The db.copy command fails  
with the following error:

GRASS 6.1.cvs (engadin-swissgrid):~ > db.copy from_driver=dbf  
from_database=./ from_table=mapcodes2 to_driver=pg  
to_database="host=localhost,dbname=engadin" to_table=mapcodes2
DBMI-DBF driver error:
Table 'mapcodes2' doesn't exist.
Error in db_open_select_cursor()

WARNING: Cannot open select cursor: 'select * from mapcodes2 where 0  
= 1'
WARNING: Copy table failed

A simpler command using db.execute also fails:

GRASS 6.1.cvs (engadin-swissgrid):~ > echo "select * from mapcodes" |  
db.execute
dbmi: Protocol error
ERROR: Error while executing: "select * from mapcodes
        "

However, this usage of db.tables -p works properly:

GRASS 6.1.cvs (engadin-swissgrid):~ > db.tables -p
eveg_cats2
eveg_cats3
eveg_cats4
eveg_cats5
mapcat
mapcodes
mapcodes2

And so does this usage of db.select:

GRASS 6.1.cvs (engadin-swissgrid):~ > echo "select * from mapcodes" |  
db.select

LEGCAT|MAPCODE|CEM_%|LAR_%|PIC_%|SYL_%|MUG_%|VIR_%|SAL_%|JUN_%|BET_%| 
INC_%|GRA_%|CYP_%
1|~|0.000000|0.000000|0.000000|0.000000|0.000000|0.000000|0.000000| 
0.000000|0.000000|0.000000|0.000000|0.000000
2|..|0.000000|0.000000|0.000000|0.000000|0.000000|0.000000|0.000000| 
0.000000|0.000000|0.000000|0.000000|0.000000
3|$|1.000000|1.000000|0.100000|0.000000|0.000000|0.000000|0.000000| 
0.000000|0.000000|0.000000|15.000000|3.000000
4|+|0.000000|0.000000|0.000000|0.000000|0.000000|0.000000|0.000000| 
0.000000|0.000000|0.000000|70.000000|20.000000
5|-|0.000000|0.000000|0.000000|0.000000|0.000000|0.000000|0.000000| 
0.000000|0.000000|0.000000|20.000000|70.000000
etc...

Thank you for your help!

Jed Kaplan




More information about the grass-user mailing list