[GRASS-dev] Re: [GRASS GIS] #1517: 'DateTime' not handled by
v.in.ogr
GRASS GIS
trac at osgeo.org
Wed Dec 21 08:23:25 EST 2011
#1517: 'DateTime' not handled by v.in.ogr
---------------------------+------------------------------------------------
Reporter: grasslandtom | Owner: grass-dev@…
Type: defect | Status: reopened
Priority: normal | Milestone: 6.4.2
Component: Database | Version: 6.4.2 RCs
Resolution: | Keywords: v.in.ogr, DateTime, TIMESTAMP
Platform: Unspecified | Cpu: Unspecified
---------------------------+------------------------------------------------
Changes (by grasslandtom):
* status: closed => reopened
* resolution: invalid =>
Comment:
Replying to [comment:1 neteler]:
> Replying to [ticket:1517 grasslandtom]:
> ...
> > This raises the error
> > {{{
> > DBMI-DBF driver error:
> > SQL parser error: syntax error, unexpected NAME processing 'datetime'
> > in statement:
> > create table test (cat integer, datetime datetime, id integer)
> > Error in db_execute_immediate()
> > }}}
>
> You cannot use a reserved SQL word as column name. 'datetime' is
reserved...
Obviously not for PostgreSQL. Otherwise the first line in the first code
block could not work. As a reference:
[http://www.postgresql.org/docs/8.3/static/sql-keywords-appendix.html]
Further in PostgreSQL:
{{{
alter table test rename datetime to something;
}}}
then in GRASS:
{{{
v.in.ogr dsn='PG:dbname=gs_gk_workspace' out=test layer='test(the_geom)'
location=new_test
}}}
raises
{{{
DBMI-DBF driver error:
SQL parser error: syntax error, unexpected NAME processing 'datetime'
in statement:
create table test (cat integer, something datetime, id integer)
Error in db_execute_immediate()
}}}
Here it's obviously not the column name, but the data type, that causes
trouble.
--
Ticket URL: <http://trac.osgeo.org/grass/ticket/1517#comment:2>
GRASS GIS <http://grass.osgeo.org>
More information about the grass-dev
mailing list