Re: POC PATCH: copy from ... exceptions to: (was Re: VLDB Features) - Mailing list pgsql-hackers

From Zhihong Yu
Subject Re: POC PATCH: copy from ... exceptions to: (was Re: VLDB Features)
Date
Msg-id CALNJ-vQR+EmCConUkin8eQEO55XPpcbxSuE88X6F0SJ2F=T6pw@mail.gmail.com
Whole thread Raw
In response to POC PATCH: copy from ... exceptions to: (was Re: VLDB Features)  (Alex Shulgin <ash@commandprompt.com>)
List pgsql-hackers
Hi,
I was looking at 0004-COPY_IGNORE_ERRORS.patch

+ * Ignore constraints if IGNORE_ERRORS is enabled
+ */
+static void
+safeExecConstraints(CopyFromState cstate, ResultRelInfo *resultRelInfo, TupleTableSlot *myslot, EState *estate)

I think the existing ExecConstraints() can be expanded by checking cstate->opts.ignore_errors so that it can selectively ignore Constraint Violations.

This way you don't need safeExecConstraints().

Cheers

pgsql-hackers by date:

Previous
From: Nathan Bossart
Date:
Subject: Re: archive modules
Next
From: David Rowley
Date:
Subject: Re: shadow variables - pg15 edition