Re: pg18 bug? SELECT query doesn't work
| От | David G. Johnston |
|---|---|
| Тема | Re: pg18 bug? SELECT query doesn't work |
| Дата | |
| Msg-id | CAKFQuwbQj6kLxiz=Ft=ykM2s+H0ytCL7C+Cg1G=7W8ifhFi0Ow@mail.gmail.com обсуждение исходный текст |
| Ответ на | pg18 bug? SELECT query doesn't work (Eric Ridge <eebbrr@gmail.com>) |
| Ответы |
Re: pg18 bug? SELECT query doesn't work
|
| Список | pgsql-general |
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.
David J.
В списке pgsql-general по дате отправления: