On Fri, Feb 28, 2025 at 11:47 AM Andrew Dunstan <[email protected]> wrote:
>
>
> On 2025-02-28 Fr 1:31 PM, Masahiko Sawada wrote:
>
> Refactor COPY FROM to use format callback functions.
>
> This commit introduces a new CopyFromRoutine struct, which is a set of
> callback routines to read tuples in a specific format. It also makes
> COPY FROM with the existing formats (text, CSV, and binary) utilize
> these format callbacks.
>
> This change is a preliminary step towards making the COPY FROM command
> extensible in terms of input formats.
>
> Similar to 2e4127b6d2d, this refactoring contributes to a performance
> improvement by reducing the number of "if" branches that need to be
> checked on a per-row basis when sending field representations in text
> or CSV mode. The performance benchmark results showed ~5% performance
> gain in text or CSV mode.
>
> Author: Sutou Kouhei <[email protected]>
> Reviewed-by: Masahiko Sawada <[email protected]>
> Reviewed-by: Michael Paquier <[email protected]>
> Reviewed-by: Andres Freund <[email protected]>
> Reviewed-by: Tomas Vondra <[email protected]>
> Reviewed-by: Junwang Zhao <[email protected]>
> Discussion: 
> https://postgr.es/m/[email protected]
>
>
>
> This patch has completely broken the file_textarray fdw, which uses 
> NextCopyFromRawFields(). Removing that from API is not a good thing.
>

Thank you for pointing it out.

I've just posted my analysis[1] and am planning to revive that API
(Sutou-san already proposed an idea). Could you please check if the
idea would work for file_text_array_fdw?

Regards,

[1] 
https://www.postgresql.org/message-id/CAD21AoDr13%3Ddx%2Bk8gmQnR5_bY%2BNskyN4mbSWN0KhQncL6xuPMA%40mail.gmail.com


--
Masahiko Sawada
Amazon Web Services: https://aws.amazon.com


Reply via email to