]> git.ipfire.org Git - thirdparty/postgresql.git/commit
Fix assignment to array of domain over composite, redux.
authorTom Lane <tgl@sss.pgh.pa.us>
Sat, 15 Apr 2023 16:01:39 +0000 (12:01 -0400)
committerTom Lane <tgl@sss.pgh.pa.us>
Sat, 15 Apr 2023 16:01:39 +0000 (12:01 -0400)
commit048caf8d757a94db043ddbc4d0b1131c1544fee1
tree213b8263df11d84a0cfe560adb6caf21edfd0606
parente76fbcf796d6167df83ca7ba13df93fa5f39b380
Fix assignment to array of domain over composite, redux.

Commit 3e310d837 taught isAssignmentIndirectionExpr() to look through
CoerceToDomain nodes.  That's not sufficient, because since commit
04fe805a1 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.  Although 3e310d837 was
back-patched to v11, it seems sufficient to apply this change
to v12 and later, since 04fe805a1 came in in v12.

Dmitry Dolgov

Discussion: https://postgr.es/m/17897-4216c546c3874044@postgresql.org
src/backend/executor/execExpr.c
src/test/regress/expected/domain.out
src/test/regress/sql/domain.sql