Re: Conflict handling for COPY FROM

Поиск
Список
Период
Сортировка
От Alvaro Herrera
Тема Re: Conflict handling for COPY FROM
Дата
Msg-id 20190628131221.GA30180@alvherre.pgsql
обсуждение исходный текст
Ответ на Re: Conflict handling for COPY FROM  (Surafel Temesgen <surafel3000@gmail.com>)
Ответы Re: Conflict handling for COPY FROM  (Alexey Kondratov <a.kondratov@postgrespro.ru>)
Список pgsql-hackers
On 2019-Jun-28, Surafel Temesgen wrote:

> On Wed, Feb 20, 2019 at 7:04 PM Andres Freund <andres@anarazel.de> wrote:

> > On February 20, 2019 6:05:53 AM PST, Andrew Dunstan <
> > andrew.dunstan@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



В списке pgsql-hackers по дате отправления:

Предыдущее
От: Alexander Korotkov
Дата:
Сообщение: Re: SQL/JSON path issues/questions
Следующее
От: Adam Berlin
Дата:
Сообщение: Re: C testing for Postgres