Received: from localhost (unknown [200.46.204.183]) by developer.postgresql.org (Postfix) with ESMTP id EABBF2E0056 for ; Mon, 9 Jun 2008 13:43:26 -0300 (ADT) Received: from developer.postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 84343-08 for ; Mon, 9 Jun 2008 13:43:20 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from vms173001pub.verizon.net (vms173001pub.verizon.net [206.46.173.1]) by developer.postgresql.org (Postfix) with ESMTP id D09472E0039 for ; Mon, 9 Jun 2008 13:43:20 -0300 (ADT) Received: from ridley.home ([71.179.5.175]) by vms173001.mailsrvcs.net (Sun Java System Messaging Server 6.2-6.01 (built Apr 3 2006)) with ESMTPA id <0K270059XFJ2NEAX@vms173001.mailsrvcs.net> for pgsql-hackers@postgresql.org; Mon, 09 Jun 2008 11:37:50 -0500 (CDT) Date: Mon, 09 Jun 2008 12:37:47 -0400 From: Robert Treat Subject: Re: pg_dump restore time and Foreign Keys In-reply-to: <20406.1213027167@sss.pgh.pa.us> To: Tom Lane Cc: Simon Riggs , Decibel! , Andrew Dunstan , pgsql-hackers@postgresql.org Message-id: <200806091237.49153.xzilla@users.sourceforge.net> MIME-version: 1.0 Content-type: text/plain; charset=iso-8859-15 Content-transfer-encoding: 7bit Content-disposition: inline References: <1212647003.19964.19.camel@ebony.site> <1213026485.12046.123.camel@ebony.site> <20406.1213027167@sss.pgh.pa.us> User-Agent: KMail/1.9.9 X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200806/408 X-Sequence-Number: 119521 On Monday 09 June 2008 11:59:27 Tom Lane wrote: > Simon Riggs writes: > > On Mon, 2008-06-09 at 11:33 -0400, Tom Lane wrote: > >> No, we are running a large query to which the user *thinks* he knows the > >> answer. There are any number of reasons why he might be wrong. > > > > Of course. I should have said "to which we already know the answer" to > > indicate I'm passing on others' criticisms of us. > > [ shrug... ] We don't know the answer either, and anyone who says > we do is merely betraying his ignorance of the number of ways to load > a foot-gun. > I think the more realistic scenario (based on the FK idea) is that you want to prevent any future rows from coming without validating the FK, and you're willing to clean up any violators after the fact, since you can make that an "out of the critical path" operation. if you extend this to a more general "create constraint concurrently" (to handle normal constraint, not null constraints, etc...), it would certainly be a big win, and i think most would see it as a reasonable compromise. -- Robert Treat Build A Brighter LAMP :: Linux Apache {middleware} PostgreSQL