Re: POC PATCH: copy from ... exceptions to: (was Re: VLDB Features)

Daniel Gustafsson <daniel@yesql.se>

From: Daniel Gustafsson <daniel@yesql.se>
To: Damir Belyalov <dam.bel07@gmail.com>
Cc: torikoshia <torikoshia@oss.nttdata.com>, PostgreSQL Hackers <pgsql-hackers@postgresql.org>, Andres Freund <andres@anarazel.de>, Danil Anisimow <anisimow.d@gmail.com>, Nikita Malakhov <HukuToc@gmail.com>, a.lepikhov@postgrespro.ru, tgl@sss.pgh.pa.us
Date: 2023-03-07T09:09:23Z
Lists: pgsql-hackers

Commits

Same data as JSON: GET /api/v1/messages/:b64id/commits the thread's linked commits as JSON, with link sources. API reference →
  1. doc: Fix COPY ON_ERROR option syntax synopsis.

  2. Disallow specifying ON_ERROR option without value.

  3. Rename COPY option from SAVE_ERROR_TO to ON_ERROR

  4. Fix spelling in notice

  5. Add new COPY option SAVE_ERROR_TO

> On 7 Mar 2023, at 09:35, Damir Belyalov <dam.bel07@gmail.com> wrote:

> I felt just logging "Error: %ld" would make people wonder the meaning of 
> the %ld. Logging something like ""Error: %ld data type errors were 
> found" might be clearer.
>  
> Thanks. For more clearance change the message to: "Errors were found: %". 

I'm not convinced that this adds enough clarity to assist the user.  We also
shouldn't use "error" in a WARNING log since the user has explicitly asked to
skip rows on error, so it's not an error per se. How about something like:

  ereport(WARNING,
          (errmsg("%ld rows were skipped due to data type incompatibility", cstate->ignored_errors),
           errhint("Skipped rows can be inspected in the database log for reprocessing.")));

--
Daniel Gustafsson