pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Richard Guo <guofenglinux@gmail.com>
Cc: Tender Wang <tndrwang@gmail.com>
Cc: exclusion@gmail.com
Cc: pgsql-bugs@lists.postgresql.org
Subject: Re: BUG #18422: Assert in expandTupleDesc() fails on row mismatch with additional SRF
Date: Thu, 11 Apr 2024 23:46:49 -0400
Message-ID: <330608.1712893609@sss.pgh.pa.us> (raw)
In-Reply-To: <CAMbWs4-xmohkFzVaT8rxEjpkB35JUNxpQtyEaPD+OafFMm5W8g@mail.gmail.com>
References: <18422-89ca86c8eac5246d@postgresql.org>
	<CAHewXNkfDfKw80kgNvtC0ZvNz=hGxXLyEwiGJzhr3r_fFAkVeQ@mail.gmail.com>
	<3861246.1712691263@sss.pgh.pa.us>
	<CAMbWs4-3O34h5_T_OXRsAzGKg+cQEp1w9aq5i=U3EbxQzvo5VA@mail.gmail.com>
	<3917908.1712719937@sss.pgh.pa.us>
	<CAMbWs4_j1wq+nUK4t1oROOj2Qgvds=3G4RWA3NBNygf1wkha0A@mail.gmail.com>
	<4019337.1712758601@sss.pgh.pa.us>
	<CAMbWs4_QgZogwYUgXb=7K_GQ-w2JC3JxONZygkQiXBu11CyXCQ@mail.gmail.com>
	<170712.1712844795@sss.pgh.pa.us>
	<CAMbWs4-xmohkFzVaT8rxEjpkB35JUNxpQtyEaPD+OafFMm5W8g@mail.gmail.com>

Richard Guo <guofenglinux@gmail.com> writes:
> On Thu, Apr 11, 2024 at 10:13 PM Tom Lane <tgl@sss.pgh.pa.us> wrote:
>> I did think about that, but it seems mighty weird.  The semantics of
>> the flag would have to be something like "I want a tupdesc when the
>> result type is COMPOSITE, but not when it's RECORD", which seems
>> rather arbitrary.

> Indeed.

I did actually spend some time today trying to code that up, to see
what it would look like.  The attempt failed though, because there
are existing cases in which get_expr_result_type() returns
TYPEFUNC_RECORD, so we can't use that result code as a positive
indicator that "this RTE has a coldeflist".  In a green field
we could invent another TYPEFUNC_XXX code, but that's not a
back-patchable idea.  So the new function would need some independent
indicator that it saw a coldeflist, and at that point there's
basically nothing we're hiding from the callers.

>> Perhaps it'd be sufficient to add a note to the header comment of
>> get_expr_result_type warning about when not to use it.

> Works for me.

OK, barring other objections I'll push forward on that basis.

			regards, tom lane





view thread (11+ messages)

Message-ID: <330608.1712893609@sss.pgh.pa.us>
Permalink:  ../330608.1712893609@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/330608.1712893609@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-bugs@postgresql.org
  Cc: tgl@sss.pgh.pa.us, guofenglinux@gmail.com, tndrwang@gmail.com, exclusion@gmail.com, pgsql-bugs@lists.postgresql.org
  Subject: Re: BUG #18422: Assert in expandTupleDesc() fails on row mismatch with additional SRF
  In-Reply-To: <330608.1712893609@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox