Re: BUG #19871: JSON_TABLE evaluates each PASSING argument once per column - a named variable $v gets different valu

From: Laurenz Albe <laurenz(dot)albe(at)cybertec(dot)at>
To: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>, shihao zhong <zhong950419(at)gmail(dot)com>
Cc: "303677365(at)qq(dot)com" <303677365(at)qq(dot)com>, "pgsql-bugs(at)lists(dot)postgresql(dot)org" <pgsql-bugs(at)lists(dot)postgresql(dot)org>
Subject: Re: BUG #19871: JSON_TABLE evaluates each PASSING argument once per column - a named variable $v gets different valu
Date: 2026-11-30 10:06:32
Message-ID: 63e9b17b9a73403339c51a8a6e014d65aeb76b1b.camel@cybertec.at
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On Sun, 2026-11-29 at 23:10 -0700, David G. Johnston wrote:
> Be nice to know whether the standard we are trying to conform to has a say on the matter.

I don't have access to a sufficiently recent version.

> If we are keeping this we at least need to try and document it like we document how a
> composite typed function output can lead to multiple execution:
>
> SELECT (myfunc(x)).* FROM some_table;
>
> SELECT (myfunc(x)).a,
>        (myfunc(x)).b,
>        (myfunc(x)).c FROM some_table;

That is documented in https://www.postgresql.org/docs/current/rowtypes.html#ROWTYPES-USAGE
See the "Tip".

Yours,
Laurenz Albe

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Andrey Rachitskiy 2026-11-30 10:21:42 Re: BUG #19956: json #>, #>> and json_extract_path resolve a negative array index against an earlier sibling array
Previous Message Michael Paquier 2026-11-30 08:21:24 Re: BUG #19941: Acknowledged INSERT lost after a simple Query inside an extended-protocol batch (XX000)