public inbox for [email protected]  
help / color / mirror / Atom feed
From: Yugo NAGATA <[email protected]>
To: David G. Johnston <[email protected]>
Cc: Masahiko Sawada <[email protected]>
Cc: [email protected] <[email protected]>
Subject: Re: Small fix on COPY ON_ERROR document
Date: Fri, 26 Jan 2024 18:30:05 +0900
Message-ID: <[email protected]> (raw)
In-Reply-To: <CAKFQuwYSR61-wqoQKRbmWs7cqHTQOpJRz8o8Jo4H_ddFSRMs-g@mail.gmail.com>
References: <[email protected]>
	<CAD21AoBAAxPdEdDJTwJRQbiQ-+xhfPDcfcPPSddpzTsO9xMLzw@mail.gmail.com>
	<[email protected]>
	<CAD21AoBoT7KGpxz3k8LXVP75FL56Ga8CUorrwkT-yu1pEX8ARA@mail.gmail.com>
	<[email protected]>
	<CAKFQuwYSR61-wqoQKRbmWs7cqHTQOpJRz8o8Jo4H_ddFSRMs-g@mail.gmail.com>

On Fri, 26 Jan 2024 00:00:57 -0700
"David G. Johnston" <[email protected]> wrote:

> On Thursday, January 25, 2024, Yugo NAGATA <[email protected]> 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 makes sense. Is is a bit ambiguous to just say "skips malformed data";
it might be unclear for users if the data in the problematic column is skipped
(NULL is set) or the entire row is skipped. Also, setting null values for those
columns could be a future feature of ON_ERROR option.
> 
> 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 think we need to describe this default behavior explicitly somewhere,
as you suggested in the other post [1].

[1] https://www.postgresql.org/message-id/CAKFQuwZJZ6uaS2B7qpL2FJzWBsnDdzgtbsW3pH9zuT6vC3fH%2Bg%40mail.g...

Regards,
Yugo Nagata

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


-- 
Yugo NAGATA <[email protected]>





view thread (14+ messages)  latest in thread

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: [email protected]
  Cc: [email protected], [email protected], [email protected]
  Subject: Re: Small fix on COPY ON_ERROR document
  In-Reply-To: <[email protected]>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox