Re: Connection Pooling, a year later

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Connection Pooling, a year later
Дата
Msg-id 13231.1008688123@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Connection Pooling, a year later  (Bruce Momjian <pgman@candle.pha.pa.us>)
Ответы Re: Connection Pooling, a year later  (Bruce Momjian <pgman@candle.pha.pa.us>)
Список pgsql-hackers
Bruce Momjian <pgman@candle.pha.pa.us> writes:
> No problem, it is just that rollbacks when you are not in a transaction
> cause a log error message.

I don't see any difference in the behavior: you get a notice either way.

regression=# commit;
NOTICE:  COMMIT: no transaction in progress
COMMIT
regression=# rollback;
NOTICE:  ROLLBACK: no transaction in progress
ROLLBACK
regression=#

My recommendation would generally be to do a ROLLBACK not a COMMIT, on
the grounds that if the previous user failed to complete his transaction
you probably want to abort it, not assume that it's safe to commit.

However, this safety-first approach might be unworkable if you have a
large body of existing code that all assumes it needn't issue COMMIT
explicitly.
        regards, tom lane


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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Bulkloading using COPY - ignore duplicates?
Следующее
От: Bruce Momjian
Дата:
Сообщение: Re: Connection Pooling, a year later