Re: Transaction ID not logged if no explicit transaction used

Поиск
Список
Период
Сортировка
От Martín Marqués
Тема Re: Transaction ID not logged if no explicit transaction used
Дата
Msg-id 56BD0E4E.5050503@2ndquadrant.com
обсуждение исходный текст
Ответ на Re: Transaction ID not logged if no explicit transaction used  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: Transaction ID not logged if no explicit transaction used  (Alvaro Herrera <alvherre@2ndquadrant.com>)
Список pgsql-general
El 10/02/16 a las 21:46, Tom Lane escribió:
>
> Think you're outta luck on that.  If we logged the duration before
> commit, it would be entirely misleading for short commands, because
> the time needed to commit wouldn't be included.  So we log it after,
> when there's no longer any active transaction.

Any other way to log the DDL and DML statements (maybe delay writing the
log until the xid is available)?

Yes, I know the complexity of this, but I'm surprised this hasn't come
up in the list before (maybe it did and i missed the mail).

> We could maybe fix this by redefining %x as "the current or most recent
> xid", so that it'd still be valid for messages issued post-commit.
> But I'm afraid that would add about as many bad behaviors as it would
> remove.  In your example above, that would result in a pretty misleading
> xid attached to the "begin" statement, since at that point we have
> started a new transaction but not assigned it any xid.

This really gives little use for recovery_target_xid. :(

Regards,

--
Martín Marqués                http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services


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

Предыдущее
От: Yury Zhuravlev
Дата:
Сообщение: Re: Test CMake build
Следующее
От: Alvaro Herrera
Дата:
Сообщение: Re: Transaction ID not logged if no explicit transaction used