pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Michael Paquier <michael@paquier.xyz>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Refactor CopyReadAttributes{CSV,Text}() to use a callback in COP
Date: Mon, 05 Feb 2024 00:47:38 +0000
Message-ID: <E1rWn98-004hXh-PB@gemulon.postgresql.org> (raw)

Refactor CopyReadAttributes{CSV,Text}() to use a callback in COPY FROM

CopyReadAttributes{CSV,Text}() are used to parse lines for text and CSV
format.  This reduces the number of "if" branches that need to be
checked when parsing fields in CSV and text mode when dealing with a
COPY FROM, something that can become more noticeable with more
attributes and more lines to process.

Extracted from a larger patch by the same author.

Author: Sutou Kouhei
Discussion: https://postgr.es/m/20231204.153548.2126325458835528809.kou@clear-code.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/95fb5b49024aa51310f91aba669aaf0bb3227932

Modified Files
--------------
src/backend/commands/copyfrom.c          |  5 +++++
src/backend/commands/copyfromparse.c     | 24 ++++++++----------------
src/include/commands/copyfrom_internal.h | 17 +++++++++++++++++
3 files changed, 30 insertions(+), 16 deletions(-)



Message-ID: <E1rWn98-004hXh-PB@gemulon.postgresql.org>
Permalink:  ../E1rWn98-004hXh-PB@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1rWn98-004hXh-PB@gemulon.postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-committers@postgresql.org
  Cc: michael@paquier.xyz, pgsql-committers@lists.postgresql.org
  Subject: Re: pgsql: Refactor CopyReadAttributes{CSV,Text}() to use a callback in COP
  In-Reply-To: <E1rWn98-004hXh-PB@gemulon.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox