<div dir="ltr">This problem arises because PostgreSQL sets the search path during the restore process. Unfortunately, the search path is quite restrictive.<div><br></div><div>You should be able to do your restore in three sections using pg_restore's --section flag.</div><div><br></div><div>The error looks like it has to be the post-data section, which you should output to a text file, change the "SET search_path" statements and then run through psql.</div><div><br></div><div>-bborie</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Nov 10, 2015 at 1:11 PM, Darrel Maddy <span dir="ltr"><<a href="mailto:darrel.maddy@newcastle.ac.uk" target="_blank">darrel.maddy@newcastle.ac.uk</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">





<div lang="EN-GB" link="#0563C1" vlink="#954F72">
<div>
<p class="MsoNormal">Dear all,<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">Like many here I suspect I want to keep a copy of my main databases held on my workstation, on my laptop. I used PgAdmin to backup the databases concerned (the backup files look about the size I was expecting)  but restore on my laptop
 did not successfully complete.  All my shp file tables restored without issues but my raster tables (these are tiled rasters) would not. Looking at the error in the restore window of PgAdmin this appears to be a problem with a function/constraint.<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">pg_restore: processing data for table "dems"<u></u><u></u></p>
<p class="MsoNormal">pg_restore: [archiver (db)] Error while PROCESSING TOC:<u></u><u></u></p>
<p class="MsoNormal">pg_restore: [archiver (db)] Error from TOC entry 3459; 0 94054 TABLE DATA dems postgres<u></u><u></u></p>
<p class="MsoNormal">pg_restore: [archiver (db)] COPY failed for table "dems": ERROR:  function st_bandmetadata(public.raster, integer[]) does not exist<u></u><u></u></p>
<p class="MsoNormal">LINE 1:  SELECT array_agg(pixeltype)::text[] FROM st_bandmetadata($1...<u></u><u></u></p>
<p class="MsoNormal">                                                  ^<u></u><u></u></p>
<p class="MsoNormal">HINT:  No function matches the given name and argument types. You might need to add explicit type casts.<u></u><u></u></p>
<p class="MsoNormal">QUERY:   SELECT array_agg(pixeltype)::text[] FROM st_bandmetadata($1, ARRAY[]::int[]);
<u></u><u></u></p>
<p class="MsoNormal">CONTEXT:  SQL function "_raster_constraint_pixel_types" during inlining<u></u><u></u></p>
<p class="MsoNormal">COPY dems, line 1: "1              0100000100000000000000344000000000000034C0E0CCCCCCB1D517418066666692F80C41000000000000000000000000..."<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">I did a quick search and found some old chatter on this issue but from the messages I read I would have expected this issue to have been cleared up in postgis 2 . 
<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">Obviously I cannot contemplate having mission critical data in a database which does not backup/restore correctly so I am assuming there is a fix which avoids this issue or there is another way to make a copy of the database for transfer
 elsewhere?<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">Once again any help would be gratefully received.<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">Best wishes<span class="HOEnZb"><font color="#888888"><u></u><u></u></font></span></p><span class="HOEnZb"><font color="#888888">
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">Darrel<u></u><u></u></p>
</font></span><p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">ps.   Apologies for the string of questions I have asked lately – I will go silent once more shortly as I must move on to other things.<u></u><u></u></p>
</div>
</div>

<br>_______________________________________________<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/mailman/listinfo/postgis-users" rel="noreferrer" target="_blank">http://lists.osgeo.org/mailman/listinfo/postgis-users</a><br></blockquote></div><br></div>