Re: Conflict handling for COPY FROM - Mailing list pgsql-hackers

From Alexey Kondratov
Subject Re: Conflict handling for COPY FROM
Date
Msg-id 9ffdd63f-a279-99b6-30be-9defe51ea6a1@postgrespro.ru
Whole thread Raw
In response to Re: Conflict handling for COPY FROM  (Surafel Temesgen <surafel3000@gmail.com>)
List pgsql-hackers
On 09.03.2020 15:34, Surafel Temesgen wrote:
>
> okay attached is a rebased patch with it
>

+    Portal        portal = NULL;
...
+        portal = GetPortalByName("");
+        SetRemoteDestReceiverParams(dest, portal);

I think that you do not need this, since you are using a ready 
DestReceiver. The whole idea of passing DestReceiver down to the 
CopyFrom was to avoid that code. This unnamed portal is created in the 
exec_simple_query [1] and has been already set to the DestReceiver there 
[2].

Maybe I am missing something, but I have just removed this code and 
everything works just fine.

[1] 
https://github.com/postgres/postgres/blob/0a42a2e9/src/backend/tcop/postgres.c#L1178

[2] 
https://github.com/postgres/postgres/blob/0a42a2e9/src/backend/tcop/postgres.c#L1226


Regards

-- 
Alexey Kondratov

Postgres Professional https://www.postgrespro.com
Russian Postgres Company




pgsql-hackers by date:

Previous
From: Kuntal Ghosh
Date:
Subject: Re: backend type in log_line_prefix?
Next
From: Fujii Masao
Date:
Subject: Re: pg_stat_progress_basebackup - progress reporting forpg_basebackup, in the server side