pgsql: Fix assignment to array of domain over composite, redux.

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Fix assignment to array of domain over composite, redux.
Date: 2023-04-15 16:01:50
Message-ID: E1pniLV-003DSN-2j@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

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

Branch
------
REL_13_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/7428aecddf18edc25237eb41257ef023032ce4ad

Modified Files
--------------
src/backend/executor/execExpr.c | 10 ++++++++--
src/test/regress/expected/domain.out | 9 +++++++++
src/test/regress/sql/domain.sql | 4 ++++
3 files changed, 21 insertions(+), 2 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Peter Eisentraut 2023-04-15 18:47:07 Re: pgsql: Add grantable MAINTAIN privilege and pg_maintain role.
Previous Message Tom Lane 2023-04-15 15:20:55 pgsql: Remove some non-ASCII symbols from a comment.