pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Stuart Bishop <stuart@stuartbishop.net>
Cc: pgsql-bugs@postgresql.org
Subject: Re: BUG #5857: pg_restore --clean dropping type too soon
Date: Mon, 31 Jan 2011 12:53:17 -0500
Message-ID: <19317.1296496397@sss.pgh.pa.us> (raw)
In-Reply-To: <201101311344.p0VDixSt089341@wwwmaster.postgresql.org>
References: <201101311344.p0VDixSt089341@wwwmaster.postgresql.org>

"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.

			regards, tom lane



view thread (3+ messages)  latest in thread

Message-ID: <19317.1296496397@sss.pgh.pa.us>
Permalink:  ../19317.1296496397@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/19317.1296496397@sss.pgh.pa.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: tgl@sss.pgh.pa.us, stuart@stuartbishop.net
  Subject: Re: BUG #5857: pg_restore --clean dropping type too soon
  In-Reply-To: <19317.1296496397@sss.pgh.pa.us>
  References: <201101311344.p0VDixSt089341@wwwmaster.postgresql.org> <19317.1296496397@sss.pgh.pa.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