[postgis-users] How to update (replace) a Postgis table?

Paolo Corti pcorti at gmail.com
Fri Feb 8 00:14:51 PST 2013


On Fri, Feb 8, 2013 at 7:34 AM, Stefan Schwarzer
<stefan.schwarzer at unep.org> wrote:
> Hi there,
>
> I would like to "update" a "countries of the world"-postgis-table, by
> replacing it with another one which comes in form of a shapefile (dumped
> from a Postgis database) from my development server.
>
> Now, I can't just do a "pgsql2shp", as this would throw an error as the
> table already exists. And renaming the existing table into something like
> "xx_original" doesn't work either ("xx_geom_gist already exists", is then
> the error message).
>
> I don't want to delete the (old) table directly, as I would like to keep it
> as a backup.
>
> So, what is the "right" way to solve this? Thanks for any hints!
>

Using the pgsql2shp -d option will drop and recreate the table
regards

-- 
Paolo Corti
Geospatial software developer
web: http://www.paolocorti.net
twitter: @capooti
skype: capooti


More information about the postgis-users mailing list