Re: BUG #19454: PL/pgSQL mishandling jsonb attribute reference - Mailing list pgsql-bugs

From David G. Johnston
Subject Re: BUG #19454: PL/pgSQL mishandling jsonb attribute reference
Date
Msg-id CAKFQuwak==1Pt12Bo571YCgKJ5wyV6RakSQeYdazLo4q+JDMkA@mail.gmail.com
Whole thread
In response to BUG #19454: PL/pgSQL mishandling jsonb attribute reference  (PG Bug reporting form <noreply@postgresql.org>)
List pgsql-bugs
On Sunday, April 12, 2026, PG Bug reporting form <noreply@postgresql.org> wrote:
The following bug has been logged on the website:

Bug reference:      19454
Logged by:          CN Liou
Email address:      ma.sao@msa.hinet.net
PostgreSQL version: 18.3
Operating system:   Linux Debian Bookworm
Description:       

        v_payload := v_payload || tj->'delta'; -- The problematic line
        --v_payload := (SELECT v_payload || (tj->'delta')); --This avoids
the issue.

I’m not following.  The problematic line above is indeed annoying but it’s not a bug.  Operator precedence is behaving as documented.  The second line (wrapping tj->’delta’ with parentheses) is simply the necessary way to write many expressions involving the “->”-like json[b] operators.

David J.

pgsql-bugs by date:

Previous
From: PG Bug reporting form
Date:
Subject: BUG #19455: ALTER TABLE RENAME will rename a sequence
Next
From: Tom Lane
Date:
Subject: Re: BUG #19454: PL/pgSQL mishandling jsonb attribute reference