Thread

Commits

  1. Doc: fix minor bug in CREATE TABLE example.

  1. The example for creating a check constraint is missing a comma

    The Post Office <noreply@postgresql.org> — 2018-02-15T17:43:18Z

    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 <> '')
    );
    
  2. Re: The example for creating a check constraint is missing a comma

    Tom Lane <tgl@sss.pgh.pa.us> — 2018-02-15T18:47:39Z

    =?utf-8?q?PG_Doc_comments_form?= <noreply@postgresql.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
    
    
    
  3. Re: The example for creating a check constraint is missing a comma

    Neil Anderson <neil@postgrescompare.com> — 2018-02-15T18:55:08Z

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