Re: plpgsql variable assignment with union is broken

2021-01-08 Thread Merlin Moncure
On Thu, Jan 7, 2021 at 10:55 AM Pavel Stehule wrote: >> Again, if this is narrowly confined to assignment into set query >> operations, maybe this is not so bad. But is it? > > PLpgSQL_Expr: opt_target_list > <--><--><-->from_clause where_clause > <--><--><-->group_clause having_clause window_cla

Re: plpgsql variable assignment with union is broken

2021-01-07 Thread Pavel Stehule
čt 7. 1. 2021 v 17:29 odesílatel Merlin Moncure napsal: > On Wed, Jan 6, 2021 at 11:07 PM Pavel Stehule > wrote: > > > čt 7. 1. 2021 v 4:20 odesílatel Merlin Moncure > napsal: > >> > >> On Tue, Jan 5, 2021 at 3:40 PM Tom Lane wrote: > >> > > >> > easter...@verfriemelt.org writes: > >> > > i fo

Re: plpgsql variable assignment with union is broken

2021-01-07 Thread Merlin Moncure
On Wed, Jan 6, 2021 at 11:07 PM Pavel Stehule wrote: > čt 7. 1. 2021 v 4:20 odesílatel Merlin Moncure napsal: >> >> On Tue, Jan 5, 2021 at 3:40 PM Tom Lane wrote: >> > >> > easter...@verfriemelt.org writes: >> > > i found, that the behaviour of variable assignment in combination with >> > > un

Re: plpgsql variable assignment with union is broken

2021-01-07 Thread easteregg
to be clear, that was existing code within our codebase, it was used as a very bad alternative to an if/else clause. think of it as an tenery operator. thats just straight up bad code as tom said. but even if it is, its a change and i wanted to check, if its intended. so thank you for you time a

Re: plpgsql variable assignment with union is broken

2021-01-06 Thread Pavel Stehule
čt 7. 1. 2021 v 4:20 odesílatel Merlin Moncure napsal: > On Tue, Jan 5, 2021 at 3:40 PM Tom Lane wrote: > > > > easter...@verfriemelt.org writes: > > > i found, that the behaviour of variable assignment in combination with > union is not working anymore: > > > DO $$ > > > DECLARE t bool; > >

Re: plpgsql variable assignment with union is broken

2021-01-06 Thread Merlin Moncure
On Wed, Jan 6, 2021 at 9:39 PM Tom Lane wrote: > > Merlin Moncure writes: > > On Tue, Jan 5, 2021 at 3:40 PM Tom Lane wrote: > >> easter...@verfriemelt.org writes: > >>> i found, that the behaviour of variable assignment in combination with > >>> union is not working anymore: > >>> DO $$ > >>>

Re: plpgsql variable assignment with union is broken

2021-01-06 Thread Tom Lane
Merlin Moncure writes: > On Tue, Jan 5, 2021 at 3:40 PM Tom Lane wrote: >> easter...@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 fa

Re: plpgsql variable assignment with union is broken

2021-01-06 Thread Merlin Moncure
On Tue, Jan 5, 2021 at 3:40 PM Tom Lane wrote: > > easter...@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) UN

Re: plpgsql variable assignment with union is broken

2021-01-05 Thread Tom Lane
easter...@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 cha

plpgsql variable assignment with union is broken

2021-01-05 Thread easteregg
hi, i updated our ci pipeline to the latest 14-devel build from the postgresql apt repository: PostgreSQL 14devel (Debian 14~~devel~20210105.1140-1~285.gitbc43b7c.pgdg110+1) on x86_64-pc-linux-gnu, compiled by gcc (Debian 10.2.1-3) 10.2.1 20201224, 64-bit i found, that the behaviour of var