Re: Error on failed COMMIT

Поиск
Список
Период
Сортировка
От Dave Cramer
Тема Re: Error on failed COMMIT
Дата
Msg-id CADK3HHK00cxGOXzgQfnjkRzg7tSdwp72oRaEqfjhgxLiKtVF8Q@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Error on failed COMMIT  (Robert Haas <robertmhaas@gmail.com>)
Ответы Re: Error on failed COMMIT  (Robert Haas <robertmhaas@gmail.com>)
Список pgsql-hackers


On Fri, 14 Feb 2020 at 13:29, Robert Haas <robertmhaas@gmail.com> wrote:
On Fri, Feb 14, 2020 at 1:04 PM Dave Cramer <davecramer@postgres.rocks> wrote:
> Thing is that con.commit() DOESN'T return a status code, nor does it throw an exception as we silently ROLLBACK here.

Why not? There's nothing keeping the driver from doing either of those
things, is there? I mean, if using libpq, you can use PQcmdStatus() to
get the command tag, and find out whether it's COMMIT or ROLLBACK. If
you're implementing the wire protocol directly, you can do something
similar.

https://www.postgresql.org/docs/current/libpq-exec.html#LIBPQ-EXEC-NONSELECT

Well now you are asking the driver to re-interpret the results in a different way than the server which is not what we tend to do.

The server throws an error we throw an error. We really aren't in the business of re-interpreting the servers responses.

Dave Cramer
www.postgres.rocks

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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: assert pg_class.relnatts is consistent
Следующее
От: Robert Haas
Дата:
Сообщение: Re: Error on failed COMMIT