Re: Change COPY ... ON_ERROR ignore to ON_ERROR ignore_row

From: jian he <jian(dot)universality(at)gmail(dot)com>
To: Jim Jones <jim(dot)jones(at)uni-muenster(dot)de>
Cc: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>, Yugo NAGATA <nagata(at)sraoss(dot)co(dot)jp>, torikoshia <torikoshia(at)oss(dot)nttdata(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Change COPY ... ON_ERROR ignore to ON_ERROR ignore_row
Date: 2024-08-26 00:00:00
Message-ID: CACJufxFFdtPKk4B5rSVNEk6yCH2Amvi_8w3Gaz5wg9M_t9c5Rw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

hi all.
patch updated.
simplified the code a lot.

idea is same:
COPY t_on_error_null FROM STDIN WITH (on_error set_to_null);

If the STDIN number of columns is the same as the target table, then
InputFunctionCallSafe
call failure will make that column values be null.

If the STDIN number of columns is not the same as the target table, then error
ERROR: missing data for column \"%s\"
ERROR: extra data after last expected column
which is status quo.

Attachment Content-Type Size
v3-0001-on_error-set_to_null.patch text/x-patch 7.7 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Michael Paquier 2024-08-26 00:58:51 Switch PgStat_HashKey.objoid from Oid to uint64
Previous Message Thomas Munro 2024-08-25 23:05:46 Re: Interrupts vs signals