[GRASS-dev] [GRASS GIS] #3093: v.in.ogr: shapefile with Date/NULL-field prevents creation of db-table

#3093: v.in.ogr: shapefile with Date/NULL-field prevents creation of db-table
-------------------------+-------------------------
Reporter: Melwin | Owner: grass-dev@…
     Type: defect | Status: new
Priority: normal | Milestone: 7.0.5
Component: Database | Version: 7.0.3
Keywords: | 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

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

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/3093&gt;
GRASS GIS <https://grass.osgeo.org>

#3093: v.in.ogr: shapefile with Date/NULL-field prevents creation of db-table
--------------------------+-------------------------
  Reporter: Melwin | Owner: grass-dev@…
      Type: defect | Status: new
  Priority: normal | Milestone: 7.0.5
Component: Database | Version: 7.0.3
Resolution: | Keywords:
       CPU: Unspecified | Platform: MSWindows 7
--------------------------+-------------------------
Changes (by Melwin):

* Attachment "Reservoir_outlines2.zip" added.

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/3093&gt;
GRASS GIS <https://grass.osgeo.org>

#3093: v.in.ogr: shapefile with Date/NULL-field prevents creation of db-table
--------------------------+----------------------------
  Reporter: Melwin | Owner: grass-dev@…
      Type: defect | Status: new
  Priority: normal | Milestone: 7.0.5
Component: Vector | Version: 7.0.3
Resolution: | Keywords: v.in.ogr, sql,
       CPU: Unspecified | Platform: MSWindows 7
--------------------------+----------------------------
Changes (by martinl):

* keywords: => v.in.ogr, sql,
* component: Database => Vector

Comment:

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_`.

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/3093#comment:1&gt;
GRASS GIS <https://grass.osgeo.org>

#3093: v.in.ogr: shapefile with Date/NULL-field prevents creation of db-table
--------------------------+----------------------------
  Reporter: Melwin | Owner: grass-dev@…
      Type: defect | Status: closed
  Priority: normal | Milestone: 7.6.2
Component: Vector | Version: 7.0.3
Resolution: worksforme | Keywords: v.in.ogr, sql,
       CPU: Unspecified | Platform: MSWindows 7
--------------------------+----------------------------
Changes (by martinl):

* status: new => closed
* resolution: => worksforme
* milestone: 7.0.7 => 7.6.2

Comment:

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
}}}

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/3093#comment:4&gt;
GRASS GIS <https://grass.osgeo.org>