Re: Small fix on COPY ON_ERROR document - Mailing list pgsql-hackers

From David G. Johnston
Subject Re: Small fix on COPY ON_ERROR document
Date
Msg-id CAKFQuwYSR61-wqoQKRbmWs7cqHTQOpJRz8o8Jo4H_ddFSRMs-g@mail.gmail.com
Whole thread Raw
In response to Re: Small fix on COPY ON_ERROR document  (Yugo NAGATA <nagata@sraoss.co.jp>)
Responses Re: Small fix on COPY ON_ERROR document
List pgsql-hackers
On Thursday, January 25, 2024, Yugo NAGATA <nagata@sraoss.co.jp> wrote:

Maybe, we can separate the sentese to two, for example:

  COPY stops operation at the first error. (The exception is if the error
  is due to data type incompatibility and a value other than stop is specified
  to the ON_ERROR option.)

I’d lean more toward saying:

Copy from can be instructed to ignore errors that arise from casting input data to the data types of the target columns by setting the on_error option to ignore.  Skipping the entire input row in the process.

The last part is because another way to ignore would be to set null values for those columns.

That a command stops on an error is the assumed behavior throughout the system, writing “copy stops operation at the first error.” just seems really unnecessary.

I will need to make this tweak and probably a couple others to my own suggestions in 12 hours or so.

David J.

pgsql-hackers by date:

Previous
From: David Rowley
Date:
Subject: Delay Memoize hashtable build until executor run
Next
From: Masahiko Sawada
Date:
Subject: Re: Remove unused fields in ReorderBufferTupleBuf