Re: BUG #15552: Unexpected error in COPY to a foreign table in atransaction - Mailing list pgsql-bugs

From Luis Carril
Subject Re: BUG #15552: Unexpected error in COPY to a foreign table in atransaction
Date
Msg-id LEJPR01MB0010045B9CE96FB2A142E529E7BE0@LEJPR01MB0010.DEUPRD01.PROD.OUTLOOK.DE
Whole thread Raw
In response to Re: BUG #15552: Unexpected error in COPY to a foreign table in atransaction  (Michael Paquier <michael@paquier.xyz>)
Responses Re: BUG #15552: Unexpected error in COPY to a foreign table in a transaction
List pgsql-bugs

Hi,

   I was not able to reproduce the error reported by Etsuro, for me on HEAD:

psql (12devel)
Type "help" for help.

postgres=# create table instead_of_insert_tbl(id serial, name text);
ERROR:  relation "instead_of_insert_tbl" already exists
postgres=#
postgres=# begin;
BEGIN
postgres=#
postgres=# create view instead_of_insert_tbl_view as select ''::text as str;
CREATE VIEW
postgres=#
postgres=# create function fun_instead_of_insert_tbl() returns trigger
postgres-# as $$ begin insert into instead_of_insert_tbl (name) values (new.str); return
postgres$# null; end;
postgres$# $$ language plpgsql;
CREATE FUNCTION
postgres=#
postgres=# create trigger trig_instead_of_insert_tbl_view instead of
postgres-# insert on instead_of_insert_tbl_view for each row execute procedure
postgres-# fun_instead_of_insert_tbl();
CREATE TRIGGER
postgres=#
postgres=# copy instead_of_insert_tbl_view from stdin;
Enter data to be copied followed by a newline.
End with a backslash and a period on a line by itself, or an EOF signal.
>> test1
>> \.
COPY 1

   

   Also, I created the CF entry with Michael's patch, following Amit's indications.


Cheers
Luis M Carril

pgsql-bugs by date:

Previous
From: Michael Paquier
Date:
Subject: Re: BUG #15552: Unexpected error in COPY to a foreign table in atransaction
Next
From: Pavel Stehule
Date:
Subject: Re: Undefined symbol error - psql CLI client