On Mon, Mar 04, 2024 at 05:00:00AM +0530, Bharath Rupireddy wrote:
> How about an extra option to error_action ignore-with-verbose which is
> similar to ignore but when specified emits one NOTICE per malformed
> row? With this, one can say COPY x FROM stdin (ON_ERROR
> ignore-with-verbose);.
>
> Alternatively, we can think of adding a new option verbose altogether
> which can be used for not only this but for reporting some other COPY
> related info/errors etc. With this, one can say COPY x FROM stdin
> (VERBOSE on, ON_ERROR ignore);.
I would suggest a completely separate option, because that offers more
flexibility as each option has a separate meaning. My main concern in
using one option to control them all is that one may want in the
future to be able to specify more combinations of actions at query
level, especially if more modes are added to the ON_ERROR mode. One
option would prevent that.
Perhaps ERROR_VERBOSE or ERROR_VERBOSITY would be better names, but
I'm never wedded to my naming suggestions. Bad history with the
matter.
> There's also another way of having a separate GUC, but -100 from me
> for it. Because, it not only increases the total number of GUCs by 1,
> but also might set a wrong precedent to have a new GUC for controlling
> command level outputs.
What does this have to do with GUCs? The ON_ERROR option does not
have one.
--
Michael