On 12/14/2011 07:40 PM, Kirk Wythers wrote:
I am using ogr2ogr to reproject a shape file, and then I am using v.in.ogr, to read the file into a grass location. In addition I use PG to handle database management. However, I am getting a pg error about a column name conflicting with a system column name. Has anyone seen this before? If so, any suggestions on how to correct the problem? I find it hard to believe that "xmin" is a restricted name.
It seems it is:
http://www.postgresql.org/docs/8.2/interactive/ddl-system-columns.html
You should be able to work around this by using the 'cnames' option
for v.in.ogr. Something like:
v.in.ogr dsn=~/test.shp output=ew4kmg_Clip
cnames="cat,id,x_min,x_max,y_min,y_max"
should do it.
GRASS 6.4.1 (northcentralus_albersequalarea):~ > ogr2ogr -t_srs "`g.proj -wf`" test.shp ~/Desktop/ew4km/ew4kmg_Clip.shp
GRASS 6.4.1 (northcentralus_albersequalarea):~ > v.in.ogr dsn=~/test.shp output=ew4kmg_Clip
Projection of input dataset and current location appear to match
Layer: test
DBMI-Postgres driver error:
Cannot execute:
create table ew4kmg_Clip (cat integer, Id integer, XMIN double precision, XMAX double precision, YMIN double precision, YMAX double precision)
ERROR: column name "xmin" conflicts with a system column name
ERROR: Unable to create table: 'create table ew4kmg_Clip (cat integer, Id
integer, XMIN double precision, XMAX double precision, YMIN double
precision, YMAX double precision)'
Here is output of db.connect. I think I have this all set up properly. Am I not seeing something super obvious?
GRASS 6.4.1 (northcentralus_albersequalarea):~ > db.connect -p
driver:pg
database:host=localhost,dbname=northcentralus
schema:
group:
_______________________________________________
Qgis-user mailing list
[email protected]
http://lists.osgeo.org/mailman/listinfo/qgis-user
This mail was received via Mail-SeCure System.
--
Micha Silver
GIS Consultant, Arava Development Co.
http://www.surfaces.co.il
|
_______________________________________________
Qgis-user mailing list
[email protected]
http://lists.osgeo.org/mailman/listinfo/qgis-user