<div dir="ltr"><div>Thanks, I will give it a try.</div>All the new data schemas were created long after installation of postgis  so postgis cannot be installed there.<div>Most probably the postgis functions/objects are in public schema.<div>1) the posgtis was installed via create extension postgis ; -- no schema was specified.</div><div>2) There is only one table with name  spatial_ref_sys and its in public schema.</div><div><br></div><div><div>select table_schema from information_schema.tables where table_name ='spatial_ref_sys';</div><div> table_schema </div><div>--------------</div><div> public</div><div><br></div><div><br></div></div></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Oct 19, 2017 at 10:43 AM, Sandro Santilli <span dir="ltr"><<a href="mailto:strk@kbt.io" target="_blank">strk@kbt.io</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On Thu, Oct 19, 2017 at 10:21:46AM -0700, Hemant Bist wrote:<br>
> We  have an old database (postgis 2.1.2/postgresql-9.3/ubuntu 14.04), and a<br>
> new database (postgis 2.4.0,postgresql-9.5,ubuntu 16.04). Old database was<br>
> created via Hard Upgrade<br>
</span>> <<a href="https://postgis.net/docs/postgis_installation.html#hard_upgrade" rel="noreferrer" target="_blank">https://postgis.net/docs/<wbr>postgis_installation.html#<wbr>hard_upgrade</a>> Although<br>
<span class="">> both dbs have spatial tables in public schema, the data I want to copy over<br>
> is in their own schemas.<br>
><br>
> Can I do the following?<br>
> 1) Copy data for a schema/tables  from old db to new db?<br>
> 2) Copy data for a schema /tables from new db to old db? NOT sure what the<br>
> caveats here would be.<br>
<br>
</span>If your data is in a *different* schema from the postgis<br>
functions/objects it should be straight-forward to move them around<br>
(pg_dump/pg_restore). If postgis is in the same schema as the data<br>
you'll need <a href="http://postgis_restore.pl" rel="noreferrer" target="_blank">postgis_restore.pl</a> instead of pg_restore. In both cases<br>
you can restrict the pg_dump to the schema of interest.<br>
<br>
--strk;<br>
______________________________<wbr>_________________<br>
postgis-users mailing list<br>
<a href="mailto:postgis-users@lists.osgeo.org">postgis-users@lists.osgeo.org</a><br>
<a href="https://lists.osgeo.org/mailman/listinfo/postgis-users" rel="noreferrer" target="_blank">https://lists.osgeo.org/<wbr>mailman/listinfo/postgis-users</a></blockquote></div><br></div>