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