mirror of
https://github.com/postgres/postgres.git
synced 2025-09-02 04:21:28 +03:00
Fix assignment to array of domain over composite, redux.
Commit3e310d837
taught isAssignmentIndirectionExpr() to look through CoerceToDomain nodes. That's not sufficient, because since commit04fe805a1
it's been possible for the planner to simplify CoerceToDomain to RelabelType when the domain has no constraints to enforce. So we need to look through RelabelType too. Per bug #17897 from Alexander Lakhin. Although3e310d837
was back-patched to v11, it seems sufficient to apply this change to v12 and later, since04fe805a1
came in in v12. Dmitry Dolgov Discussion: https://postgr.es/m/17897-4216c546c3874044@postgresql.org
This commit is contained in:
@@ -556,6 +556,15 @@ table dcomptable;
|
||||
{"(1,5)"}
|
||||
(1 row)
|
||||
|
||||
-- if there's no constraints, a different code path is taken:
|
||||
alter domain dcomptype drop constraint dcomptype_check;
|
||||
update dcomptable set f1[1].cf1 = -1; -- now ok
|
||||
table dcomptable;
|
||||
f1
|
||||
------------
|
||||
{"(-1,5)"}
|
||||
(1 row)
|
||||
|
||||
drop table dcomptable;
|
||||
drop type comptype cascade;
|
||||
NOTICE: drop cascades to type dcomptype
|
||||
|
@@ -288,6 +288,10 @@ table dcomptable;
|
||||
update dcomptable set f1[1].cf1 = -1; -- fail
|
||||
update dcomptable set f1[1].cf1 = 1;
|
||||
table dcomptable;
|
||||
-- if there's no constraints, a different code path is taken:
|
||||
alter domain dcomptype drop constraint dcomptype_check;
|
||||
update dcomptable set f1[1].cf1 = -1; -- now ok
|
||||
table dcomptable;
|
||||
|
||||
drop table dcomptable;
|
||||
drop type comptype cascade;
|
||||
|
Reference in New Issue
Block a user