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: Add log_verbosity = 'silent' support to COPY command.
Date: Thu, 03 Oct 2024 06:57:16 +0000
Message-ID: <E1swFlz-001xt0-R5@gemulon.postgresql.org> (raw)

Add log_verbosity = 'silent' support to COPY command.

Previously, when the on_error option was set to ignore, the COPY command
would always log NOTICE messages for input rows discarded due to
data type incompatibility. Users had no way to suppress these messages.

This commit introduces a new log_verbosity setting, 'silent',
which prevents the COPY command from emitting NOTICE messages
when on_error = 'ignore' is used, even if rows are discarded.
This feature is particularly useful when processing malformed files
frequently, where a flood of NOTICE messages can be undesirable.

For example, when frequently loading malformed files via the COPY command
or querying foreign tables using file_fdw (with an upcoming patch to
add on_error support for file_fdw), users may prefer to suppress
these messages to reduce log noise and improve clarity.

Author: Atsushi Torikoshi
Reviewed-by: Masahiko Sawada, Fujii Masao
Discussion: https://postgr.es/m/ab59dad10490ea3734cf022b16c24cfd@oss.nttdata.com

Branch
------
master

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

Modified Files
--------------
doc/src/sgml/ref/copy.sgml          | 10 +++++++---
src/backend/commands/copy.c         |  4 +++-
src/backend/commands/copyfrom.c     |  3 ++-
src/bin/psql/tab-complete.c         |  2 +-
src/include/commands/copy.h         |  4 +++-
src/test/regress/expected/copy2.out |  4 +++-
src/test/regress/sql/copy2.sql      |  4 ++++
7 files changed, 23 insertions(+), 8 deletions(-)



Message-ID: <E1swFlz-001xt0-R5@gemulon.postgresql.org>
Permalink:  ../E1swFlz-001xt0-R5@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1swFlz-001xt0-R5@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: Add log_verbosity = 'silent' support to COPY command.
  In-Reply-To: <E1swFlz-001xt0-R5@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