Re: [DEPARSE] Operators on ROW() constructors read back as row comparisons

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: assam258(at)gmail(dot)com
Cc: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [DEPARSE] Operators on ROW() constructors read back as row comparisons
Date: 2026-10-21 18:28:03
Message-ID: 2222105.1792607283@sss.pgh.pa.us
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Henson Choi <assam258(at)gmail(dot)com> writes:
>> Indeed. I think this is a parser bug and you're trying to band-aid
>> around it in the wrong place. get_rule_expr() would already do the
>> right thing if the RowExpr had row_format == COERCE_EXPLICIT_CAST,
>> but it does not, which seems like it could fool more things than
>> only deparsing.

> Recording the cast in the parser fixes the case you describe, and
> v2-0002 does that. It cannot fix trees that are already stored, though.

I'm not too concerned about that, given that the sum total of field
complaints about this is zero. I doubt very many people are writing
explicit casts to record, rather than explicit casts to some named
composite type, and probably even fewer are doing it in this context
for this purpose.

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Manu 2026-10-21 18:30:24 Re: [PG19] Promotion hangs behind a backend blocked on a stuck client
Previous Message Masahiko Sawada 2026-10-21 18:18:50 Re: Reject COPY TO of unlogged relations during recovery