On Tue, Jan 6, 2026 at 8:22 AM Eric Ridge <eebbrr@gmail.com> wrote:
drop table if exists wth; create table wth (id serial8, json_data json); insert into wth (json_data) values ('[{"animal": "cats"}, {"animal": "dogs"}]');
-- this ERRORs on pg18 select animal from (select upper(json_array_elements(json_data) ->> 'animal') animal, count(*) from wth group by 1) x where animal ilike 'c%';
On pg18 I'm presented with:
ERROR: set-valued function called in context that cannot accept a set LINE 1: select animal from (select upper(json_array_elements(json_da...
Just thought I'd bring this to y'alls attention.
It was an intentional change. You now should be putting set-producing functions into the FROM clause of a query or subquery. A lateral join is often required.