public inbox for [email protected]
help / color / mirror / Atom feedFrom: Yugo NAGATA <[email protected]>
To: Masahiko Sawada <[email protected]>
Cc: [email protected]
Subject: Re: Small fix on COPY ON_ERROR document
Date: Fri, 26 Jan 2024 14:40:11 +0900
Message-ID: <[email protected]> (raw)
In-Reply-To: <CAD21AoBAAxPdEdDJTwJRQbiQ-+xhfPDcfcPPSddpzTsO9xMLzw@mail.gmail.com>
References: <[email protected]>
<CAD21AoBAAxPdEdDJTwJRQbiQ-+xhfPDcfcPPSddpzTsO9xMLzw@mail.gmail.com>
On Fri, 26 Jan 2024 13:59:09 +0900
Masahiko Sawada <[email protected]> wrote:
> On Fri, Jan 26, 2024 at 11:28 AM Yugo NAGATA <[email protected]> wrote:
> >
> > Hi,
> >
> > I found that the documentation of COPY ON_ERROR said
> > COPY stops operation at the first error when
> > "ON_ERROR is not specified.", but it also stop when
> > ON_ERROR is specified to the default value, "stop".
> >
> > I attached a very small patch to fix this just for
> > making the description more accurate.
>
> Thank you for the patch!
>
> +1 to fix it.
>
> - <literal>ON_ERROR</literal> is not specified. This
> - should not lead to problems in the event of a <command>COPY
> + <literal>ON_ERROR</literal> is not specified or <literal>stop</literal>.
> + This should not lead to problems in the event of a <command>COPY
>
> How about the followings for consistency with the description of the
> ON_ERROR option?
>
> COPY stops operation at the first error if the stop value is specified
> to the ON_ERROR option. This should not lead to ...
Thank you for you review. However, after posting the previous patch,
I noticed that I overlooked ON_ERROR works only for errors due to data
type incompatibility (that is mentioned as "malformed data" in the
ON_ERROR description, though).
So, how about rewriting this like:
COPY stops operation at the first error unless the error is due to data
type incompatibility and a value other than stop is specified to the
ON_ERROR option.
I attached the updated patch.
Regards,
Yugo Nagata
>
> Regards,
>
> --
> Masahiko Sawada
> Amazon Web Services: https://aws.amazon.com
--
Yugo NAGATA <[email protected]>
Attachments:
[text/x-diff] v2_small_fix_on_copy_doc.patch (979B, ../[email protected]/2-v2_small_fix_on_copy_doc.patch)
download | inline diff:
diff --git a/doc/src/sgml/ref/copy.sgml b/doc/src/sgml/ref/copy.sgml
index 21a5c4a052..3676bf0e87 100644
--- a/doc/src/sgml/ref/copy.sgml
+++ b/doc/src/sgml/ref/copy.sgml
@@ -576,9 +576,10 @@ COPY <replaceable class="parameter">count</replaceable>
</para>
<para>
- <command>COPY</command> stops operation at the first error when
- <literal>ON_ERROR</literal> is not specified. This
- should not lead to problems in the event of a <command>COPY
+ <command>COPY</command> stops operation at the first error unless the error
+ is due to data type incompatibility and a value other than
+ <literal>stop</literal> is specified to the <literal>ON_ERROR</literal> option.
+ This should not lead to problems in the event of a <command>COPY
TO</command>, but the target table will already have received
earlier rows in a <command>COPY FROM</command>. These rows will not
be visible or accessible, but they still occupy disk space. This might
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]
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