Re: Small question

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Small question
Дата
Msg-id 2770.1016822616@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Small question  (Jan Wieck <janwieck@yahoo.com>)
Ответы Re: Small question
Re: Small question
Список pgsql-general
Jan Wieck <janwieck@yahoo.com> writes:
> Joep deVocht wrote:
>> Is there a way to determine whether a transaction
>> is started and not ended yet?

>     I think it's time to add  a  little  boolean  function,  that
>     actually  returns IsTransactionBlock(), and have a libpq side
>     wrapper around PQfn() calling it.

If you're in TRANSACTION ABORT state, I do not think that will work.

Offhand this seems more of a protocol issue.  A straightforward solution
would be to add a status indicator (with three states: out of
transaction, in transaction, in aborted transaction) to the
ReadyForQuery message, but we can't do that without a protocol change,
which is probably more trouble than it's worth.

It seems like it might be possible for libpq (or other clients) to keep
track of the transaction state by paying attention to BEGIN, COMMIT,
ABORT command-completion tags and ERROR messages, but I haven't worked
through the details.

            regards, tom lane

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

Предыдущее
От: posting-system@google.com
Дата:
Сообщение: Re: [GENERAL] index on large table
Следующее
От: Bruce Momjian
Дата:
Сообщение: Re: Small question