Opened 8 years ago

Closed 5 years ago

#3093 closed defect (worksforme) 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:, sql, Cc:
CPU: Unspecified Platform: MSWindows 7


The attached shapefile contains a single polygon. The respective data table has a field ("Date") which is NULL. When I import the attached shapefile 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) (2.7 KB ) - added by Melwin 8 years ago.

Download all attachments as: .zip

Change History (5)

by Melwin, 8 years ago

Attachment: added

comment:1 by martinl, 8 years ago

Component: DatabaseVector
Keywords: 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


comment:3 by neteler, 6 years ago


comment:4 by martinl, 5 years ago

Resolution: worksforme
Status: newclosed

Unable to reproduce in GRASS 7.6.0:

> in=/vsizip//home/martin/Downloads/ -o
Over-riding projection check
> -c Water_RE_20091111
Displaying column types/names for database connection of layer <1>:
Note: See TracTickets for help on using tickets.