From: David G Johnston <david.g.johnston@gmail.com>
To: pgsql-bugs@postgresql.org
Subject: Re: BUG #12106: pg_dump does not resolve circular dependency
Date: Sun, 30 Nov 2014 10:38:51 -0700 (MST)
Message-ID: <1417369131702-5828698.post@n5.nabble.com> (raw)
In-Reply-To: <9283.1417365074@sss.pgh.pa.us>
References: <20141130153705.5731.4615@wrigleys.postgresql.org>
<9283.1417365074@sss.pgh.pa.us>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-bugs>
Tom Lane-2 wrote
> bouda@
> writes:
>> A function may reference itself via default values of some of its
>> arguments.
>> It is rather tricky to create one, but it is possible:
>
> Unless you can demonstrate a credible use-case for this, I don't think
> it's worth adding complexity to pg_dump for.
Assuming: "Even worse, pg_dump returns 0 as the exit code, even though the
dump is not
usable. It merely issues a warning on output." is confirmed I would assume
that it would need to be fixed.
I'm not against simply letting pg_dump error out but it should do so
completely.
I imagine it would be reasonably simple to disallow CREATE FUNCTION to
reference the function being created in the default expressions but the
indirect circular dependency would definite be trickier. The uninformed
problem in both cases is dealing with function overloading - in addition to
simply tracking the cycle in the later scenario. But ideally we wouldn't
create something that pg_dump cannot restore...and not just allow pg_dump to
fail and figure that the user is going to test their restore code.
OTOH it is a function so unless itself is a dependency a warning would make
sense because the user, upon being informed of the issue, could manually
issue the same CREATE/REPLACE SQL command pair to re-construct the function
manually if they really need the capability.
David J.
--
View this message in context: http://postgresql.nabble.com/BUG-12106-pg-dump-does-not-resolve-circular-dependency-tp5828685p582869...
Sent from the PostgreSQL - bugs mailing list archive at Nabble.com.
--
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs
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: david.g.johnston@gmail.com
Subject: Re: BUG #12106: pg_dump does not resolve circular dependency
In-Reply-To: <1417369131702-5828698.post@n5.nabble.com>
References: <20141130153705.5731.4615@wrigleys.postgresql.org> <9283.1417365074@sss.pgh.pa.us> <1417369131702-5828698.post@n5.nabble.com>
* 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