Re: plpgsql variable assignment with union is broken

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: plpgsql variable assignment with union is broken
Дата
Msg-id 3425546.1609882846@sss.pgh.pa.us
обсуждение исходный текст
Ответ на plpgsql variable assignment with union is broken  (easteregg@verfriemelt.org)
Ответы Re: plpgsql variable assignment with union is broken  (Merlin Moncure <mmoncure@gmail.com>)
Список pgsql-hackers
easteregg@verfriemelt.org writes:
> i found, that the behaviour of variable assignment in combination with union is not working anymore:
>   DO $$
>   DECLARE t bool;
>   begin
>       t := a FROM ( SELECT true WHERE false ) t(a) UNION SELECT true AS a;
>   END $$;

> is this an intended change or is it a bug?

It's an intended change, or at least I considered the case and thought
that it was useless because assignment will reject any result with more
than one row.  Do you have any non-toy example that wouldn't be as
clear or clearer without using UNION?  The above sure seems like an
example of awful SQL code.

            regards, tom lane



В списке pgsql-hackers по дате отправления:

Предыдущее
От: Paul Martinez
Дата:
Сообщение: [PATCH] Partial foreign key updates in referential integrity triggers
Следующее
От: Tom Lane
Дата:
Сообщение: Re: set_config() documentation clarification