pgsql: Don't allow system columns in CHECK constraints, except tableoid

From: Robert Haas <rhaas(at)postgresql(dot)org>
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Don't allow system columns in CHECK constraints, except tableoid
Date: 2013-09-23 17:38:50
Message-ID: E1VOA5y-0002XI-GW@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Don't allow system columns in CHECK constraints, except tableoid.

Previously, arbitray system columns could be mentioned in table
constraints, but they were not correctly checked at runtime, because
the values weren't actually set correctly in the tuple. Since it
seems easy enough to initialize the table OID properly, do that,
and continue allowing that column, but disallow the rest unless and
until someone figures out a way to make them work properly.

No back-patch, because this doesn't seem important enough to take the
risk of destabilizing the back branches. In fact, this will pose a
dump-and-reload hazard for those upgrading from previous versions:
constraints that were accepted before but were not correctly enforced
will now either be enforced correctly or not accepted at all. Either
could result in restore failures, but in practice I think very few
users will notice the difference, since the use case is pretty
marginal anyway and few users will be relying on features that have
not historically worked.

Amit Kapila, reviewed by Rushabh Lathia, with doc changes by me.

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/ba3d39c96921c96de114f6c22a9572bff24708b5

Modified Files
--------------
doc/src/sgml/ref/create_table.sgml | 3 ++-
src/backend/commands/copy.c | 6 ++++++
src/backend/commands/tablecmds.c | 6 ++++++
src/backend/executor/nodeModifyTable.c | 12 ++++++++++++
src/backend/parser/parse_relation.c | 10 ++++++++++
src/test/regress/input/constraints.source | 22 ++++++++++++++++++++++
src/test/regress/output/constraints.source | 24 ++++++++++++++++++++++++
7 files changed, 82 insertions(+), 1 deletion(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Robert Haas 2013-09-23 19:01:55 pgsql: doc: Clarify that file_fdw options require values.
Previous Message Bruce Momjian 2013-09-23 15:12:16 pgsql: pg_upgrade: more C comment fixes