Received: from magus.postgresql.org (magus.postgresql.org [87.238.57.229]) by mail.postgresql.org (Postfix) with ESMTP id 490B47661B5 for ; Thu, 21 Jun 2012 02:57:39 -0300 (ADT) Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1ShaOe-0002FN-8c for pgsql-bugs@postgresql.org; Thu, 21 Jun 2012 05:57:38 +0000 Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.5/8.14.5) with ESMTP id q5L5vK51016787; Thu, 21 Jun 2012 01:57:20 -0400 (EDT) From: Tom Lane To: Alvaro Herrera cc: Ryan Kelly , joe , Pg Bugs Subject: Re: BUG #6699: pg_restore with -j -- doesn't restore view that groups by primary key In-reply-to: <16032.1340255828@sss.pgh.pa.us> References: <20120619202058.GA7792@llserver.lakeliving.com> <1340139400-sup-7121@alvh.no-ip.org> <22882.1340141854@sss.pgh.pa.us> <12801.1340155595@sss.pgh.pa.us> <14084.1340159655@sss.pgh.pa.us> <16032.1340255828@sss.pgh.pa.us> Comments: In-reply-to Tom Lane message dated "Thu, 21 Jun 2012 01:17:08 -0400" Date: Thu, 21 Jun 2012 01:57:20 -0400 Message-ID: <16786.1340258240@sss.pgh.pa.us> X-Pg-Spam-Score: -1.9 (-) X-Archive-Number: 201206/185 X-Sequence-Number: 33412 I wrote: >>> We could possibly hack something for the special case of rules, but >>> I don't think this would be the last time we hear about this type of >>> issue. BTW, after comparing the dependencies emitted by this patch to those of HEAD for the regression database, I am convinced that indeed view rules are not the only issue; we have got a boatload of problems of this ilk, for instance: * objects dependent on array types link to an array-type entry that is not in the dump, not to the base type that is * composite types link to their underlying "DO_TABLE" entry (ie, the pg_class entry for the composite type) and thus miss any dependencies on, say, column data types * objects dependent on extension members have dangling links; notably, every single plpgsql function fails to have a visible dependency on the plpgsql extension * foreign key constraints have dependencies on PK indexes, but if the PK index was declared as a constraint, it's not visible under its own ID in the dump, so the dependency dangles. The proposed patch fixes all these cases. I am not sure whether any of the first three are hazards for parallel pg_restore, but the last one is: AFAICS, it will result in all such FK constraints being restored serially at the end, because the parallel loop never manages to clear all of their dependencies. Surprising nobody's complained about that. regards, tom lane