Re: BUG #18443: jsonb_agg issue. Again.

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Ц <pfunk(at)mail(dot)ru>
Cc: David G(dot) Johnston <david(dot)g(dot)johnston(at)gmail(dot)com>, pgsql-bugs(at)lists(dot)postgresql(dot)org
Subject: Re: BUG #18443: jsonb_agg issue. Again.
Date: 2024-04-19 17:52:23
Message-ID: 2176812.1713549143@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

=?UTF-8?B?0KY=?= <pfunk(at)mail(dot)ru> writes:
>> You wrote a table-producing function (one row but three columns).  Those need [1] to be executed in the FROM clause, via an implicit or explicit LATERAL join if you have data from other relations being fed in as input arguments.
>>
>> 1. well, at least if you don't want to see this kind of artifact where the way to expand .* is to copy the expression preceding it.

> Do you mean select (out3).* .. equal to select (out3).col1, (out3).col3, (out3).col3 … ?
> Didn`t even suppose that..
> Sometimes I've used (row).col or (row).* in select list.
> Would be appreciated if you could provide keywords for googling.

The main documentation about SELECT lists is

https://www.postgresql.org/docs/current/queries-select-lists.html

which points you to

https://www.postgresql.org/docs/current/rowtypes.html#ROWTYPES-USAGE

where there's a Tip explaining exactly this point.

regards, tom lane

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message David Rowley 2024-04-22 01:53:02 Re: BUG #18442: Unnecessary Sort operator in indexScan Plan
Previous Message Ц 2024-04-19 17:31:14 Re: BUG #18443: jsonb_agg issue. Again.