Re: why does txid_current() assign new transaction-id? - Mailing list pgsql-hackers

From Naoya Anzai
Subject Re: why does txid_current() assign new transaction-id?
Date
Msg-id 116262CF971C844FB6E793F8809B51C6E8D538@BPXM02GP.gisp.nec.co.jp
Whole thread Raw
In response to Re: why does txid_current() assign new transaction-id?  (Michael Paquier <michael.paquier@gmail.com>)
Responses Re: why does txid_current() assign new transaction-id?  (Michael Paquier <michael.paquier@gmail.com>)
List pgsql-hackers
Thank you for comments.

I understand your points.

For only to read a current transaction-id, I know we just have to use
txid_current_snapshot and that is a best way, but I feel a little bit
hassle to explain columns of txid_current_snapshot for my supporting customers..
(Xmin is .... and Xmax is ....) ..

> txid_current has had the behavior of assigning a new transaction XID
> when one is not assigned since its introduction. I don't think that it
> is wise to change it now the way you do as many applications surely
> rely on this assumption. Perhaps we could make the documentation
> clearer about those things though, changing the description of this
> function to "get current transaction ID, and assign a new one if one
> is not assigned yet":
> http://www.postgresql.org/docs/devel/static/functions-info.html
+1

I think that a description of txid_current is too rough and it might
be confused some users.
txid_current is a different operation depending on session situations,
I feel if detail of txid_current is documented then it will be better.

For example...
Inside of the transaction-block(begin..end), returns a transaction-id used by this block.
Outside of the transaction-block, returns a next transaction-id(but it is consumed by this function).

Regards,

Naoya

---
Naoya Anzai
Engineering Department
NEC Solution Inovetors, Ltd.
E-Mail: nao-anzai@xc.jp.nec.com
---






pgsql-hackers by date:

Previous
From: Dean Rasheed
Date:
Subject: Re: [COMMITTERS] pgsql: Row-Level Security Policies (RLS)
Next
From: Guillaume Lelarge
Date:
Subject: Re: about lob(idea)