I've just tried to load the corrected version (ERROR2) with shp2pgsql and it works fine.<div><br></div><div>giovanni<br><br><div class="gmail_quote">2012/8/23 G. Allegri <span dir="ltr"><<a href="mailto:giohappy@gmail.com" target="_blank">giohappy@gmail.com</a>></span><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><p style="margin:0px"></p><p style="margin:0px">I'm obtaining the following errors when I try to load (drag&drop) a shapefile do PostGIS.</p>
<p style="margin:0px">I'm running PostGIS 1.5 on Postgresql 9.1.</p><p style="margin:0px">

QGis 1.9 on Windows 7 64bit.</p><p style="margin:0px"><br></p><p style="margin:0px">The first error (ERROR1) I've supposed was an encoding issue and float overflow due to the coordinate fields in the DBF.</p><p style="margin:0px">

The DB encoding is UTF-8.</p><p style="margin:0px">The error happens whichever encoding I choose.</p><p style="margin:0px"><br></p><p style="margin:0px">------------------------------------------------</p><p style="margin:0px">

ERROR1</p><p style="margin:0px">------------------------------------------------</p>
<p style="margin:0px">Error 7</p>
<p style="margin:0px">Feature write errors:</p>
<p style="margin:0px">Creation error for features from #0 to #0. Provider errors was: </p>
<p style="margin:0px">PostGIS error while adding features: ERROR:  numeric field overflow</p>
<p style="margin:0px">DETAIL:  A field with precision 19, scale 11 must round to an absolute value less than 10^8.</p>
<p style="margin:0px"></p>
<p style="margin:0px">Only 0 of 20 features written</p><p style="margin:0px">------------------------------------------------</p><p style="margin:0px"><br></p><p style="margin:0px"><br></p><p style="margin:0px">I've opened the DBF with LibOffice to change encoding and format cells to lesser decimals.</p>

<p style="margin:0px">Now I get ERROR2. Considera that I don't have any reg2011 table on the DB when this happens.</p><p style="margin:0px"><br></p><p style="margin:0px"></p><p style="margin:0px">------------------------------------------------</p>

<p style="margin:0px">ERROR2</p><p style="margin:0px">------------------------------------------------</p><p></p><p style="margin:0px"></p><p style="margin:0px">Error 7</p>
<p style="margin:0px">Feature write errors:</p>
<p style="margin:0px">Creation error for features from #0 to #0. Provider errors was: </p>
<p style="margin:0px">PostGIS error while adding features: ERROR:  new row for relation "reg2011" violates check constraint "enforce_geotype_geom"</p>
<p style="margin:0px"></p>
<p style="margin:0px">Only 0 of 20 features written.</p><p style="margin:0px">------------------------------------------------
</p><p style="margin:0px"><br></p><p style="margin:0px"></p><p style="margin:0px">The link to the original test shapefile is [1]</p><p style="margin:0px"><br></p><p style="margin:0px">giovanni</p><p></p><p></p><p style="margin:0px">

<br></p><p style="margin:0px"><br></p><p style="margin:0px">[1] <a href="http://www.istat.it/it/files/2011/04/reg2011.zip" target="_blank">http://www.istat.it/it/files/2011/04/reg2011.zip</a></p>
<p></p>
</blockquote></div><br></div>