Re: How to safely compare transaction id? - Mailing list pgsql-general

From alphax
Subject Re: How to safely compare transaction id?
Date
Msg-id 47884AF9.5000407@vip.163.com
Whole thread Raw
In response to How to safely compare transaction id?  (alphax <alphax@vip.163.com>)
Responses Re: How to safely compare transaction id?  ("Marko Kreen" <markokr@gmail.com>)
Re: How to safely compare transaction id?  ("Trevor Talbot" <quension@gmail.com>)
List pgsql-general
Marko Kreen wrote:
> On 1/11/08, alphax <alphax@vip.163.com> wrote:
>> I want to compare the record's transaction id in sql statements or
>> PL/pgSQL stored procedure. Are there any system function or operator can
>> safely(transaction id wraparound safed) compare the transaction id?
>
> In 8.3 there are txid functions that export 8byte wraparound-safe
> transaction id, that can be safely stored in user tables:
>
> http://developer.postgresql.org/pgdocs/postgres/functions-info.html#FUNCTIONS-TXID-SNAPSHOT
>
>
> For 8.2 and below you can get them as external module from
> Skytools package: http://pgfoundry.org/projects/skytools
>

Thanks. Actually, I want to compares the system columns(xmin, xmax,
ctid) with the tid returned by txid functions declared in

http://developer.postgresql.org/pgdocs/postgres/functions-info.html#FUNCTIONS-TXID-SNAPSHOT


I want to determines a given record which visible to current transaction
whether or not be updated after some time point, that time point is
indicated by aother transaction id started and committed in past time.
How can I safely do that?

By the way, Can I think that the value of system column "ctid" of an
record is the logical "current version" of that record, and used to
compare with txid returned by "FUNCTIONS-TXID-SNAPSHOT"?



pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: oddly slow query
Next
From: "henry"
Date:
Subject: tcp_keepalives_idle ignored