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

From: PG Doc comments form <[email-masked]>
Date: Thu, 15 Feb 2018 17:43:18 +0000

The following documentation comment has been logged on the website:

Page: https://www.postgresql.org/docs/10/static/sql-createtable.html
Description:

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 <> '')
);

---

From: Tom Lane <[email-masked]>
Date: Thu, 15 Feb 2018 13:47:39 -0500

>     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

---

From: Neil Anderson <[email-masked]>
Date: Thu, 15 Feb 2018 13:55:08 -0500

> not column-constraint syntax, I think you're right.

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
[email-masked]
http://www.postgrescompare.com