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



Reply via email to