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: Wed, 10 Apr 2024 10:16:41 -0400
Message-ID: <4019337.1712758601@sss.pgh.pa.us> (raw)
In-Reply-To: <CAMbWs4_j1wq+nUK4t1oROOj2Qgvds=3G4RWA3NBNygf1wkha0A@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>
Richard Guo <guofenglinux@gmail.com> writes:
> On Wed, Apr 10, 2024 at 11:32 AM Tom Lane <tgl@sss.pgh.pa.us> wrote:
>> I guess we could. It won't matter because the following code will
>> reject RECORD in any case; but we could save a few cycles by not
>> calling get_expr_result_tupdesc there.
> Indeed. I think it would be better to add this same rule to
> process_function_rte_ref(), or at least write some comments there to
> explain why it is not necessary to check rtfunc->funccolnames while
> other places do.
Wilco. Another thing I was considering, but didn't pull the trigger
on in the draft patch, was to introduce a funcapi.c function on the
order of
get_expr_result_rtfunc(RangeTblFunction *rtfunc, ...)
which would encapsulate applying either BuildDescFromLists or
get_expr_result_type. I didn't do it because I found that the
only places that would want to use it are the two that are correct
already; the places we still need to fix have short-cuts they can
take rather than building an intermediate tupdesc. (The present
bug could be summarized as "the short-cuts still need to pay
attention to the coldeflist".) But the advantage of doing this
anyway is that its header comment would be a natural place to
document this issue and policy. Thoughts?
regards, tom lane
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: <4019337.1712758601@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