Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1emOh7-0007Q2-49 for pgsql-docs@arkaria.postgresql.org; Thu, 15 Feb 2018 18:55:45 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1emOh6-0000ME-2D for pgsql-docs@arkaria.postgresql.org; Thu, 15 Feb 2018 18:55:44 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1emOh5-0000M4-Sq for pgsql-docs@lists.postgresql.org; Thu, 15 Feb 2018 18:55:43 +0000 Received: from [195.159.176.226] (helo=blaine.gmane.org) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1emOh2-00031F-IS for pgsql-docs@postgresql.org; Thu, 15 Feb 2018 18:55:43 +0000 Received: from list by blaine.gmane.org with local (Exim 4.84_2) (envelope-from ) id 1emOed-0000WX-UU for pgsql-docs@postgresql.org; Thu, 15 Feb 2018 19:53:11 +0100 X-Injected-Via-Gmane: http://gmane.org/ To: pgsql-docs@postgresql.org From: Neil Anderson Subject: Re: The example for creating a check constraint is missing a comma Date: Thu, 15 Feb 2018 13:55:08 -0500 Organization: Postgres Compare Lines: 51 Message-ID: <14943ebd-1042-f331-2589-f1690a0786f4@postgrescompare.com> References: <151871659877.1393.2431103178451978795@wrigleys.postgresql.org> <27717.1518720459@sss.pgh.pa.us> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------B2335AC0A896D821C19E2030" X-Complaints-To: usenet@blaine.gmane.org User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 In-Reply-To: <27717.1518720459@sss.pgh.pa.us> Content-Language: en-US X-Host-Lookup-Failed: Reverse DNS lookup failed for 195.159.176.226 (failed) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk This is a multi-part message in MIME format. --------------B2335AC0A896D821C19E2030 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit On 2018-02-15 1:47 PM, Tom Lane wrote: > =?utf-8?q?PG_Doc_comments_form?= writes: >> See the example from the documentation for CREATE TABLE below. There should >> be a comma before the CONSTRAINT keyword. > >> CREATE TABLE distributors ( >> did integer, >> name varchar(40) >> CONSTRAINT con1 CHECK (did > 100 AND name <> '') >> ); > > Hmm ... that example is legal syntax as-is, but considering that the > explanation for it says specifically that it's table-constraint syntax > not column-constraint syntax, I think you're right. > > regards, tom lane > > Oh yeah! You're right, strictly speaking it does work. I guess I read it as a table constraint because it's on the next line. -- Neil Anderson neil@postgrescompare.com http://www.postgrescompare.com --------------B2335AC0A896D821C19E2030 Content-Type: text/x-vcard; charset=utf-8; name="neil.vcf" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="neil.vcf" begin:vcard fn:Neil Anderson n:Anderson;Neil email;internet:neil@postgrescompare.com x-mozilla-html:FALSE url:https://www.postgrescompare.com version:2.1 end:vcard --------------B2335AC0A896D821C19E2030--