From: | alphax <alphax(at)vip(dot)163(dot)com> |
---|---|
To: | Marko Kreen <markokr(at)gmail(dot)com> |
Cc: | pg-general <pgsql-general(at)postgresql(dot)org> |
Subject: | Re: How to safely compare transaction id? |
Date: | 2008-01-13 11:11:08 |
Message-ID: | 4789F1CC.1060906@vip.163.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
Marko Kreen wroted:
>> 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"?
>>
>
> No, it is just physical location of the row.
Thanks, I just done some simple tested,
//////////////////////////////////////////////////////////////////////////
// initialize
//////////////////////////////////////////////////////////////////////
create table test (last_update_tx_id);
insert into test(txid_current());
/////////////////////////////////////////////////////////////////////
// Every time I do an update, I found the last_update_tx_id is equal to
the xmin
////////////////////////
begin
update test set last_update_tx_id = txid_current();
commit;
select *, test.xmin from test;
//////////////////////////////////////////////////////////////////////////
So, it seems the system column "cmin" is the logical "current version"
of that record, isn't it?
From | Date | Subject | |
---|---|---|---|
Next Message | Janning Vygen | 2008-01-13 11:13:55 | Re: Prepared Statements |
Previous Message | Tristen Ennemuist | 2008-01-13 10:55:08 | libpq updateable resultset? |