postgresql/src/backend
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
..
access Fix corruption of toast indexes with REINDEX CONCURRENTLY 2021-12-08 11:01:08 +09:00
bootstrap Fix bogus assertion in BootstrapModeMain(). 2021-08-09 08:28:53 -07:00
catalog Allow specifying column list for foreign key ON DELETE SET actions 2021-12-08 11:13:57 +01:00
commands Allow specifying column list for foreign key ON DELETE SET actions 2021-12-08 11:13:57 +01:00
executor Replace random(), pg_erand48(), etc with a better PRNG API and algorithm. 2021-11-28 21:33:07 -05:00
foreign Improve HINT message that FDW reports when there are no valid options. 2021-10-27 00:46:52 +09:00
jit Avoid some other O(N^2) hazards in list manipulation. 2021-11-01 16:24:39 -04:00
lib Replace random(), pg_erand48(), etc with a better PRNG API and algorithm. 2021-11-28 21:33:07 -05:00
libpq On Windows, also call shutdown() while closing the client socket. 2021-12-07 13:34:06 -05:00
main process startup: Split single user code out of PostgresMain(). 2021-09-17 19:56:47 -07:00
nodes Allow specifying column list for foreign key ON DELETE SET actions 2021-12-08 11:13:57 +01:00
optimizer Some RELKIND macro refactoring 2021-12-03 14:08:19 +01:00
parser Allow specifying column list for foreign key ON DELETE SET actions 2021-12-08 11:13:57 +01:00
partitioning Fix duplicate words in comments 2021-10-04 15:12:57 +02:00
po Translation updates 2021-06-21 12:33:50 +02:00
port windows: Remove use of WIN32_LEAN_AND_MEAN from crashdump.c. 2021-11-06 15:43:22 -07:00
postmaster Remove mention of TimeLineID update from comments 2021-12-01 14:17:24 +01:00
regex Make pg_regexec() robust against out-of-range search_start. 2021-09-11 15:19:31 -04:00
replication Fix origin timestamp during decoding of ROLLBACK PREPARED operation. 2021-12-08 15:18:56 +05:30
rewrite Fix rewriter to set hasModifyingCTE correctly on rewritten queries. 2021-09-08 12:05:47 -04:00
snowball Update snowball 2021-12-07 07:04:05 +01:00
statistics Clean up more code using "(expr) ? true : false" 2021-10-11 09:36:42 +09:00
storage Some RELKIND macro refactoring 2021-12-03 14:08:19 +01:00
tcop Replace random(), pg_erand48(), etc with a better PRNG API and algorithm. 2021-11-28 21:33:07 -05:00
tsearch Clean up more code using "(expr) ? true : false" 2021-10-11 09:36:42 +09:00
utils Allow specifying column list for foreign key ON DELETE SET actions 2021-12-08 11:13:57 +01:00
.gitignore
Makefile Use sort_template.h for qsort_tuple() and qsort_ssup(). 2021-03-03 17:02:32 +13:00
common.mk Remove PARTIAL_LINKING build mode. 2018-03-30 17:33:04 -07:00
nls.mk Report progress of startup operations that take a long time. 2021-10-25 11:51:57 -04:00