pgsql: Change ON UPDATE SET NULL/SET DEFAULT referential actions to mee

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Change ON UPDATE SET NULL/SET DEFAULT referential actions to mee
Date: 2012-06-18 16:13:12
Message-ID: E1SgeZk-0008IR-Jh@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Tom Lane 2012-06-18 16:19:48 pgsql: Update SQL spec references in ri_triggers code to match SQL:2008
Previous Message Albe Laurenz 2012-06-18 07:22:32 Re: [COMMITTERS] pgsql: New SQL functons pg_backup_in_progress() and pg_backup_start_tim