Re: BUG #18443: jsonb_agg issue. Again. - Mailing list pgsql-bugs

From Ц
Subject Re: BUG #18443: jsonb_agg issue. Again.
Date
Msg-id 1713547274.939623732@f335.i.mail.ru
Whole thread Raw
In response to Re: BUG #18443: jsonb_agg issue. Again.  ("David G. Johnston" <david.g.johnston@gmail.com>)
Responses Re: BUG #18443: jsonb_agg issue. Again.
Re: BUG #18443: jsonb_agg issue. Again.
List pgsql-bugs
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.
 
David J.
 
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.
And yeah, after hours of confusion rewrote it to:
 
select o.*
from 
  (select jsonb_agg(t) as jsonbagg from tmp_view t) j
  , lateral public.out3(j.jsonbagg) o;
 
And it works just fine!
 
 

pgsql-bugs by date:

Previous
From: "David G. Johnston"
Date:
Subject: Re: BUG #18443: jsonb_agg issue. Again.
Next
From: Ц
Date:
Subject: Re: BUG #18443: jsonb_agg issue. Again.