Fix WITHOUT OVERLAPS' interaction with domains.
Tom Lane <tgl@sss.pgh.pa.us>
Fix WITHOUT OVERLAPS' interaction with domains. UNIQUE/PRIMARY KEY ... WITHOUT OVERLAPS requires the no-overlap column to be a range or multirange, but it should allow a domain over such a type too. This requires minor adjustments in both the parser and executor. In passing, fix a nearby break-instead-of-continue thinko in transformIndexConstraint. This had the effect of disabling parse-time validation of the no-overlap column's type in the context of ALTER TABLE ADD CONSTRAINT, if it follows a dropped column. We'd still complain appropriately at runtime though. Author: Jian He <jian.universality@gmail.com> Reviewed-by: Paul A Jungwirth <pj@illuminatedcomputing.com> Reviewed-by: Tom Lane <tgl@sss.pgh.pa.us> Discussion: https://postgr.es/m/CACJufxGoAmN_0iJ=hjTG0vGpOSOyy-vYyfE+-q0AWxrq2_p5XQ@mail.gmail.com Backpatch-through: 18
Files
| Path | Change | +/− |
|---|---|---|
| src/backend/executor/execIndexing.c | modified | +10 −2 |
| src/backend/parser/parse_utilcmd.c | modified | +11 −6 |
| src/test/regress/expected/without_overlaps.out | modified | +39 −0 |
| src/test/regress/sql/without_overlaps.sql | modified | +31 −0 |
Discussion
- domain for WITHOUT OVERLAPS 12 messages · 2025-12-03 → 2026-04-07