<html><body><div style="color:#000; background-color:#fff; font-family:times new roman, new york, times, serif;font-size:12pt">Right.<br><br>As you supposed to know, IMO make a first<br><br>pg_restore -l yourbackup.dump &gt; yourbackup.toc<br><br>then as you suggested, try to find the 'word' to exclude using grep.<br><br>--exclude-schema was specially done to exclude Slony schema. For example, if there is a "vacuum process" on Slony's tables <br>while pg_dump is running, you may suffer from deadlock.<br><br><br><div><br></div>  <div style="font-family: times new roman, new york, times, serif; font-size: 12pt;"> <div style="font-family: times new roman, new york, times, serif; font-size: 12pt;"> <font face="Arial" size="2"> <hr size="1">  <b><span style="font-weight:bold;">De&nbsp;:</span></b> Stuart Bishop &lt;stuart@stuartbishop.net&gt;<br> <b><span style="font-weight: bold;">À&nbsp;:</span></b> David TECHER &lt;davidtecher@yahoo.fr&gt; <br><b><span
 style="font-weight: bold;">Cc&nbsp;:</span></b> slony &lt;slony1-general@lists.slony.info&gt; <br> <b><span style="font-weight: bold;">Envoyé le :</span></b> Mercredi 30 Novembre 2011 8h55<br> <b><span style="font-weight: bold;">Objet&nbsp;:</span></b> Re: Re : [Slony1-general] Re : dump, restore &amp; --exclude-schema<br> </font> <br>On Tue, Nov 29, 2011 at 8:28 PM, David TECHER &lt;<a ymailto="mailto:davidtecher@yahoo.fr" href="mailto:davidtecher@yahoo.fr">davidtecher@yahoo.fr</a>&gt; wrote:<br>&gt; I did a little mistake<br>&gt;<br>&gt; pg_dump -N _ the_name_of_clustername -Fc -f yourdump.dmp -h... -p... -U....<br>&gt; ....<br>&gt;<br>&gt; First generate the TOC using -l<br>&gt;<br>&gt; pg_restore -l yourdump.dmp | grep -v the_name_of_clustername &gt; toc.safe<br>&gt;<br>&gt; Then restore using the new toc and -L<br>&gt;<br>&gt; pg_restore -L toc.safe yourdump.dmp<br><br><br>Thanks.<br><br>This looks rather fragile (I'll need to modify it to catch
 false<br>positives with that grep for starters - curses for picking a simple<br>clustername). Unfortunately I might have to run with it as I noticed<br>from my commit logs that the other reason for using --exclude-schema<br>was to avoid the read lock that causes reported database lag to bloat<br>when doing backups (setting off nagios alerts and waking people up).<br><br>Or maybe I should just exclude certain tables to avoid the locking issue?<br><br>-- <br>Stuart Bishop &lt;<a ymailto="mailto:stuart@stuartbishop.net" href="mailto:stuart@stuartbishop.net">stuart@stuartbishop.net</a>&gt;<br><a href="http://www.stuartbishop.net/" target="_blank">http://www.stuartbishop.net/</a><br><br><br> </div> </div>  </div></body></html>