pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
pgsql: Add temporal FOREIGN KEY contraints
2+ messages / 1 participants
[nested] [flat]

* pgsql: Add temporal FOREIGN KEY contraints
@ 2024-03-24 06:42 Peter Eisentraut <peter@eisentraut.org>
  0 siblings, 0 replies; 2+ messages in thread

From: Peter Eisentraut @ 2024-03-24 06:42 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Add temporal FOREIGN KEY contraints

Add PERIOD clause to foreign key constraint definitions.  This is
supported for range and multirange types.  Temporal foreign keys check
for range containment instead of equality.

This feature matches the behavior of the SQL standard temporal foreign
keys, but it works on PostgreSQL's native ranges instead of SQL's
"periods", which don't exist in PostgreSQL (yet).

Reference actions ON {UPDATE,DELETE} {CASCADE,SET NULL,SET DEFAULT}
are not supported yet.

Author: Paul A. Jungwirth <pj@illuminatedcomputing.com>
Reviewed-by: Peter Eisentraut <peter@eisentraut.org>
Reviewed-by: jian he <jian.universality@gmail.com>
Discussion: https://www.postgresql.org/message-id/flat/CA+renyUApHgSZF9-nd-a0+OPGharLQLO=mDHcY4_qQ0+noCUVg@mail....

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/34768ee361656841a122f1c8d52a2ad753612feb

Modified Files
--------------
contrib/btree_gist/expected/without_overlaps.out |   48 +
contrib/btree_gist/sql/without_overlaps.sql      |   28 +
doc/src/sgml/catalogs.sgml                       |    3 +-
doc/src/sgml/ref/create_table.sgml               |   43 +-
src/backend/catalog/pg_constraint.c              |   58 ++
src/backend/commands/indexcmds.c                 |   31 +-
src/backend/commands/tablecmds.c                 |  226 ++++-
src/backend/parser/gram.y                        |   45 +-
src/backend/utils/adt/ri_triggers.c              |  168 +++-
src/backend/utils/adt/ruleutils.c                |   17 +-
src/include/catalog/pg_constraint.h              |   21 +-
src/include/commands/defrem.h                    |    2 +-
src/include/nodes/parsenodes.h                   |    2 +
src/include/parser/kwlist.h                      |    1 +
src/test/regress/expected/without_overlaps.out   | 1159 +++++++++++++++++++++-
src/test/regress/sql/without_overlaps.sql        | 1056 +++++++++++++++++++-
16 files changed, 2790 insertions(+), 118 deletions(-)



^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* pgsql: Add temporal FOREIGN KEY contraints
@ 2024-09-17 09:37 Peter Eisentraut <peter@eisentraut.org>
  0 siblings, 0 replies; 2+ messages in thread

From: Peter Eisentraut @ 2024-09-17 09:37 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Add temporal FOREIGN KEY contraints

Add PERIOD clause to foreign key constraint definitions.  This is
supported for range and multirange types.  Temporal foreign keys check
for range containment instead of equality.

This feature matches the behavior of the SQL standard temporal foreign
keys, but it works on PostgreSQL's native ranges instead of SQL's
"periods", which don't exist in PostgreSQL (yet).

Reference actions ON {UPDATE,DELETE} {CASCADE,SET NULL,SET DEFAULT}
are not supported yet.

(previously committed as 34768ee3616, reverted by 8aee330af55; this is
essentially unchanged from those)

Author: Paul A. Jungwirth <pj@illuminatedcomputing.com>
Reviewed-by: Peter Eisentraut <peter@eisentraut.org>
Reviewed-by: jian he <jian.universality@gmail.com>
Discussion: https://www.postgresql.org/message-id/flat/CA+renyUApHgSZF9-nd-a0+OPGharLQLO=mDHcY4_qQ0+noCUVg@mail....

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/89f908a6d0ac1337c868625008c9598487d184e7

Modified Files
--------------
contrib/btree_gist/expected/without_overlaps.out |   48 +
contrib/btree_gist/sql/without_overlaps.sql      |   28 +
doc/src/sgml/catalogs.sgml                       |    3 +-
doc/src/sgml/ref/create_table.sgml               |   45 +-
src/backend/catalog/pg_constraint.c              |   58 +
src/backend/commands/indexcmds.c                 |   31 +-
src/backend/commands/tablecmds.c                 |  226 +++-
src/backend/parser/gram.y                        |   45 +-
src/backend/utils/adt/ri_triggers.c              |  169 ++-
src/backend/utils/adt/ruleutils.c                |   17 +-
src/include/catalog/pg_constraint.h              |   21 +-
src/include/commands/defrem.h                    |    2 +-
src/include/nodes/parsenodes.h                   |    2 +
src/include/parser/kwlist.h                      |    1 +
src/test/regress/expected/without_overlaps.out   | 1283 ++++++++++++++++++++++
src/test/regress/sql/without_overlaps.sql        | 1234 +++++++++++++++++++++
16 files changed, 3105 insertions(+), 108 deletions(-)



^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2024-09-17 09:37 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2024-03-24 06:42 pgsql: Add temporal FOREIGN KEY contraints Peter Eisentraut <peter@eisentraut.org>
2024-09-17 09:37 pgsql: Add temporal FOREIGN KEY contraints Peter Eisentraut <peter@eisentraut.org>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox