Re: Adding Support for Copy callback functionality on COPY TO api

From: Michael Paquier <michael(at)paquier(dot)xyz>
To: "Andrey V(dot) Lepikhov" <a(dot)lepikhov(at)postgrespro(dot)ru>
Cc: "Sanaba, Bilva" <bilvas(at)amazon(dot)com>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Adding Support for Copy callback functionality on COPY TO api
Date: 2022-10-11 02:31:01
Message-ID: Y0TVZaoDB3D/jiju@paquier.xyz
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, Sep 30, 2020 at 01:48:12PM +0500, Andrey V. Lepikhov wrote:
> Your code almost exactly the same as proposed in [1] as part of 'Fast COPY
> FROM' command. But it seems there are differences.
>
> [1] https://www.postgresql.org/message-id/flat/3d0909dc-3691-a576-208a-90986e55489f%40postgrespro.ru

I have been looking at what you have here while reviewing the contents
of this thread, and it seems to me that you should basically be able
to achieve the row-level control that your patch is doing with the
callback to do the per-row processing posted here. The main
difference, though, is that you want to have more control at the
beginning and the end of the COPY TO processing which explains the
split of DoCopyTo(). I am a bit surprised to see this much footprint
in the backend code once there are two FDW callbacks to control the
beginning and the end of the COPY TO, to be honest, sacrifying a lot
the existing symmetry between the COPY TO and COPY FROM code paths
where there is currently a strict control on the pre-row and post-row
processing like the per-row memory context.
--
Michael

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Nathan Bossart 2022-10-11 02:50:31 Re: Suppressing useless wakeups in walreceiver
Previous Message Bharath Rupireddy 2022-10-11 01:31:26 Re: Suppressing useless wakeups in walreceiver