Skip site navigation (1) Skip section navigation (2)

pgsql: Reclassify DEFAULT as a column_constraint item in the CREATETAB

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Reclassify DEFAULT as a column_constraint item in the CREATETAB
Date: 2010-12-29 02:38:39
Message-ID: E1PXlvz-0000Se-Mc@gemulon.postgresql.org (view raw or flat)
Thread:
Lists: pgsql-committers
Reclassify DEFAULT as a column_constraint item in the CREATE TABLE syntax.

This is how it was documented originally, but several years ago somebody
decided that DEFAULT isn't a type of constraint.  Well, the grammar thinks
it is.  The documentation was wrong in two ways: it alleged that DEFAULT
had to appear before any other kind of constraint, and it alleged that you
can't prefix a DEFAULT clause with a "CONSTRAINT name" clause, when in fact
you can.  (The latter behavior probably isn't SQL-standard, but our grammar
has always allowed it.)

This patch responds to Fujii Masao's observation that the ALTER TABLE
documentation mistakenly implied that you couldn't include DEFAULT in
ALTER TABLE ADD COLUMN; though this isn't the way he proposed fixing it.

Branch
------
master

Details
-------
http://git.postgresql.org/gitweb?p=postgresql.git;a=commitdiff;h=31d2efaef507f280f4df895e1730a9ec8c31aa12

Modified Files
--------------
doc/src/sgml/ref/alter_table.sgml  |    2 +-
doc/src/sgml/ref/create_table.sgml |   47 ++++++++++++++++++-----------------
2 files changed, 25 insertions(+), 24 deletions(-)

pgsql-committers by date

Next:From: Tom LaneDate: 2010-12-29 04:02:29
Subject: pgsql: Avoid unexpected conversion overflow in planner for distantdate
Previous:From: Peter EisentrautDate: 2010-12-28 19:19:52
Subject: pgsql: No release notes update, just advance the date

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group