On Fri, Mar 8, 2024 at 4:42 PM Michael Paquier <michael@paquier.xyz> wrote:
>
> On Fri, Mar 08, 2024 at 03:36:30PM +0530, Bharath Rupireddy wrote:
> > Please see the attached v5-0001 patch implementing LOG_VERBOSITY with
> > options 'default' and 'verbose'. v5-0002 adds the detailed info to
> > ON_ERROR 'ignore' option.
>
> I may be reading this patch set incorrectly, but why doesn't this
> patch generate one NOTICE per attribute, as suggested by Sawada-san,
> incrementing num_errors once per row when the last attribute has been
> processed? Also, why not have a test that checks that multiple rows
> spawn more than more messages in some distributed fashion? Did you
> look at this idea?
If NOTICE per attribute and incrementing num_errors per row is
implemented, it ends up erroring out with ERROR: missing data for
column "m" for all-column-empty-row. Shall we treat this ERROR softly
too if on_error ignore is specified? Or shall we discuss this idea
separately?
-- tests for options on_error and log_verbosity
COPY check_ign_err FROM STDIN WITH (on_error ignore, log_verbosity 'verbose');
1 {1} 1
a {2} 2
3 {3} 3333333333
4 {a, 4} 4
5 {5} 5
\.
NOTICE: detected data type incompatibility at line number 2 for
column n; COPY check_ign_err
NOTICE: detected data type incompatibility at line number 2 for
column m; COPY check_ign_err
NOTICE: detected data type incompatibility at line number 2 for
column k; COPY check_ign_err
NOTICE: detected data type incompatibility at line number 3 for
column k; COPY check_ign_err
NOTICE: detected data type incompatibility at line number 4 for
column m; COPY check_ign_err
NOTICE: detected data type incompatibility at line number 4 for
column k; COPY check_ign_err
NOTICE: detected data type incompatibility at line number 5 for
column n; COPY check_ign_err
ERROR: missing data for column "m"
CONTEXT: COPY check_ign_err, line 5: ""
--
Bharath Rupireddy
PostgreSQL Contributors Team
RDS Open Source Databases
Amazon Web Services: https://aws.amazon.com