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: Improve the error message in COPY with HEADER option.
Date: Thu, 22 Jan 2026 01:16:41 +0000
Message-ID: <E1vijJR-001tu4-0e@gemulon.postgresql.org> (raw)

Improve the error message in COPY with HEADER option.

The error message reported for invalid values of the HEADER option in COPY
command previously used the term "non-negative integer", which is
discouraged by the Error Message Style Guide because it is ambiguous about
whether zero is allowed.

This commit improves the error message by replacing "non-negative integer"
there with "an integer value greater than or equal to zero" to make
the accepted values explicit.

Author: Shinya Kato <shinya11.kato@gmail.com>
Reviewed-by: Alvaro Herrera <alvherre@kurilemu.de>
Reviewed-by: Steven Niu <niushiji@gmail.com>
Reviewed-by: Fujii Masao <masao.fujii@gmail.com>
Discussion: https://postgr.es/m/CAHGQGwE86PcuPZbP=aurmW7Oo=eycF10gxjErWq4NmY-5TTX4Q@mail.gmail.com

Branch
------
master

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

Modified Files
--------------
src/backend/commands/copy.c         | 17 ++++++++++-------
src/test/regress/expected/copy.out  |  2 +-
src/test/regress/expected/copy2.out |  2 +-
3 files changed, 12 insertions(+), 9 deletions(-)



Message-ID: <E1vijJR-001tu4-0e@gemulon.postgresql.org>
Permalink:  ../E1vijJR-001tu4-0e@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1vijJR-001tu4-0e@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: Improve the error message in COPY with HEADER option.
  In-Reply-To: <E1vijJR-001tu4-0e@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