pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Ц <pfunk@mail.ru>
To: David G. Johnston <david.g.johnston@gmail.com>
Cc: pgsql-bugs@lists.postgresql.org
Subject: Re: BUG #18443: jsonb_agg issue. Again.
Date: Fri, 19 Apr 2024 20:21:14 +0300
Message-ID: <1713547274.939623732@f335.i.mail.ru> (raw)
In-Reply-To: <CAKFQuwY4SWR6WqUp5DwauLMumJhr71+FFcY-qMFLFMqfq+fCzg@mail.gmail.com>
References: <18443-bd015c763e3196ca@postgresql.org>
	<CAKFQuwY4SWR6WqUp5DwauLMumJhr71+FFcY-qMFLFMqfq+fCzg@mail.gmail.com>


>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!
 
 

view thread (5+ messages)  latest in thread

Message-ID: <1713547274.939623732@f335.i.mail.ru>
Permalink:  ../1713547274.939623732@f335.i.mail.ru/
Also on:    postgresql.org/message-id/1713547274.939623732@f335.i.mail.ru

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-bugs@postgresql.org
  Cc: pfunk@mail.ru, david.g.johnston@gmail.com, pgsql-bugs@lists.postgresql.org
  Subject: Re: BUG #18443: jsonb_agg issue. Again.
  In-Reply-To: <1713547274.939623732@f335.i.mail.ru>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox