pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Fujii Masao <fujii@postgresql.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Support multi-line headers in COPY FROM command.
Date: Thu, 03 Jul 2025 06:30:01 +0000
Message-ID: <E1uXDSK-004TEp-3A@gemulon.postgresql.org> (raw)

Support multi-line headers in COPY FROM command.

The COPY FROM command now accepts a non-negative integer for the HEADER option,
allowing multiple header lines to be skipped. This is useful when the input
contains multi-line headers that should be ignored during data import.

Author: Shinya Kato <shinya11.kato@gmail.com>
Co-authored-by: Fujii Masao <masao.fujii@gmail.com>
Reviewed-by: Yugo Nagata <nagata@sraoss.co.jp>
Discussion: https://postgr.es/m/CAOzEurRPxfzbxqeOPF_AGnAUOYf=Wk0we+1LQomPNUNtyZGBZw@mail.gmail.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/bc2f348e87c02de63647dbe290d64ff088880dbe

Modified Files
--------------
doc/src/sgml/ref/copy.sgml           | 38 +++++++++++++++++++++++---------
src/backend/commands/copy.c          | 42 ++++++++++++++++++++++--------------
src/backend/commands/copyfromparse.c | 17 +++++++++++----
src/backend/commands/copyto.c        |  2 +-
src/include/commands/copy.h          | 16 ++++++--------
src/test/regress/expected/copy.out   | 25 ++++++++++++++++++++-
src/test/regress/expected/copy2.out  |  6 ++++++
src/test/regress/sql/copy.sql        | 30 ++++++++++++++++++++++++++
src/test/regress/sql/copy2.sql       |  3 +++
src/tools/pgindent/typedefs.list     |  1 -
10 files changed, 138 insertions(+), 42 deletions(-)



Message-ID: <E1uXDSK-004TEp-3A@gemulon.postgresql.org>
Permalink:  ../E1uXDSK-004TEp-3A@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1uXDSK-004TEp-3A@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: fujii@postgresql.org, pgsql-committers@lists.postgresql.org
  Subject: Re: pgsql: Support multi-line headers in COPY FROM command.
  In-Reply-To: <E1uXDSK-004TEp-3A@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