Re: Transaction IDs not the same in same transaction?

Поиск
Список
Период
Сортировка
От Michael Fuhr
Тема Re: Transaction IDs not the same in same transaction?
Дата
Msg-id 20051023011410.GA76134@winnie.fuhr.org
обсуждение исходный текст
Ответ на Transaction IDs not the same in same transaction?  (Steve V <dndlists@gmail.com>)
Ответы Re: Transaction IDs not the same in same transaction?  (Steve V <dndlists@gmail.com>)
Список pgsql-general
On Sat, Oct 22, 2005 at 01:30:32PM -0700, Steve V wrote:
> So I was finally able to get a compiled binary for the code in this
> thread(thanks Magnus):
> http://archives.postgresql.org/pgsql-general/2005-06/msg00709.php
>
> So everything seemed to be fine with my GetCurrentTransactionID()
> function call returning the txn ID for each query I would run(as far
> as I could tell). Then I tried running a txn with multiple queries,
> and instead of just having one txn ID, each query had it's own. Does
> that make any sense? I was under the impression that a regular
> transaction block would have one txn ID assigned to it for its
> duration.

It makes sense if you're running PostgreSQL 8.0 or later and are
using subtransactions, whether explicitly or implicitly.  The example
you posted didn't show the trigger definition or function -- does
the function do any error trapping?  Maybe you need GetTopTransactionId()
instead of GetCurrentTransactionID().

Why do you need the transaction ID at all?  Might the xmin system
column serve your purpose?

--
Michael Fuhr

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

Предыдущее
От: Jerry LeVan
Дата:
Сообщение: Ann: PgBrowser-1.1
Следующее
От: Steve V
Дата:
Сообщение: Re: Transaction IDs not the same in same transaction?