diff options
| author | Tom Lane | 2025-11-17 18:54:52 +0000 |
|---|---|---|
| committer | Tom Lane | 2025-11-17 18:54:52 +0000 |
| commit | ed931377abc0403ce137d9a7f7ded67cb9355c8d (patch) | |
| tree | e7f86c90e3b70a81e1740e4b7e00d49a8c17b4ba /contrib/auth_delay | |
| parent | 6793d6a839c1e4eac495fd0c48b75dc1871425c8 (diff) | |
Remove bogus stripping of RelabelTypes: that can result in building
an output SAOP tree with incorrect exposed exprType for the operands,
which might confuse polymorphic operators. Moreover it demonstrably
prevents folding some OR-trees to SAOPs when the RHS expressions
have different base types that were coerced to the same type by
RelabelTypes.
Reduce prohibition on type_is_rowtype to just disallow type RECORD.
We need that because otherwise we would happily fold multiple RECORD
Consts into a RECORDARRAY Const even if they aren't the same record
type. (We could allow that perhaps, if we checked that they all have
the same typmod, but the case doesn't seem worth that much effort.)
However, there is no reason at all to disallow the transformation
for named composite types, nor domains over them: as long as we can
find a suitable array type we're good.
Remove some assertions that seem rather out of place (it's not
this code's duty to verify that the RestrictInfo structure is
sane). Rewrite some comments.
The issues with RelabelType stripping seem severe enough to
back-patch this into v18 where the code was introduced.
Author: Tender Wang <[email protected]>
Co-authored-by: Tom Lane <[email protected]>
Discussion: https://postgr.es/m/CAHewXN=aH7GQBk4fXU-WaEeVmQWUmBAeNyBfJ3VKzPphyPKUkQ@mail.gmail.com
Backpatch-through: 18
Diffstat (limited to 'contrib/auth_delay')
0 files changed, 0 insertions, 0 deletions
