pgsql: Change ON UPDATE SET NULL/SET DEFAULT referential actions to mee - Mailing list pgsql-committers

From Tom Lane
Subject pgsql: Change ON UPDATE SET NULL/SET DEFAULT referential actions to mee
Date
Msg-id E1SgeZk-0008IR-Jh@gemulon.postgresql.org
Whole thread Raw
List pgsql-committers
Change ON UPDATE SET NULL/SET DEFAULT referential actions to meet SQL spec.

Previously, when executing an ON UPDATE SET NULL or SET DEFAULT action for
a multicolumn MATCH SIMPLE foreign key constraint, we would set only those
referencing columns corresponding to referenced columns that were changed.
This is what the SQL92 standard said to do --- but more recent versions
of the standard say that all referencing columns should be set to null or
their default values, no matter exactly which referenced columns changed.
At least for SET DEFAULT, that is clearly saner behavior.  It's somewhat
debatable whether it's an improvement for SET NULL, but it appears that
other RDBMS systems read the spec this way.  So let's do it like that.

This is a release-notable behavioral change, although considering that
our documentation already implied it was done this way, the lack of
complaints suggests few people use such cases.

Branch
------
master

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

Modified Files
--------------
doc/src/sgml/ddl.sgml                     |   37 ++++--
doc/src/sgml/ref/create_table.sgml        |   28 +++--
src/backend/utils/adt/ri_triggers.c       |  187 ++---------------------------
src/test/regress/expected/foreign_key.out |   32 +++---
src/test/regress/sql/foreign_key.sql      |    6 +-
5 files changed, 72 insertions(+), 218 deletions(-)


pgsql-committers by date:

Previous
From: karl@pgfoundry.org (User Karl)
Date:
Subject: pgtcl - libpgtcl: Reference variable name as a string, not an object,
Next
From: Tom Lane
Date:
Subject: pgsql: Update SQL spec references in ri_triggers code to match SQL:2008