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 <[email protected]>
Reviewed-by: Paul A Jungwirth <[email protected]>
Reviewed-by: Tom Lane <[email protected]>
Discussion: 
https://postgr.es/m/CACJufxGoAmN_0iJ=hjtg0vgposoyy-vyyfe+-q0awxrq2_p...@mail.gmail.com
Backpatch-through: 18

Branch
------
REL_18_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/49f3cb453b9b86b771b0a15393893fb317e35572

Modified Files
--------------
src/backend/executor/execIndexing.c            | 12 ++++++--
src/backend/parser/parse_utilcmd.c             | 17 +++++++----
src/test/regress/expected/without_overlaps.out | 39 ++++++++++++++++++++++++++
src/test/regress/sql/without_overlaps.sql      | 31 ++++++++++++++++++++
4 files changed, 91 insertions(+), 8 deletions(-)

Reply via email to