Opened 8 years ago

Closed 5 years ago

#3093 closed defect (worksforme)

v.in.ogr: shapefile with Date/NULL-field prevents creation of db-table

Reported by: Melwin Owned by: grass-dev@…
Priority: normal Milestone: 7.6.2
Component: Vector Version: 7.0.3
Keywords: v.in.ogr, sql, Cc:
CPU: Unspecified Platform: MSWindows 7

Description

The attached shapefile contains a single polygon. The respective data table has a field ("Date") which is NULL. When I import the attached shapefile

v.in.ogr dsn=./Water_RE_20091111.shp output=raiz_outline layer=Water_RE_20091111 min_area=0.0001 type=boundary snap=-1

I get the warning

WARNUNG: Kann Datei './madalena_test/PERMANENT/.tmp/unknown/vector/tmp_6680/coor' nicht löschen.

("cannot delete file ...")

and the corresponding table is not created.

When switching to dbf-driver, the problem persist and issues

ERROR: cannot create table: 'create table raiz_outline3 (cat

integer, OBJECTID integer, Date date, SHAPE_Leng double precision, SHAPE_Area double precision, Name varchar ( 50 ))'

If I remove the column "Date", everything works as expected.

I can produce this behaviour in GRASS 7.0.3 and 6.4.1 (Windows 7, 64 bit). The latter even hangs when I try to display the attribute table from the GUI then.

cheers, Melwin

Attachments (1)

Reservoir_outlines2.zip (2.7 KB ) - added by Melwin 8 years ago.

Download all attachments as: .zip

Change History (5)

by Melwin, 8 years ago

Attachment: Reservoir_outlines2.zip added

comment:1 by martinl, 8 years ago

Component: DatabaseVector
Keywords: v.in.ogr sql added

Date is reserved SQL word. It cannot be used for column name. You can rename this column using columns options (whole list of columns must be defined). The module could be of course more cleaver and rename such column automatically eg. to Date_.

comment:2 by neteler, 8 years ago

Milestone: 7.0.57.0.6

comment:3 by neteler, 6 years ago

Milestone: 7.0.67.0.7

comment:4 by martinl, 5 years ago

Milestone: 7.0.77.6.2
Resolution: worksforme
Status: newclosed

Unable to reproduce in GRASS 7.6.0:

> v.in.ogr in=/vsizip//home/martin/Downloads/Reservoir_outlines2.zip -o
Over-riding projection check
> v.info -c Water_RE_20091111
Displaying column types/names for database connection of layer <1>:
INTEGER|cat
INTEGER|OBJECTID
DATE|Date
DOUBLE PRECISION|SHAPE_Leng
DOUBLE PRECISION|SHAPE_Area
CHARACTER|Name
Note: See TracTickets for help on using tickets.