pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Bruce Momjian <bruce@momjian.us>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Stuart Bishop <stuart@stuartbishop.net>
Cc: pgsql-bugs@postgresql.org
Subject: Re: BUG #5857: pg_restore --clean dropping type too soon
Date: Fri, 11 Mar 2011 07:05:54 -0500 (EST)
Message-ID: <201103111205.p2BC5sM14014@momjian.us> (raw)
In-Reply-To: <19317.1296496397@sss.pgh.pa.us>

Tom Lane wrote:
> "Stuart Bishop" <stuart@stuartbishop.net> 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  <bruce@momjian.us>        http://momjian.us
  EnterpriseDB                             http://enterprisedb.com

  + It's impossible for everything to be true. +

Attachments:

/rtmp/restore.diff (text/x-diff, 530B) download 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 <listitem> <para> 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.) </para> <para>

view thread (3+ messages)

Message-ID: <201103111205.p2BC5sM14014@momjian.us>
Permalink:  ../201103111205.p2BC5sM14014@momjian.us/
Also on:    postgresql.org/message-id/201103111205.p2BC5sM14014@momjian.us

 ·  · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-bugs@postgresql.org
  Cc: bruce@momjian.us, tgl@sss.pgh.pa.us, stuart@stuartbishop.net
  Subject: Re: BUG #5857: pg_restore --clean dropping type too soon
  In-Reply-To: <201103111205.p2BC5sM14014@momjian.us>
  References: <19317.1296496397@sss.pgh.pa.us> <201103111205.p2BC5sM14014@momjian.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox