[postgis-users] Using shp2pgsql

Paul Maddock Paul.Maddock at ijus.net
Wed Apr 25 09:09:05 PDT 2012


Yeah.  I figured my problem out.  It ended up being an issue with the schema.

Thanks all!

From: postgis-users-bounces at postgis.refractions.net [mailto:postgis-users-bounces at postgis.refractions.net] On Behalf Of Stephen V. Mather
Sent: Wednesday, April 25, 2012 12:07 PM
To: 'PostGIS Users Discussion'
Subject: Re: [postgis-users] Using shp2pgsql

I think he means run it in psql so that you can observe what line the error occurs.  You are unlikely to see the error before loading it in psql.

Best,
Steve

[cid:image001.png at 01CD22DC.35ACA9B0]Stephen Mather
Geographic Information Systems (GIS) Manager
(216) 635-3243
svm at clevelandmetroparks.com<mailto:svm at clevelandmetroparks.com>
clevelandmetroparks.com<http://www.clemetparks.com/>




From: postgis-users-bounces at postgis.refractions.net<mailto:postgis-users-bounces at postgis.refractions.net> [mailto:postgis-users-bounces at postgis.refractions.net]<mailto:[mailto:postgis-users-bounces at postgis.refractions.net]> On Behalf Of Paul Maddock
Sent: Wednesday, April 25, 2012 11:02 AM
To: postgis-users at postgis.refractions.net<mailto:postgis-users at postgis.refractions.net>
Subject: Re: [postgis-users] Using shp2pgsql

Nothing, the sql file looks beautiful.  No errors.  The interesting thing to me is that it repeats the error when I pipe it and the error repeats for as many time as there are rows of data.

What could this mean?  Might there be something wrong with my schema?


Shp2psql is supposed to create the table which it does:
SET CLIENT_ENCODING TO UTF8;
SET STANDARD_CONFORMING_STRINGS TO ON;
BEGIN;
CREATE TABLE "columbus"."pole_region" (gid serial PRIMARY KEY,
"location_n" varchar(15),
"height" float8,
"class" varchar(11),
"ownership" varchar(7),
"owner" varchar(80),
"plant_acct" varchar(31),
"vintage_ye" float8,
"inservice_" varchar(12),
"pole_kind" varchar(31),
"pole_type" varchar(24),
"original_t" varchar(25),
"design_sta" varchar(18),
"facility_s" varchar(10),
"ciac_statu" varchar(8),
"ciac_date" varchar(12),
"west_pole_" varchar(6));
SELECT AddGeometryColumn('columbus','pole_region','geom_3754','3754','MULTIPOLYGON',4);

From: Denis Rouzaud [mailto:denis.rouzaud at gmail.com]<mailto:[mailto:denis.rouzaud at gmail.com]>
Sent: Wednesday, April 25, 2012 10:52 AM
To: PostGIS Users Discussion
Cc: Paul Maddock
Subject: Re: [postgis-users] Using shp2pgsql

You could output shp2pgsql to a SQL file, then use it in psql to see at which line the error occurs.



On 04/25/2012 04:46 PM, Paul Maddock wrote:
Dear all,

I'm using the following code to transform a shapefile I have into a table and import it into my database:
shp2pgsql -s 3754 ~/JOE/columbus/pole_region.shp columbus.pole_region | psql -h localhost -U postgres -p 5432 -d paul

When it runs I have to put my password in for postgres (expected), and I get the following output:

ERROR:  current transaction is aborted, commands ignored until end of transaction block
ERROR:  current transaction is aborted, commands ignored until end of transaction block
ERROR:  current transaction is aborted, commands ignored until end of transaction block
ERROR:  current transaction is aborted, commands ignored until end of transaction block
ERROR:  current transaction is aborted, commands ignored until end of transaction block
ERROR:  current transaction is aborted, commands ignored until end of transaction block
ERROR:  current transaction is aborted, commands ignored until end of transaction block
ERROR:  current transaction is aborted, commands ignored until end of transaction block
ERROR:  current transaction is aborted, commands ignored until end of transaction block
ERROR:  current transaction is aborted, commands ignored until end of transaction block
ERROR:  current transaction is aborted, commands ignored until end of transaction block
ERROR:  current transaction is aborted, commands ignored until end of transaction block
ERROR:  current transaction is aborted, commands ignored until end of transaction block

The database paul is created and the schema columbus is created and is owned by postgres.

What am I doing wrong?  Do I have to set datatypes?

Thanks for the help,
Paul


Paul A. Maddock
Mapping Technician
IJUS LLC
560 Officenter Place
Gahanna, OH 43230
Cell: (513) 404-6476
[cid:image003.gif at 01CD22DC.35ACA9B0]<http://www.ijus.net/index.html>



_______________________________________________

postgis-users mailing list

postgis-users at postgis.refractions.net<mailto:postgis-users at postgis.refractions.net>

http://postgis.refractions.net/mailman/listinfo/postgis-users
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20120425/14acebfe/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image001.png
Type: image/png
Size: 3772 bytes
Desc: image001.png
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20120425/14acebfe/attachment.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image003.gif
Type: image/gif
Size: 3201 bytes
Desc: image003.gif
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20120425/14acebfe/attachment.gif>


More information about the postgis-users mailing list