Re: Add new error_action COPY ON_ERROR "log"

Michael Paquier <michael@paquier.xyz>

From: Michael Paquier <michael@paquier.xyz>
To: Bharath Rupireddy <bharath.rupireddyforpostgres@gmail.com>
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-13T05:39:06Z
Lists: pgsql-hackers
On Wed, Mar 13, 2024 at 08:08:42AM +0530, Bharath Rupireddy wrote:
> On Wed, Mar 13, 2024 at 5:16 AM Michael Paquier <michael@paquier.xyz> wrote:
>> The attached 0003 is what I had in mind:
>> - Simplification of the LOG generated with quotes applied around the
>> column name, don't see much need to add the relation name, either, for
>> consistency and because the knowledge is known in the query.
>> - A few more tests.
>> - Some doc changes.
> 
> LGMT. So, I've merged those changes into 0001 and 0002.

I've applied the extra tests for now, as this was really confusing.

Hmm.  This NOTICE is really bugging me.  It is true that the clients
would get more information, but the information is duplicated on the
server side because the error context provides the same information as
the NOTICE itself:
NOTICE:  data type incompatibility at line 1 for column "a"
CONTEXT:  COPY aa, line 1, column a: "a"
STATEMENT:  copy aa from stdin with (on_error ignore, log_verbosity verbose); 
--
Michael

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".