<div dir="ltr"><div><div><div><div><div>Exporting using shapefile is a bad idea.<br></div>If anything in your data base is relational, it will be lost.<br></div>Same for special indexes, triggers, permission, etc etc.<br><br></div>For the moment it's quit painfull to use dblink or fdw because you have to do it table by table.<br></div><div>(sur it can be automatized, but it is clumsy at best)<br></div><div><br></div>pg_dump is the only way to copy the table, it's data and all the "meta" info (owner, index, etc).<br><br></div>Cheers,<br>Rémi-C<br></div><div class="gmail_extra"><br><div class="gmail_quote">2014-10-14 22:29 GMT+02:00 Mike Toews <span dir="ltr"><<a href="mailto:mwtoews@gmail.com" target="_blank">mwtoews@gmail.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On 14 October 2014 05:45, Stephen Crawford <<a href="mailto:src176@psu.edu">src176@psu.edu</a>> wrote:<br>
> I want to copy a postgis table from one database to another.  Is dumping to<br>
> a shapefile the best way to do this? Any other method? Pros and cons?<br>
<br>
</span>Shapefiles may work for simple tasks, but there is a long list of<br>
problems with the DBF format used to store attributes, such as the<br>
length of field names, etc., that could make this technique<br>
problematic. If you have recent versions of PostgreSQL on the other<br>
server, the modern way to copy between databases is to use foreign<br>
data wrappers, or postgres_fdw<br>
<a href="http://www.postgresql.org/docs/current/static/postgres-fdw.html" target="_blank">http://www.postgresql.org/docs/current/static/postgres-fdw.html</a><br>
<br>
Here is a decent example:<br>
<a href="http://www.craigkerstiens.com/2013/08/05/a-look-at-FDWs/" target="_blank">http://www.craigkerstiens.com/2013/08/05/a-look-at-FDWs/</a><br>
<br>
And stay tuned to PostgreSQL 9.5, where there will be a "IMPORT<br>
FOREIGN SCHEMA" technique to expose more than one table.<br>
<a href="http://www.depesz.com/2014/07/14/waiting-for-9-5-implement-import-foreign-schema/" target="_blank">http://www.depesz.com/2014/07/14/waiting-for-9-5-implement-import-foreign-schema/</a><br>
<span class="HOEnZb"><font color="#888888"><br>
-Mike<br>
</font></span><div class="HOEnZb"><div class="h5">_______________________________________________<br>
postgis-users mailing list<br>
<a href="mailto:postgis-users@lists.osgeo.org">postgis-users@lists.osgeo.org</a><br>
<a href="http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users" target="_blank">http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users</a><br>
</div></div></blockquote></div><br></div>