Re: Transaction ID not logged if no explicit transaction used

From: Martín Marqués <martin(at)2ndquadrant(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-general <pgsql-general(at)postgresql(dot)org>
Subject: Re: Transaction ID not logged if no explicit transaction used
Date: 2016-02-11 22:42:22
Message-ID: 56BD0E4E.5050503@2ndquadrant.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Alvaro Herrera 2016-02-11 23:12:08 Re: Transaction ID not logged if no explicit transaction used
Previous Message Yury Zhuravlev 2016-02-11 21:56:56 Re: Test CMake build