Re: The example for creating a check constraint is missing a comma

From: Neil Anderson <neil(at)postgrescompare(dot)com>
To: pgsql-docs(at)postgresql(dot)org
Subject: Re: The example for creating a check constraint is missing a comma
Date: 2018-02-15 18:55:08
Message-ID: 14943ebd-1042-f331-2589-f1690a0786f4@postgrescompare.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-docs

On 2018-02-15 1:47 PM, Tom Lane wrote:
> =?utf-8?q?PG_Doc_comments_form?= <noreply(at)postgresql(dot)org> 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(at)postgrescompare(dot)com
http://www.postgrescompare.com

Attachment Content-Type Size
neil.vcf text/x-vcard 165 bytes

In response to

Browse pgsql-docs by date

  From Date Subject
Next Message PG Doc comments form 2018-02-15 23:06:27 i think there's a typo
Previous Message Tom Lane 2018-02-15 18:47:39 Re: The example for creating a check constraint is missing a comma