Re: POC PATCH: copy from ... exceptions to: (was Re: VLDB Features)

From: jian he <jian(dot)universality(at)gmail(dot)com>
To: torikoshia <torikoshia(at)oss(dot)nttdata(dot)com>
Cc: Alexander Korotkov <aekorotkov(at)gmail(dot)com>, Masahiko Sawada <sawada(dot)mshk(at)gmail(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Kyotaro Horiguchi <horikyota(dot)ntt(at)gmail(dot)com>, vignesh21(at)gmail(dot)com, lena(dot)ribackina(at)yandex(dot)ru, dam(dot)bel07(at)gmail(dot)com, zhihuifan1213(at)163(dot)com, daniel(at)yesql(dot)se, pgsql-hackers(at)postgresql(dot)org, andres(at)anarazel(dot)de, anisimow(dot)d(at)gmail(dot)com, HukuToc(at)gmail(dot)com, pgsql-hackers(at)lists(dot)postgresql(dot)org, a(dot)lepikhov(at)postgrespro(dot)ru
Subject: Re: POC PATCH: copy from ... exceptions to: (was Re: VLDB Features)
Date: 2024-01-18 14:59:44
Message-ID: CACJufxGJjj94XTWsD9eJaiE99CPRBkO1frvJWTJ-6NDpa+ksLg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi.
patch refactored based on "on_error {stop|ignore}"
doc changes:

--- a/doc/src/sgml/ref/copy.sgml
+++ b/doc/src/sgml/ref/copy.sgml
@@ -43,7 +43,7 @@ COPY { <replaceable
class="parameter">table_name</replaceable> [ ( <replaceable
FORCE_QUOTE { ( <replaceable
class="parameter">column_name</replaceable> [, ...] ) | * }
FORCE_NOT_NULL { ( <replaceable
class="parameter">column_name</replaceable> [, ...] ) | * }
FORCE_NULL { ( <replaceable
class="parameter">column_name</replaceable> [, ...] ) | * }
- SAVE_ERROR_TO '<replaceable class="parameter">location</replaceable>'
+ ON_ERROR '<replaceable class="parameter">error_action</replaceable>'
ENCODING '<replaceable class="parameter">encoding_name</replaceable>'
</synopsis>
</refsynopsisdiv>
@@ -375,20 +375,20 @@ COPY { <replaceable
class="parameter">table_name</replaceable> [ ( <replaceable
</varlistentry>

<varlistentry>
- <term><literal>SAVE_ERROR_TO</literal></term>
+ <term><literal>ON_ERROR</literal></term>
<listitem>
<para>
- Specifies to save error information to <replaceable class="parameter">
- location</replaceable> when there is malformed data in the input.
- Currently, only <literal>error</literal> (default) and
<literal>none</literal>
+ Specifies which <replaceable class="parameter">
+ error_action</replaceable> to perform when there is malformed
data in the input.
+ Currently, only <literal>stop</literal> (default) and
<literal>ignore</literal>
values are supported.
- If the <literal>error</literal> value is specified,
+ If the <literal>stop</literal> value is specified,
<command>COPY</command> stops operation at the first error.
- If the <literal>none</literal> value is specified,
+ If the <literal>ignore</literal> value is specified,
<command>COPY</command> skips malformed data and continues copying data.
The option is allowed only in <command>COPY FROM</command>.
- The <literal>none</literal> value is allowed only when
- not using <literal>binary</literal> format.
+ Only <literal>stop</literal> value is allowed only when
+ using <literal>binary</literal> format.
</para>

Attachment Content-Type Size
copy_on_error.diff text/x-patch 17.8 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Magnus Hagander 2024-01-18 15:01:33 Re: System username in pg_stat_activity
Previous Message Melanie Plageman 2024-01-18 14:53:12 Re: Emit fewer vacuum records by reaping removable tuples during pruning