Re: BUG #18443: jsonb_agg issue. Again.

From: Ц <pfunk(at)mail(dot)ru>
To: David G(dot) Johnston <david(dot)g(dot)johnston(at)gmail(dot)com>
Cc: pgsql-bugs(at)lists(dot)postgresql(dot)org
Subject: Re: BUG #18443: jsonb_agg issue. Again.
Date: 2024-04-19 17:21:14
Message-ID: 1713547274.939623732@f335.i.mail.ru
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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!
 
 

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Ц 2024-04-19 17:31:14 Re: BUG #18443: jsonb_agg issue. Again.
Previous Message David G. Johnston 2024-04-19 15:34:34 Re: BUG #18443: jsonb_agg issue. Again.