From: | Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org> |
---|---|
To: | pgsql-committers(at)lists(dot)postgresql(dot)org |
Subject: | pgsql: Support foreign keys that reference partitioned tables |
Date: | 2019-04-03 17:51:13 |
Message-ID: | E1hBk2b-0002s6-N5@gemulon.postgresql.org |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-committers |
Support foreign keys that reference partitioned tables
Previously, while primary keys could be made on partitioned tables, it
was not possible to define foreign keys that reference those primary
keys. Now it is possible to do that.
Author: Álvaro Herrera
Reviewed-by: Amit Langote, Jesper Pedersen
Discussion: https://postgr.es/m/20181102234158.735b3fevta63msbj@alvherre.pgsql
Branch
------
master
Details
-------
https://git.postgresql.org/pg/commitdiff/f56f8f8da6afd8523b4d5284e02a20ed2b33ef8d
Modified Files
--------------
doc/src/sgml/ref/create_table.sgml | 7 +-
src/backend/commands/tablecmds.c | 1342 ++++++++++++++++------
src/backend/utils/adt/ri_triggers.c | 263 ++++-
src/backend/utils/adt/ruleutils.c | 18 +
src/bin/psql/describe.c | 7 +-
src/include/commands/tablecmds.h | 4 -
src/include/commands/trigger.h | 2 +
src/include/utils/ruleutils.h | 1 +
src/test/isolation/expected/fk-partitioned-1.out | 133 +++
src/test/isolation/expected/fk-partitioned-2.out | 70 ++
src/test/isolation/isolation_schedule | 2 +
src/test/isolation/specs/fk-partitioned-1.spec | 45 +
src/test/isolation/specs/fk-partitioned-2.spec | 29 +
src/test/regress/expected/foreign_key.out | 334 +++++-
src/test/regress/sql/foreign_key.sql | 213 +++-
15 files changed, 2039 insertions(+), 431 deletions(-)
From | Date | Subject | |
---|---|---|---|
Next Message | Alvaro Herrera | 2019-04-03 18:37:07 | pgsql: Copy name when cloning FKs recurses to partitions |
Previous Message | Heikki Linnakangas | 2019-04-03 14:06:49 | pgsql: Generate less WAL during GiST, GIN and SP-GiST index build. |