<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html style="direction: ltr;">
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
    <title></title>
    <style>body p { margin-bottom: 0cm; margin-top: 0pt; } </style>
  </head>
  <body style="direction: ltr;"
    bidimailui-detected-decoding-type="latin-charset" bgcolor="#ffffff"
    text="#000000">
    On 12/14/2011 07:40 PM, Kirk Wythers wrote:
    <blockquote
      cite="mid:25BE448E-EC90-4C67-B189-2B651A7E54F6@gmail.com"
      type="cite">
      <pre wrap="">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. 

</pre>
    </blockquote>
    <br>
    It seems it is:<br>
<a class="moz-txt-link-freetext" href="http://www.postgresql.org/docs/8.2/interactive/ddl-system-columns.html">http://www.postgresql.org/docs/8.2/interactive/ddl-system-columns.html</a><br>
    <br>
    You should be able to work around this by using the 'cnames' option
    for v.in.ogr. Something like:<br>
    v.in.ogr dsn=~/test.shp output=ew4kmg_Clip
    cnames="cat,id,x_min,x_max,y_min,y_max"<br>
    should do it.<br>
    <br>
    <br>
    <blockquote
      cite="mid:25BE448E-EC90-4C67-B189-2B651A7E54F6@gmail.com"
      type="cite">
      <pre wrap="">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
<a class="moz-txt-link-abbreviated" href="mailto:Qgis-user@lists.osgeo.org">Qgis-user@lists.osgeo.org</a>
<a class="moz-txt-link-freetext" href="http://lists.osgeo.org/mailman/listinfo/qgis-user">http://lists.osgeo.org/mailman/listinfo/qgis-user</a>

This mail was received via Mail-SeCure System.


</pre>
    </blockquote>
    <p><br>
    </p>
    <br>
    <pre class="moz-signature" cols="72">-- 
Micha Silver
GIS Consultant, Arava Development Co.
<a class="moz-txt-link-freetext" href="http://www.surfaces.co.il">http://www.surfaces.co.il</a></pre>
  </body>
</html>