[GRASS-user] v.in.ogr doesn't support Postgres Data Type timestamp

Markus Neteler neteler at fbk.eu
Sat Nov 24 08:43:35 EST 2007


Confirmed for 6.2.2. It works in 6.3.x.

The complete test sequence is:

CREATE TABLE test
(
id serial NOT NULL,
mytime timestamp DEFAULT now(),
text varchar,
wkb_geometry geometry,
CONSTRAINT test_pkey PRIMARY KEY (id)
)
WITHOUT OIDS;

INSERT INTO test (text, wkb_geometry)
VALUES ('Name',geometryFromText('POLYGON((600000 200000,650000
200000,650000 250000,600000 250000,600000 200000))',-1));

# this was missing in below example:
select AddGeometryColumn ('postgis', 'test', 'geometry', -1, 'GEOMETRY', 2);

# import
v.in.ogr dsn="PG:host=localhost dbname=postgis user=neteler" layer=test \
                     output=test type=boundary,centroid


I have now backported a set of changes:
- PG driver: PG_TYPE_POSTGIS_GEOM and views backported
- v.in.ogr:  OFTDate, OFTTime and OFTDateTime backported

It now works:
v.db.select test
cat|id|mytime|text
1|1|2007-11-24 13:03:49|Name

To avoid another 6.2.3 release candidate, please download
http://grass.itc.it/grass62/source/snapshot/
-> grass-6.2.cvs_src_snapshot_2007_11_24.tar.gz

and give it a try. I have created the snapshot again to
include these changes.

Markus

On Fri, Nov 23, 2007 at 02:40:44PM +0100, Düster Horst wrote:
>    v.in.ogr v.in.ogr doesn't support Postgres Data Type timestamp. When you
>    try to import PostGIS layer with columns of type timestamp v.in.ogr
>    reports the error p.e.:
>    table xxx has 4 columns 6 values were supplied
>    This example error happens when table xxx hat 2 colums of 6 columns with
>    type timestamp. It seems that v.in.ogr detects the wrong number of
>    columns.Isn't is possible to convert timestamp data to character data?
>    Regards
>    Horst
>    ------------------------------------------------
>    Dr. Horst Duester
>    GIS-Koordinator, Stv. Amtschef
>    Kanton Solothurn
>    Bau- und Justizdepartement
>    Amt fuer Geoinformation
>    SO!GIS Koordination
>    Roetistrasse 4
>    CH-4501 Solothurn
>    Telefon ++41(0)32 627 25 32
>    Telefax ++41(0)32 627 22 14
>    mailto:horst.duester at bd.so.ch
>    http://www.agi.so.ch

Content-Description: ATT00001
> _______________________________________________
> grass-user mailing list
> grass-user at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/grass-user


-- 
Markus Neteler  <neteler fbk eu>  http://mpa.fbk.eu/markus/
FBK-irst -  Centro per la Ricerca Scientifica e Tecnologica
MPBA - Predictive Models for Biol. & Environ. Data Analysis
Via Sommarive, 18        -       38050 Povo (Trento), Italy
New book:                         http://www.grassbook.org/


More information about the grass-user mailing list