Re: Timely reporting of COPY errors

Поиск
Список
Период
Сортировка
От Martijn van Oosterhout
Тема Re: Timely reporting of COPY errors
Дата
Msg-id 20080416222001.GC26340@svana.org
обсуждение исходный текст
Ответ на Re: Timely reporting of COPY errors  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: Timely reporting of COPY errors  (Stephen Frost <sfrost@snowman.net>)
Список pgsql-hackers
On Wed, Apr 16, 2008 at 05:22:17PM -0400, Tom Lane wrote:
> I dunno about "intentional", but the API exposed by libpq for COPY
> doesn't really permit any other behavior: you push all the data and
> then look to see if it worked or not.

Oh? I expected the PQputData would return -1 as stated by the
documentation, at which point I would call PQendCopy and retrieve the
resultset.

> Even if we had some way of letting the application notice that the copy
> had already failed, I don't see that psql could do very much with it,
> at least not for COPY FROM STDIN.  It's got to read through the source
> data anyway or it'll be out of sync with the script file.

psql could ignore the result of PQputData if it wanted, no big deal
there.

> We could possibly fix libpq to start dropping the data on the floor
> if it sees an error reply already pending, but that's only going
> to be an incremental change.

At the very least the documentation needs to be improved. For example,
no NOTICEs will be processed either *unless* there are enough to cause
the backend to block. At which point they will all be processed at
once. But the first step would be to get libpq to even notice the
error. I'm confused as to why PQconsumeInput doesn't work.

Have a nice day,
--
Martijn van Oosterhout   <kleptog@svana.org>   http://svana.org/kleptog/
> Please line up in a tree and maintain the heap invariant while
> boarding. Thank you for flying nlogn airlines.

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

Предыдущее
От: "Greg Sabino Mullane"
Дата:
Сообщение: Re: Patch for Prevent pg_dump/pg_restore from being affected by statement_timeout
Следующее
От: "Joshua D. Drake"
Дата:
Сообщение: Re: Patch for Prevent pg_dump/pg_restore from being affected by statement_timeout