[GRASS-user] error importing postgresql db
Seb
spluque at gmail.com
Sun May 31 18:43:04 EDT 2009
Hi,
I tried importing a PostgreSQL table (a view) using v.in.ogr. However,
the module failed with:
---<--------------------cut here---------------start------------------->---
v.in.ogr dsn="PG:host=localhost port=5433 dbname=mydb" layer=mylayer out=test type=point
Projection of input dataset and current location appear to match
Layer: mylayer
WARNING: Width for column sex set to 255 (was not specified by OGR), some
strings may be truncated!
DBMI-DBF driver error:
SQL parser error: syntax error, unexpected TIME, expecting NAME processing 'time'
in statement:
create table test (cat integer, a integer, b varchar ( 3 ), c integer, d integer, e integer, f integer, g integer, h integer, i integer, j integer, k varchar ( 10 ), l varchar ( 500 ), m varchar ( 12 ), sex varchar ( 255 ), n varchar ( 300 ), time datetime, time_b datetime)
Error in db_execute_immediate()
ERROR: Unable to create table: 'create table test (cat integer, a
integer, b varchar ( 3 ), c integer, d integer,
e integer, f integer, g integer, h integer, i
integer, j integer, k varchar ( 10 ), l varchar ( 500
), m varchar ( 12 ), sex varchar ( 255 ), n varchar (
300 ), time datetime, time_b datetime)'
---<--------------------cut here---------------end--------------------->---
The warning about the sex column is harmless since it is just a custom
type and the 255 limit is fine here. The parsing error with time column
seems to have prevented the vector from building properly though. The
same error occurs when doing it with v.in.db. The view and the
underlying tables show no problems in Postgresql.
Cheers,
--
Seb
More information about the grass-user
mailing list