Re: More speedups for tuple deformation - Mailing list pgsql-hackers

From Junwang Zhao
Subject Re: More speedups for tuple deformation
Date
Msg-id CAEG8a3KNcN38Q016sAGwXWokFjj-Niq4Sy1PuGbeFQVkOP1Y6g@mail.gmail.com
Whole thread Raw
In response to Re: More speedups for tuple deformation  (David Rowley <dgrowleyml@gmail.com>)
Responses Re: More speedups for tuple deformation
List pgsql-hackers
On Wed, Apr 1, 2026 at 11:35 AM David Rowley <dgrowleyml@gmail.com> wrote:
>
> On Wed, 1 Apr 2026 at 15:00, Alexander Lakhin <exclusion@gmail.com> wrote:
> > I've also found an assertion failure:
> > SELECT JSON_ARRAY(VALUES (('', '')));
> >
> > triggers:
> > TRAP: failed Assert("attlen > 0 || attlen == -1"), File: "heaptuple.c", Line: 598, PID: 2582495
> >
> > Could you have a look, please?
>
> Thanks. Looking...

The parser transforms '' (or any cstring) into Const with UNKNOWNOID.
When building the tuple descriptor in ExecTypeFromExprList,
TupleDescInitEntry uses UNKNOWNOID to populate the attribute entry,
thus the failure in nocachegetattr.

Therefore, the assertion should be addressed by removing the pg_assume,
since this case can occur.

Just trying to learn through analysis, might be incorrect. Let's wait for
David's fix.

>
> David
>
>


--
Regards
Junwang Zhao



pgsql-hackers by date:

Previous
From: "Hayato Kuroda (Fujitsu)"
Date:
Subject: RE: [Proposal] Adding Log File Capability to pg_createsubscriber
Next
From: Bryan Green
Date:
Subject: [PATCH] BUG: Stale LC_MESSAGES translations after SET on windows.