Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1Uj6lM-0003jh-1h for pgsql-docs@arkaria.postgresql.org; Sun, 02 Jun 2013 11:47:52 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.72) (envelope-from ) id 1Uj6lL-0002OG-Ct for pgsql-docs@arkaria.postgresql.org; Sun, 02 Jun 2013 11:47:51 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1Uj6lK-0002OA-I4 for pgsql-docs@postgresql.org; Sun, 02 Jun 2013 11:47:50 +0000 Received: from nm10-vm0.bullet.mail.bf1.yahoo.com ([98.139.213.147]) by magus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1Uj6lA-0006nT-Hh for pgsql-docs@postgresql.org; Sun, 02 Jun 2013 11:47:49 +0000 Received: from [98.139.212.151] by nm10.bullet.mail.bf1.yahoo.com with NNFMP; 02 Jun 2013 11:47:38 -0000 Received: from [98.139.212.231] by tm8.bullet.mail.bf1.yahoo.com with NNFMP; 02 Jun 2013 11:47:38 -0000 Received: from [127.0.0.1] by omp1040.mail.bf1.yahoo.com with NNFMP; 02 Jun 2013 11:47:38 -0000 X-Yahoo-Newman-Property: ymail-3 X-Yahoo-Newman-Id: 544517.18033.bm@omp1040.mail.bf1.yahoo.com Received: (qmail 49812 invoked by uid 60001); 2 Jun 2013 11:47:38 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ymail.com; s=s1024; t=1370173658; bh=lESiqkLlxulXqrrRsGUAEBLdIVvQqNIpzoPTogP/Kmc=; h=X-YMail-OSG:Received:X-Rocket-MIMEInfo:X-Mailer:References:Message-ID:Date:From:Reply-To:Subject:To:In-Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding; b=yFKSWIvo3E+AeoGh0U2dhQfQMzaNRg1LVQqWcP5Z3fAmSqV+sY1jhN0x0u6RISNhMkRLyFd/i5gpQR10TOQNIY20QxE3BNqnsbBtbnTPm+/N0cz0Vhvivoy4dghguz7cxlvMAnZnK0Ij0opwu/tvHJ3sxx+Agfy7xrDYe5AXgV0= DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=ymail.com; h=X-YMail-OSG:Received:X-Rocket-MIMEInfo:X-Mailer:References:Message-ID:Date:From:Reply-To:Subject:To:In-Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding; b=PecNZD1ZhmrLUXGLyhvV/15DCN5M6/kdkgxiuK/oJChXSmK3c2GBmuuWyPwFEjoCaNr3SJYK3rJM16f6qeNQmfHHLMfqF2C06hnw981sh+YLRJoisK3dgq7aa8FGYQr1Iq5xFnybQz2blbiq4h6b1TQPyWnzCfQMnkGCbz+wCAQ=; X-YMail-OSG: xhQld.AVM1k4raS9TzMuDw2hpRHKi0Hjj4fitRPXJ6d4ywW tkfybJffRlEoo44XbESWKzzc3qJtROn_wItnxy8gNFeKt6kmdAeSyGmoW7Ih drO13u1s5Zc9WCsO_OLSB8LITH1H2AJZ6vUYPBU6KNVBtpf0Mz_uUcuLDnJO J5k8l5.I8VK9tufj5mVw.scvY84V10ieYvnDDQceSJitO.gJjsQF0tCKr_i4 qsboD8zRnGX01GnqqDDN2_u1AKLLANAt92rxhrpUBkVkZ8rVPmgjOCqjm2Z_ s3m4YOVtJQiVsuYao1TnG8EbsH9IdE9OymYwuwRUHPJib04pcnAASNWmDjTw gu.r.O885XnENoxn2FeBjW4Aqy6985U1G.3eTqBLcfPxXN5Us.E7WDjIrSh9 nnjxbMewoZRsjtWw7NrjMdWcNrdw1BW48oqH.tumaMA8HFvT78xy.nzUxttt Ec1xr.Ims52RprjKZ2O7PrVXzMo2pd_ADIWgM8HFFpht3x5.T1WFbz4PJacg FGU2TCAR5I7Qz9.yeVMkeeU7tRRy7DRAq2Yeep0BIFsQsBKzRM6Iz3xqYTa1 N Received: from [76.255.18.237] by web162902.mail.bf1.yahoo.com via HTTP; Sun, 02 Jun 2013 04:47:38 PDT X-Rocket-MIMEInfo: 002.001, TWFya28gVGlpa2thamEgPG1hcmtvQGpvaC50bz4gd3JvdGU6Cj4gT24gNS8yNy8xMyA1OjIzIFBNLCBJIHdyb3RlOgo.PiBUb2RheSBJIGdvdCAodW5mb3J0dW5hdGVseSkgcmVtaW5kZWQgdGhhdCB0aGlzIHN0YXRlbWVudCwgaW4KPj4gc3FsLWFsdGVydGFibGUuaHRtbCB1bmRlciBWQUxJREFURSBDT05TVFJBSU5ULCBpcyBub3QgdHJ1ZSBhbnltb3JlOgo.Pgo.PiBUaGUgdmFsdWUgb2Ygc2VwYXJhdGluZyB2YWxpZGF0aW9uIGZyb20gaW5pdGlhbCBjcmVhdGlvbiBvZiB0aGUKPj4gY29uc3RyYWludCBpcyABMAEBAQE- X-Mailer: YahooMailWebService/0.8.145.547 References: <51A37A72.5000203@joh.to> <51A89BAE.6000704@joh.to> Message-ID: <1370173658.22143.YahooMailNeo@web162902.mail.bf1.yahoo.com> Date: Sun, 2 Jun 2013 04:47:38 -0700 (PDT) From: Kevin Grittner Reply-To: Kevin Grittner Subject: Re: ALTER TABLE lock level To: Marko Tiikkaja , "pgsql-docs@postgresql.org" In-Reply-To: <51A89BAE.6000704@joh.to> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable X-Pg-Spam-Score: -0.6 (/) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-docs Precedence: bulk Sender: pgsql-docs-owner@postgresql.org Marko Tiikkaja wrote: > On 5/27/13 5:23 PM, I wrote: >> Today I got (unfortunately) reminded that this statement, in >> sql-altertable.html under VALIDATE CONSTRAINT, is not true anymore: >> >> The value of separating validation from initial creation of the >> constraint is that validation requires a lesser lock on the table than >> constraint creation does. > > Since nobody seems to want to pick this up, I'm going to suggest the > following wording: > >=A0=A0=A0=A0 The value of separating validation from initial creation of t= he >=A0=A0=A0=A0 constraint is that you can immediately start enforcing the >=A0=A0=A0=A0 constraint on all future rows, but delay the validation of >=A0=A0=A0=A0 pre-existing data until your database is not under heavy load. That's good as far as it goes, but there's another major reason for wanting the capability.=A0 There are cases where, due to dirty converted data or late recognition of the need for a constraint there is existing data which violates the constraint.=A0 Being able to add a constraint to protect against creating additional bad data before all the existing problems are cleaned up can be valuable. I know of cases where the old rows which violate the constraint may persist for decades.=A0 In a court setting they may care a lot that data on a new and active court case is forced to be correct when entered, but may not feel that it is worth the cost (or in some cases even possible) to determine correct values for cases which are 10 or 20 (or 120) years old.=A0 These cases can't be deleted due to records retention laws or relevant court rules, and for a DBA to update them with bogus values to make them comply with the constraint would be not only potentially more misleading than leaving them alone, but would be a felony. > But I'm not going to object to simply removing the entire sentence. I don't know -- it seems like the reasons for the feature are non-obvious enough that such a note is useful. --=20 Kevin Grittner EnterpriseDB: http://www.enterprisedb.com The Enterprise PostgreSQL Company --=20 Sent via pgsql-docs mailing list (pgsql-docs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-docs