Received: from magus.postgresql.org (magus.postgresql.org [87.238.57.229]) by mail.postgresql.org (Postfix) with ESMTP id 852CB11F7E64 for ; Tue, 19 Jun 2012 23:56:50 -0300 (ADT) Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1ShB67-0000ee-GK for pgsql-bugs@postgresql.org; Wed, 20 Jun 2012 02:56:49 +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 q5K2uVAB014429; Tue, 19 Jun 2012 22:56:31 -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: <12801.1340155595@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> Comments: In-reply-to Tom Lane message dated "Tue, 19 Jun 2012 21:26:35 -0400" Date: Tue, 19 Jun 2012 22:56:30 -0400 Message-ID: <14428.1340160990@sss.pgh.pa.us> X-Pg-Spam-Score: -1.9 (-) X-Archive-Number: 201206/168 X-Sequence-Number: 33395 I wrote: > 168; 1259 41968 TABLE public t1 postgres > ; depends on: 5 > 1921; 2606 41975 CONSTRAINT public t1_pkey postgres > ; depends on: 168 168 > 169; 1259 41976 VIEW public v1 postgres > ; depends on: 1919 5 > 1922; 0 41968 TABLE DATA public t1 postgres > ; depends on: 168 BTW, there's another pretty unpleasant thing going on here, which is that the t1_pkey constraint is getting hoisted up to before t1's table data because it is a dependency of v1. That means the index will be created before the data is loaded, which is not what we want. Parallel pg_restore actually has a hack that should work around that, namely repoint_table_dependencies(). That doesn't help for plain serial restores though. I'm thinking we really ought to bite the bullet and do something comparable to repoint_table_dependencies() at an appropriate point in pg_dump, so that the dependencies are sane to begin with. regards, tom lane