plpgsql variable assignment with union is broken - Mailing list pgsql-hackers

From easteregg@verfriemelt.org
Subject plpgsql variable assignment with union is broken
Date
Msg-id 20210105201257.f0d76aff@mail.verfriemelt.org
Whole thread Raw
Responses Re: plpgsql variable assignment with union is broken  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
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 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 $$;

before it worked with pg13 and 14-devel with this build:

PostgreSQL 14devel (Debian 14~~devel~20201126.0540-1~210.gitf3a8f73.pgdg110+1) on x86_64-pc-linux-gnu, compiled by gcc (Debian 10.2.0-16) 10.2.0, 64-bit

is this an intended change or is it a bug?

with kind regards,
richard

pgsql-hackers by date:

Previous
From: Dmitry Dolgov
Date:
Subject: Re: [HACKERS] [PATCH] Generic type subscripting
Next
From: Pavel Stehule
Date:
Subject: Re: set_config() documentation clarification