[postgis-users] export

Mike Toews mwtoews at gmail.com
Tue Oct 14 13:29:18 PDT 2014


On 14 October 2014 05:45, Stephen Crawford <src176 at psu.edu> wrote:
> I want to copy a postgis table from one database to another.  Is dumping to
> a shapefile the best way to do this? Any other method? Pros and cons?

Shapefiles may work for simple tasks, but there is a long list of
problems with the DBF format used to store attributes, such as the
length of field names, etc., that could make this technique
problematic. If you have recent versions of PostgreSQL on the other
server, the modern way to copy between databases is to use foreign
data wrappers, or postgres_fdw
http://www.postgresql.org/docs/current/static/postgres-fdw.html

Here is a decent example:
http://www.craigkerstiens.com/2013/08/05/a-look-at-FDWs/

And stay tuned to PostgreSQL 9.5, where there will be a "IMPORT
FOREIGN SCHEMA" technique to expose more than one table.
http://www.depesz.com/2014/07/14/waiting-for-9-5-implement-import-foreign-schema/

-Mike


More information about the postgis-users mailing list