Received: from maia.hub.org (maia-3.hub.org [200.46.204.243]) by mail.postgresql.org (Postfix) with ESMTP id 44B2A1337C14 for ; Fri, 11 Mar 2011 08:06:20 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.243]) (amavisd-maia, port 10024) with ESMTP id 54364-03-3 for ; Fri, 11 Mar 2011 12:06:12 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from momjian.us (momjian.us [70.90.9.53]) by mail.postgresql.org (Postfix) with ESMTP id A93991337C4F for ; Fri, 11 Mar 2011 08:05:51 -0400 (AST) Received: (from bruce@localhost) by momjian.us (8.11.6/8.11.6) id p2BC5sM14014; Fri, 11 Mar 2011 07:05:54 -0500 (EST) From: Bruce Momjian Message-Id: <201103111205.p2BC5sM14014@momjian.us> Subject: Re: BUG #5857: pg_restore --clean dropping type too soon In-Reply-To: <19317.1296496397@sss.pgh.pa.us> To: Tom Lane Date: Fri, 11 Mar 2011 07:05:54 -0500 (EST) CC: Stuart Bishop , pgsql-bugs@postgresql.org X-Mailer: ELM [version 2.4ME+ PL124 (25)] MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="ELM1299845154-10557-2_" Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.91 tagged_above=-5 required=5 tests=BAYES_00=-1.9, T_RP_MATCHES_RCVD=-0.01 X-Spam-Level: X-Archive-Number: 201103/186 X-Sequence-Number: 29696 --ELM1299845154-10557-2_ Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="US-ASCII" Tom Lane wrote: > "Stuart Bishop" writes: > > "pg_restore --clean" appears to have an ordering problem, where a custom > > type is being dropped before some functions that use that custom type as a > > parameter, which fails. > > It's always worked that way, and is difficult to avoid because of the > circular dependencies between a type and its I/O functions. If we were > to suppress the DROP FUNCTION commands for the I/O functions, we could > have a non-cosmetic failure: suppose the functions have been created > in the target DB, but not the type itself? Then the DROP TYPE CASCADE > wouldn't remove the functions, and we'd have a conflict when the script > tries to create them again. > > I don't think anyone's ever felt that it was essential for --clean to > not produce any "no such object" errors, since in general you'd get some > of those anyway unless the target DB exactly matches the source. Maybe > an appropriate response is to document that this is expected. Applied doc patch attached. -- Bruce Momjian http://momjian.us EnterpriseDB http://enterprisedb.com + It's impossible for everything to be true. + --ELM1299845154-10557-2_ Content-Transfer-Encoding: 7bit Content-Type: text/x-diff Content-Disposition: inline; filename="/rtmp/restore.diff" diff --git a/doc/src/sgml/ref/pg_dump.sgml b/doc/src/sgml/ref/pg_dump.sgml index e78d275..7f12460 100644 --- a/doc/src/sgml/ref/pg_dump.sgml +++ b/doc/src/sgml/ref/pg_dump.sgml @@ -142,7 +142,8 @@ PostgreSQL documentation Output commands to clean (drop) - database objects prior to (the commands for) creating them. + database objects prior to outputing the commands for creating them. + (Restore might generate some harmless errors.) --ELM1299845154-10557-2_--