id	summary	reporter	owner	description	type	status	priority	milestone	component	version	severity	resolution	keywords	cc
2965	OGR GPX driver using reserved SQL keyword for field name	hamish	warmerdam	"Hi,

I am attempting to import a GPX file into GRASS using the v.in.ogr module.

I am getting this error:
{{{
Layer: waypoints
WARNING: Width for column name set to 255 (was not specified by OGR), some
         strings may be truncated!
WARNING: Width for column cmt set to 255 (was not specified by OGR), some
         strings may be truncated!
WARNING: Width for column desc set to 255 (was not specified by OGR), some
         strings may be truncated!
WARNING: Width for column src set to 255 (was not specified by OGR), some
         strings may be truncated!
WARNING: Width for column link1_href set to 255 (was not specified by OGR),
         some strings may be truncated!
WARNING: Width for column link1_text set to 255 (was not specified by OGR),
         some strings may be truncated!
WARNING: Width for column link1_type set to 255 (was not specified by OGR),
         some strings may be truncated!
WARNING: Width for column link2_href set to 255 (was not specified by OGR),
         some strings may be truncated!
WARNING: Width for column link2_text set to 255 (was not specified by OGR),
         some strings may be truncated!
WARNING: Width for column link2_type set to 255 (was not specified by OGR),
         some strings may be truncated!
WARNING: Width for column sym set to 255 (was not specified by OGR), some
         strings may be truncated!
WARNING: Width for column type set to 255 (was not specified by OGR), some
         strings may be truncated!
WARNING: Width for column fix 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 gps_trk_28Apr2009_1 (cat integer, ele double precision, time datetime, magvar double precision, geoidheight double precision, name varchar ( 255 ), cmt varchar ( 255 ), desc varchar ( 255 ), src varchar ( 255 ), link1_href varchar ( 255 ), link1_text varchar ( 255 ), link1_type varchar ( 255 ), link2_href varchar ( 255 ), link2_text varchar ( 255 ), link2_type varchar ( 255 ), sym varchar ( 255 ), type varchar ( 255 ), fix varchar ( 255 ), sat integer, hdop double precision, vdop double precision, pdop double precision, ageofdgpsdata double precision, dgpsid integer)
Error in db_execute_immediate()
}}}

ogr/ogrsf_frmts/gpx/ogrgpxlayer.cpp line 110 sets a OGRFieldDefn named ""time"", but this is a SQL reserved word for some DBs, so fails.

http://www.postgresql.org/docs/8.3/interactive/sql-keywords-appendix.html


I can work around this in GRASS either by setting the v.in.ogr cnames= option to rename the fields, or by using another DB backend which doesn't have 'time' as a reserved word (like SQLite).


Hamish
"	defect	closed	normal		OGR_SF	svn-trunk	normal	invalid	gpx	
