On 2019-Jun-28, Surafel Temesgen wrote: > On Wed, Feb 20, 2019 at 7:04 PM Andres Freund <and...@anarazel.de> wrote:
> > On February 20, 2019 6:05:53 AM PST, Andrew Dunstan < > > andrew.duns...@2ndquadrant.com> wrote: > > >Why log to a file at all? We do have, you know, a database handy, where > > >we might more usefully log errors. You could usefully log the offending > > >row as an array of text, possibly. > > > > Or even just return it as a row. CopyBoth is relatively widely supported > > these days. > > i think generating warning about it also sufficiently meet its propose of > notifying user about skipped record with existing logging facility > and we use it for similar propose in other place too. The different > i see is the number of warning that can be generated Warnings seem useless for this purpose. I'm with Andres: returning rows would make this a fine feature. If the user wants the rows in a table as Andrew suggests, she can use wrap the whole thing in an insert. That would make the feature much more usable because you can do further processing with the rows that conflict, if any is necessary (or throw them away if not). Putting them in warnings will just make the screen scroll fast. -- Álvaro Herrera https://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services