X-Original-To: pgsql-hackers-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.130]) by svr1.postgresql.org (Postfix) with ESMTP id 61F5AD1CAE9 for ; Wed, 1 Oct 2003 03:19:19 +0000 (GMT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (neptune.hub.org [64.117.224.130]) (amavisd-new, port 10024) with ESMTP id 18100-10 for ; Wed, 1 Oct 2003 00:18:32 -0300 (ADT) Received: from www.postgresql.com (unknown [64.117.225.209]) by svr1.postgresql.org (Postfix) with ESMTP id A4D97D1B976 for ; Tue, 30 Sep 2003 23:22:04 -0300 (ADT) Received: from svr4.postgresql.org (svr4.postgresql.org [64.117.224.192]) by www.postgresql.com (Postfix) with ESMTP id 0925ACF78F8 for ; Tue, 30 Sep 2003 15:13:04 -0300 (ADT) Received: from megazone.bigpanda.com (megazone.bigpanda.com [64.147.171.210]) by svr4.postgresql.org (Postfix) with ESMTP id 999641CB4989 for ; Tue, 30 Sep 2003 14:57:23 +0000 (GMT) Received: by megazone.bigpanda.com (Postfix, from userid 1001) id 308E9352DA; Tue, 30 Sep 2003 07:53:28 -0700 (PDT) Received: from localhost (localhost [127.0.0.1]) by megazone.bigpanda.com (Postfix) with ESMTP id 2EE06352D9; Tue, 30 Sep 2003 07:53:28 -0700 (PDT) Date: Tue, 30 Sep 2003 07:53:28 -0700 (PDT) From: Stephan Szabo To: Tom Lane Cc: Bruce Momjian , Jan Wieck , Christopher Kings-Lynne , Peter Childs , PostgreSQL-development Subject: Re: ADD FOREIGN KEY (was Re: [GENERAL] 7.4Beta) In-Reply-To: <19140.1064930871@sss.pgh.pa.us> Message-ID: <20030930074408.H14474@megazone.bigpanda.com> References: <200309301233.h8UCXcQ21796@candle.pha.pa.us> <19140.1064930871@sss.pgh.pa.us> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200310/11 X-Sequence-Number: 44693 On Tue, 30 Sep 2003, Tom Lane wrote: > I see where Stephan is coming from, but in my mind disabling consistency > checks ought to be a feature reserved to the DBA (ie superuser), who > presumably has some clue about the tradeoffs involved. I don't think > ordinary users should be able to do it. If we can get the cost of > performing the initial check down to something reasonable (and I don't > mean "near zero", I mean something that's small in comparison to the > other costs of loading data and creating indexes), then I think we've > done as much as we should do for ordinary users. Limiting the cases under which constraint ignoring works is certainly fine by me, but I was assuming that we were trying to make it accessable to any restore. If that's not true, then we don't need to worry about that part of the issue. As a side note, in the partial implementation I'd already done, I noticed a potential problem if the person doing the alter table didn't have read permissions on the pktable. I'd written it to bail and do the slow check in that case (well actually in most error cases that didn't themselves cause an elog), does anyone have a better idea?