is ErrorResponse possible on Sync?

Поиск
Список
Период
Сортировка
От Andrei Matei
Тема is ErrorResponse possible on Sync?
Дата
Msg-id CABWLseub08wdSS0V63uK9gazbKLUysXcGizLcBk6+UUz9DpOhw@mail.gmail.com
обсуждение исходный текст
Ответы Re: is ErrorResponse possible on Sync?  (Vladimir Sitnikov <sitnikov.vladimir@gmail.com>)
Re: is ErrorResponse possible on Sync?  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
Hello Postgres friends,

I've got a question about the wire protocol; the relevant text in the docs seems a bit ambiguous to me. If the processing of a Sync message fails (e.g. because the commit of the current transaction fails), is the backend allowed to respond with an ErrorResponse, in addition to the ReadyForQuery message? Or, does the backend swallow the error, and return only the ReadyForQuery (I hope not).

The docs say:
"""
At completion of each series of extended-query messages, the frontend should issue a Sync message. This parameterless message causes the backend to close the current transaction if it's not inside a BEGIN/COMMIT transaction block (“close” meaning to commit if no error, or roll back if error). Then a ReadyForQuery response is issued. The purpose of Sync is to provide a resynchronization point for error recovery. When an error is detected while processing any extended-query message, the backend issues ErrorResponse, then reads and discards messages until a Sync is reached, then issues ReadyForQuery and returns to normal message processing. (But note that no skipping occurs if an error is detected while processing Sync — this ensures that there is one and only one ReadyForQuery sent for each Sync.)
"""

This paragraph acknowledges that an error can be "detected" while processing a Sync, but one reading of it might suggest that the only response from a Sync is a single ReadyForQueryMessage.

Thanks!

- Andrei

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

Предыдущее
От: "Bossart, Nathan"
Дата:
Сообщение: Re: do only critical work during single-user vacuum?
Следующее
От: Vladimir Sitnikov
Дата:
Сообщение: Re: is ErrorResponse possible on Sync?