Re: Add new error_action COPY ON_ERROR "log"

Bharath Rupireddy <bharath.rupireddyforpostgres@gmail.com>

From: Bharath Rupireddy <bharath.rupireddyforpostgres@gmail.com>
To: Michael Paquier <michael@paquier.xyz>
Cc: torikoshia <torikoshia@oss.nttdata.com>, "David G. Johnston" <david.g.johnston@gmail.com>, jian.universality@gmail.com, Pgsql Hackers <pgsql-hackers@postgresql.org>, Alexander Korotkov <aekorotkov@gmail.com>
Date: 2024-03-07T07:18:12Z
Lists: pgsql-hackers
On Thu, Mar 7, 2024 at 9:30 AM Michael Paquier <michael@paquier.xyz> wrote:
>
> Is a boolean the best interface for the end-user, though?  Maybe
> something like a "mode" value would speak more than a yes/no from the
> start, say a "default" mode to emit only the last LOG and a "verbose"
> for the whole set in the case of ON_ERROR?  That could use an enum
> from the start internally, but that's an implementation detail.

I'm okay with it. But, help me understand it better. We want the
'log_verbosity' clause to have options 'default' and 'verbose', right?
And, later it can also be extended to contain all the LOG levels like
'notice', 'error', 'info' , 'debugX' etc. depending on the need,
right?

One more thing, how does it sound using both verbosity and verbose in
log_verbosity verbose something like below? Is this okay?

COPY check_ign_err FROM STDIN WITH (on_error ignore, log_verbosity verbose);

-- 
Bharath Rupireddy
PostgreSQL Contributors Team
RDS Open Source Databases
Amazon Web Services: https://aws.amazon.com



Commits

  1. Add new COPY option LOG_VERBOSITY.

  2. Add tests for more row patterns with COPY FROM .. (ON_ERROR ignore)

  3. Support writing "CREATE/ALTER TABLE ... SET STORAGE DEFAULT".