[postgis-users] adding new shape data in existing PostGIS table

Emily Gouge egouge at refractions.net
Mon Jan 9 11:38:45 PST 2006


Try using the -a option in the shp2pgsql.

So instead of
/usr/local/pgsql/bin/shp2pgsql  forest forest | /usr/local/pgsql/bin/psql -a forestrydb

try
/usr/local/pgsql/bin/shp2pgsql -a forest forest | /usr/local/pgsql/bin/psql forestrydb

Also you can write the output of the shp2pgsql comment to a file instead of the database and try 
looking at the beginning of the file.  If you use the -a option there should be no create table 
statement at the beginning of the file, without the -a option there should be a create table statement.

Emily

Kefyalew Sahle wrote:

>  Hello,
>    
> I have got problem in adding new data in a table that already exist in PostGIS. 
> I used the following command   
> /usr/local/pgsql/bin/shp2pgsql  forest forest | /usr/local/pgsql/bin/psql -a forestrydb 
> 
> I received the following message 
> ERROR:  relation "forest" already exists ............... 
> ERROR:  current transaction is aborted, commands ignored until end of transaction block 
>   When running without any options. The task is aborted. The following is the massage displayed after running the shp2pgsql command:
>    Shapefile type: Polygon
>  Postgis type: MULTIPOLYGON[2]
>  BEGIN
>  NOTICE: CREATE TABLE will create implicit sequence "forest_gid_seq1" for serial column "forest.gid"
>  ERROR:  relation "forest" already exists
>  ERROR:  current transaction is aborted, commands ignored until end of transaction block
>  ERROR:  current transaction is aborted, commands ignored until end of transaction block
>  ROLLBACK
>    
> Would you please provide me some information how I can append in my existing PostGIS 
> database new data that is available in shape format?
> Thanks in advance  
> 
> Kef
>   
> 
> 		
> ---------------------------------
> Yahoo! Photos
>  Ring in the New Year with Photo Calendars. Add photos, events, holidays, whatever.
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> postgis-users mailing list
> postgis-users at postgis.refractions.net
> http://postgis.refractions.net/mailman/listinfo/postgis-users




More information about the postgis-users mailing list