Re: is ErrorResponse possible on Sync?

Поиск
Список
Период
Сортировка
От Andrei Matei
Тема Re: is ErrorResponse possible on Sync?
Дата
Msg-id CABWLsevei_ZN45esJ7LSSvJ1A2X7vt2ygu9u5jSz4dpD8TaSFw@mail.gmail.com
обсуждение исходный текст
Ответ на Re: is ErrorResponse possible on Sync?  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: is ErrorResponse possible on Sync?  (Alvaro Herrera <alvherre@alvh.no-ip.org>)
Re: is ErrorResponse possible on Sync?  (Tatsuo Ishii <ishii@sraoss.co.jp>)
Список pgsql-hackers
Thanks!

I work on CockroachDB - which is wire-compatible with Postgres - so I'm interested in what the server can and cannot do.
 
Uh ... I don't think Sync itself can fail.  Any ErrorResponse you see
there is really from failure of some prior command.

Hmm, this got me curious. If Sync itself cannot fail, then what is this sentence really saying: "This parameterless message (ed. Sync) 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)." ?
This seems to say that, outside of BEGIN/END, the transaction is committed at Sync time (i.e. if the Sync is never sent, nothing is committed). Presumably, committing a transaction can fail even if no previous command/statement failed, right?

 
  The Sync is really
delimiting how much stuff you'd like to skip in case of a failure.
Basically this is to allow pipelining of commands, with the ability to
discard later commands if an earlier one fails.

But in any case, no, Sync would not suppress an error message if
one is needed.

                        regards, tom lane

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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: is ErrorResponse possible on Sync?
Следующее
От: Robert Haas
Дата:
Сообщение: Re: generic plans and "initial" pruning