Re: BUG #15552: Unexpected error in COPY to a foreign table in a transaction

From: Luis Carril <luis(dot)carril(at)swarm64(dot)com>
To: Michael Paquier <michael(at)paquier(dot)xyz>, Etsuro Fujita <fujita(dot)etsuro(at)lab(dot)ntt(dot)co(dot)jp>
Cc: Amit Langote <Langote_Amit_f8(at)lab(dot)ntt(dot)co(dot)jp>, "pgsql-bugs(at)lists(dot)postgresql(dot)org" <pgsql-bugs(at)lists(dot)postgresql(dot)org>, PG Bug reporting form <noreply(at)postgresql(dot)org>, Michael Paquier <michael(dot)paquier(at)gmail(dot)com>
Subject: Re: BUG #15552: Unexpected error in COPY to a foreign table in a transaction
Date: 2018-12-19 10:15:56
Message-ID: LEJPR01MB0010045B9CE96FB2A142E529E7BE0@LEJPR01MB0010.DEUPRD01.PROD.OUTLOOK.DE
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Pavel Stehule 2018-12-19 10:49:12 Re: Undefined symbol error - psql CLI client
Previous Message Michael Paquier 2018-12-19 09:13:25 Re: BUG #15552: Unexpected error in COPY to a foreign table in a transaction