Received: from malur.postgresql.org ([2a02:16a8:dc51::56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fkFOe-0002Zs-CW for pgsql-general@arkaria.postgresql.org; Mon, 30 Jul 2018 21:08:04 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1fkFOc-0000CA-AB for pgsql-general@arkaria.postgresql.org; Mon, 30 Jul 2018 21:08:02 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fkFOb-0000C3-Tw for pgsql-general@lists.postgresql.org; Mon, 30 Jul 2018 21:08:02 +0000 Received: from wout3-smtp.messagingengine.com ([64.147.123.19]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fkFOZ-0001kF-6q for pgsql-general@postgresql.org; Mon, 30 Jul 2018 21:08:00 +0000 Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailout.west.internal (Postfix) with ESMTP id 3A81F661; Mon, 30 Jul 2018 17:07:58 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute6.internal (MEProxy); Mon, 30 Jul 2018 17:07:58 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aklaver.com; h= content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-sender :x-me-sender:x-sasl-enc; s=fm3; bh=qVF2P5zZCT3vdOrHAzYQ27nwJebP9 kx9SEzPIWUchEY=; b=ZMSsZ/ArqrPHWuYdxGuQkisK1Eg45462JGlXNqAD8TpWc EL5FPLhWt7WJlvw0yb+0S1bwOOzyXXFnFFUmoKxQ9LAsb395Zc//yU6VGUlKAq0D Rv/cttT50BeJq9asPEKW40Ky1YecaJtGo3pmZHkRUsqs+2d9X1k/5NZxx5voK/e8 +byHCg3gbsy6OCuyHOSH/AGoCAKPP4qiTe0OpQKeVuL2kNwlpzG/ENFNvrWqgMnV 6cv6OGqBJrHKcOyNYqMmtbaacBj6POTG3LrhwHrRY/Er1vU9RYLaGvH8P80MwNi7 VCP4edvK2rR10nPgMDGpzdzAAV59jHC5M0OYdxx9A== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-sender:x-me-sender:x-sasl-enc; s=fm3; bh=qVF2P5 zZCT3vdOrHAzYQ27nwJebP9kx9SEzPIWUchEY=; b=uJAQbk1ypYnBTFeBEstAmw ymSvjWuP4jG4JBFyWI5c9XpGNTCWV0l5G71BgtnKaUnl39vPSTvUirgZTPRLIDz4 8W/UvNGgvd5nfMoD4+ALK3lJbB4P5FZZfdYRU6NpUAYZyIoT/EkMm6IphbJoN8Zi R8a/+7F6H6HrdDG0s1Dkgpnf5kNizVkjY8wn4oVLPmC38Hif4V6/FhJq4U4tWrM1 WY25JeDCjWHQXPTuv4+Av2WKAsFvT21+3kY+NZ/sicDDY+7lKMnw+ZuzWDHD73ky +Jk0wDWb715Kvh/P8WSP6xc/NqhJffzBdvtQstb8oVHYOb+ssfNRRL78S2P88VeA == X-ME-Proxy: X-ME-Sender: Received: from ranger.suse (c-73-239-117-238.hsd1.wa.comcast.net [73.239.117.238]) by mail.messagingengine.com (Postfix) with ESMTPA id 027CFE486E; Mon, 30 Jul 2018 17:07:56 -0400 (EDT) Subject: Re: alter table docs To: Rob Sargent , "pgsql-general@postgresql.org" References: From: Adrian Klaver Message-ID: Date: Mon, 30 Jul 2018 14:07:55 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 07/30/2018 09:57 AM, Rob Sargent wrote: > I was just looking up alter table add constraint syntax under > "current(10)" and we get > >     ADD /table_constraint/ [ NOT VALID ] >     ADD /table_constraint_using_index/ > > There is a description below for the using_index version but none for > the plain version.  There is a block for the plain version on the CREATE I see one: https://www.postgresql.org/docs/10/static/sql-altertable.html "ADD table_constraint [ NOT VALID ] This form adds a new constraint to a table using the same syntax as CREATE TABLE, plus the option NOT VALID, which is currently only allowed for foreign key and CHECK constraints. If the constraint is marked NOT VALID, the potentially-lengthy initial check to verify that all rows in the table satisfy the constraint is skipped. The constraint will still be enforced against subsequent inserts or updates (that is, they'll fail unless there is a matching row in the referenced table, in the case of foreign keys; and they'll fail unless the new row matches the specified check constraints). But the database will not assume that the constraint holds for all rows in the table, until it is validated by using the VALIDATE CONSTRAINT option. " > TABLE page. Should it not also appear in the ALTER TABLE page? > > -- Adrian Klaver adrian.klaver@aklaver.com