Re: on_error table, saving error info to a table - Mailing list pgsql-hackers

From jian he
Subject Re: on_error table, saving error info to a table
Date
Msg-id CACJufxFRDRkqMhuQqoTXY8-30epEGHim85CS8dMfhRR+XK2sUQ@mail.gmail.com
Whole thread
In response to Re: on_error table, saving error info to a table  (jian he <jian.universality@gmail.com>)
List pgsql-hackers
Hi.

V15 makes some non-fundamental changes compared to v14.
These are listed below:

1. Previously COPY FREEZE + ON_ERROR table does not working properly.
We need go through CopyFrom ``if (cstate->opts.freeze)`` loop first
then do CopyFromErrorTableInit.

2. we need following for COPY ON_ERROR table
```
if (XactReadOnly && !cstate->error_rel->rd_islocaltemp)
PreventCommandIfReadOnly("COPY FROM");
```

3. With COPY(ON_ERROR TABLE) in some case, we need set the
(CopyInsertMethod insertMethod)
to CIM_SINGLE.

4. Yes, (lineno bigint, line text) distinguishes the error rows within one COPY.
It does not distinguish rows from different COPY FROM operations that
write to the same
error table, e.g., loading the same file twice.
So I added a (starttime timestamptz) column, set to the statement start time.
Each <command>COPY FROM</command> command records its own start time,
so this column distinguishes the rows saved by different commands.



--
jian
https://www.enterprisedb.com/

Attachment

pgsql-hackers by date:

Previous
From: Vadim Shakirov
Date:
Subject: [PATCH v1] Fix out-of-bounds access in pg_bsd_indent's parser stack
Next
From: kedar anavardekar
Date:
Subject: Re: Proposal: Conflict log history table for Logical Replication