[postgis-users] export

Ben Madin ben at ausvet.com.au
Tue Oct 14 05:58:06 PDT 2014


If you mean from one postgis database to another postgis database I think
you will find pg_dump most helpful using the -t flag for the table you want.

If they are both on the same cluster:

pg_dump -t myTable myDatabase1 | psql myDatabase2

(caveat is make sure that the second database has postgis extension
installed first)

Otherwise, dump to a file

pg_dump -t myTable myDatabase1 | gzip -9 > myTable.sql.gz

unzip and reload into second database.

cheers

Ben


On 14 October 2014 00:45, Stephen Crawford <src176 at psu.edu> wrote:

> Hello All,
>
> 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?
>
> Thanks,
> Steve
>
> --
> Stephen Crawford
> Center for Environmental Informatics
> The Pennsylvania State University
>
>
> _______________________________________________
> postgis-users mailing list
> postgis-users at lists.osgeo.org
> http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users
>



-- 

Ben Madin
BVMS PhD, MANZCVS

t : +61 8 6102 5535
m : +61 448 887 220
e : ben at ausvet.com.au

AusVet Animal Health Services
Western Australia

www.ausvet.com.au
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20141014/56684025/attachment.html>


More information about the postgis-users mailing list