Search Postgresql Archives

Re: DEFERRABLE NOT NULL constraint

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Gavan Schneider wrote:
> And this leads to a thought. Why is it that in this chapter the
> documentation gives a synopsis which is not correct for the
> current implementation but relies on a negation much further
> down the page to properly describe the actual behaviour?

The synopsis gives the syntax diagram, that is, what you must
type to avoid a syntax error.

Not every syntactically correct statement is also correct.

Some examples:

test=> CREATE TABLE test (id integer PRIMARY KEY, val text NOT NULL USING DEFERRABLE);
ERROR:  syntax error at or near "USING"
LINE 1: ...E test (id integer PRIMARY KEY, val text NOT NULL USING DEFE...
                                                             ^
A syntax error.

test=> CREATE TABLE test (id integer PRIMARY KEY, val text NOT NULL DEFERRABLE);
ERROR:  misplaced DEFERRABLE clause
LINE 1: ...E test (id integer PRIMARY KEY, val text NOT NULL DEFERRABLE...
                                                             ^
A syntactically correct statement that is nontheless incorrect.

test=> CREATE TABLE test (id integer PRIMARY KEY, val integer DEFAULT 'y');
ERROR:  invalid input syntax for integer: "y"

The same.

Yours,
Laurenz Albe

-- 
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux