Opened 15 years ago

Last modified 5 years ago

#578 new enhancement

quote column names to avoid SQL reserved word collision

Reported by: hamish Owned by: grass-dev@…
Priority: minor Milestone: 7.6.2
Component: Vector Version: svn-develbranch6
Keywords: v.in.ogr, SQL Cc:
CPU: All Platform: All

Description

Hi,

moved here from GDAL bug # 2965 http://trac.osgeo.org/gdal/ticket/2965

v.in.ogr will not read GPX format as input because OGR's GPX driver creates a DB field called "time" for the timestamp. GRASS chokes on this because TIME is a SQL reserved word for some backends (DBF doesn't like it, SQLite is ok with it).

workaround: use the cnames= option to rename the TIME field.

suggestion by rouault: "There is no reason for the GPX driver not to use "time" as a field name. I think you should report it rather to the GRASS project. They should likely quote the field names (provided that it supports that). This is what the PG and MySQL driver in OGR do, so you can use any name, even if it is a SQL reserved keyword."

comments?

Hamish

Change History (11)

comment:1 by neteler, 10 years ago

For SQL reserved word collisions, see also #1755

in reply to:  description comment:2 by mlennert, 10 years ago

Replying to hamish:

suggestion by rouault: "There is no reason for the GPX driver not to use "time" as a field name. I think you should report it rather to the GRASS project. They should likely quote the field names (provided that it supports that). This is what the PG and MySQL driver in OGR do, so you can use any name, even if it is a SQL reserved keyword."

comments?

IMHO, quoting of field names is good practice in general, and so should be implemented in GRASS is possible.

Moritz

comment:3 by martinl, 8 years ago

Milestone: 7.0.07.0.5

comment:4 by martinl, 8 years ago

Milestone: 7.0.57.3.0

comment:5 by martinl, 8 years ago

Milestone: 7.3.07.4.0

Milestone renamed

comment:6 by neteler, 6 years ago

Milestone: 7.4.07.4.1

Ticket retargeted after milestone closed

comment:7 by neteler, 6 years ago

Milestone: 7.4.17.4.2

comment:8 by martinl, 6 years ago

Milestone: 7.4.27.6.0

All enhancement tickets should be assigned to 7.6 milestone.

in reply to:  1 comment:9 by neteler, 5 years ago

Replying to neteler:

For SQL reserved word collisions, see also #1755

See also #3563

comment:10 by martinl, 5 years ago

Milestone: 7.6.07.6.1

Ticket retargeted after milestone closed

comment:11 by martinl, 5 years ago

Milestone: 7.6.17.6.2

Ticket retargeted after milestone closed

Note: See TracTickets for help on using tickets.