Received: from maia.hub.org (maia-2.hub.org [200.46.204.251]) by mail.postgresql.org (Postfix) with ESMTP id 7FB6F1336FA7 for ; Mon, 31 Jan 2011 13:53:26 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.251]) (amavisd-maia, port 10024) with ESMTP id 75381-01 for ; Mon, 31 Jan 2011 17:53:19 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by mail.postgresql.org (Postfix) with ESMTP id 00F8C133616B for ; Mon, 31 Jan 2011 13:53:18 -0400 (AST) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.2/8.14.2) with ESMTP id p0VHrH7t019318; Mon, 31 Jan 2011 12:53:17 -0500 (EST) To: "Stuart Bishop" cc: pgsql-bugs@postgresql.org Subject: Re: BUG #5857: pg_restore --clean dropping type too soon In-reply-to: <201101311344.p0VDixSt089341@wwwmaster.postgresql.org> References: <201101311344.p0VDixSt089341@wwwmaster.postgresql.org> Comments: In-reply-to "Stuart Bishop" message dated "Mon, 31 Jan 2011 13:44:59 +0000" Date: Mon, 31 Jan 2011 12:53:17 -0500 Message-ID: <19317.1296496397@sss.pgh.pa.us> From: Tom Lane 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: 201101/250 X-Sequence-Number: 29272 "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. regards, tom lane