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@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

Reply via email to