Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1Xv8Sf-0007hK-LF for pgsql-bugs@arkaria.postgresql.org; Sun, 30 Nov 2014 17:39:05 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1Xv8Se-00025d-Uj for pgsql-bugs@arkaria.postgresql.org; Sun, 30 Nov 2014 17:39:04 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1Xv8Sd-00025W-W2 for pgsql-bugs@postgresql.org; Sun, 30 Nov 2014 17:39:04 +0000 Received: from [162.253.133.43] (helo=mwork.nabble.com) by magus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1Xv8ST-0006BJ-Kw for pgsql-bugs@postgresql.org; Sun, 30 Nov 2014 17:39:02 +0000 Received: from msam.nabble.com (unknown [162.253.133.85]) by mwork.nabble.com (Postfix) with ESMTP id 3A807BB4C8D for ; Sun, 30 Nov 2014 09:38:52 -0800 (PST) Date: Sun, 30 Nov 2014 10:38:51 -0700 (MST) From: David G Johnston To: pgsql-bugs@postgresql.org Message-ID: <1417369131702-5828698.post@n5.nabble.com> In-Reply-To: <9283.1417365074@sss.pgh.pa.us> References: <20141130153705.5731.4615@wrigleys.postgresql.org> <9283.1417365074@sss.pgh.pa.us> Subject: Re: BUG #12106: pg_dump does not resolve circular dependency MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Host-Lookup-Failed: Reverse DNS lookup failed for 162.253.133.43 (failed) X-Pg-Spam-Score: 0.5 (/) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-bugs Precedence: bulk Sender: pgsql-bugs-owner@postgresql.org 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-tp5828685p5828698.html 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