postgresql/src
Peter Eisentraut d6f96ed94e Allow specifying column list for foreign key ON DELETE SET actions
Extend the foreign key ON DELETE actions SET NULL and SET DEFAULT by
allowing the specification of a column list, like

    CREATE TABLE posts (
        ...
        FOREIGN KEY (tenant_id, author_id) REFERENCES users ON DELETE SET NULL (author_id)
    );

If a column list is specified, only those columns are set to
null/default, instead of all the columns in the foreign-key
constraint.

This is useful for multitenant or sharded schemas, where the tenant or
shard ID is included in the primary key of all tables but shouldn't be
set to null.

Author: Paul Martinez <paulmtz@google.com>
Discussion: https://www.postgresql.org/message-id/flat/CACqFVBZQyMYJV=njbSMxf+rbDHpx=W=B7AEaMKn8dWn9OZJY7w@mail.gmail.com
2021-12-08 11:13:57 +01:00
..
backend Allow specifying column list for foreign key ON DELETE SET actions 2021-12-08 11:13:57 +01:00
bin Account for TOAST data while scheduling parallel dumps. 2021-12-06 13:23:07 -05:00
common Centralize timestamp computation of control file on updates 2021-11-29 13:36:13 +09:00
fe_utils Rethink pg_dump's handling of object ACLs. 2021-12-06 12:39:45 -05:00
include Allow specifying column list for foreign key ON DELETE SET actions 2021-12-08 11:13:57 +01:00
interfaces Improve some comments in scanner files 2021-12-01 16:10:52 +01:00
makefiles Add NO_INSTALL option to pgxs 2021-05-27 13:58:29 +02:00
pl Remove unneeded Python includes 2021-11-25 14:19:22 +01:00
port Fix compatibility thinko for fstat() on standard streams in win32stat.c 2021-11-30 09:55:50 +09:00
template Further tweaking of PG_SYSROOT heuristics for macOS. 2021-01-20 12:07:23 -05:00
test Allow specifying column list for foreign key ON DELETE SET actions 2021-12-08 11:13:57 +01:00
timezone Update time zone data files to tzdata release 2021e. 2021-10-29 11:38:18 -04:00
tools Enable settings used in TAP tests for MSVC builds 2021-12-07 14:53:39 -05:00
tutorial doc: Prefer explicit JOIN syntax over old implicit syntax in tutorial 2021-04-08 10:51:26 +02:00
.gitignore
DEVELOPERS
Makefile Remove the option to build thread_test.c outside configure. 2020-10-21 12:08:48 -04:00
Makefile.global.in Add support for LZ4 compression in pg_receivewal 2021-11-05 11:33:25 +09:00
Makefile.shlib AIX: Fix missing libpq symbols by respecting SHLIB_EXPORTS. 2021-09-06 11:27:59 -07:00
nls-global.mk Add errhint_plural() function and make use of it 2021-03-31 09:16:25 +02:00