Re: problem with RETURNING and update row movement - Mailing list pgsql-hackers

From Etsuro Fujita
Subject Re: problem with RETURNING and update row movement
Date
Msg-id CAPmGK16fDn_TvX+r+bpazj5S0TpwF_F-A5AF=XAmw12VfFw_mg@mail.gmail.com
Whole thread Raw
In response to problem with RETURNING and update row movement  (Amit Langote <amitlangote09@gmail.com>)
Responses Re: problem with RETURNING and update row movement  (Amit Langote <amitlangote09@gmail.com>)
List pgsql-hackers
Hi Amit-san,

On Thu, Jun 11, 2020 at 6:10 PM Amit Langote <amitlangote09@gmail.com> wrote:
> Reproduction steps:
>
> create table foo (a int, b int) partition by list (a);
> create table foo1 (c int, b int, a int);
> alter table foo1 drop c;
> alter table foo attach partition foo1 for values in (1);
> create table foo2 partition of foo for values in (2);
> create table foo3 partition of foo for values in (3);
> create or replace function trigfunc () returns trigger language
> plpgsql as $$ begin new.b := 2; return new; end; $$;
> create trigger trig before insert on foo2 for each row execute
> function trigfunc();
> insert into foo values (1, 1), (2, 2), (3, 3);
> update foo set a = 2 from (values (1), (2), (3)) s(x) where a = s.x returning *;
> ERROR:  attribute 5 of type record has wrong type
> DETAIL:  Table has type record, but query expects integer.

Reproduced.  Could you add the patch to the next commitfest so that it
doesn't get lost?

Best regards,
Etsuro Fujita



pgsql-hackers by date:

Previous
From: Fabien COELHO
Date:
Subject: Re: Recording test runtimes with the buildfarm
Next
From: Tatsuo Ishii
Date:
Subject: Re: Transactions involving multiple postgres foreign servers, take2