Re: "xmin" system column

From: "Jim C(dot) Nasby" <jnasby(at)pervasive(dot)com>
To: Christian Kratzer <ck(at)cksoft(dot)de>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: "xmin" system column
Date: 2006-01-31 20:23:50
Message-ID: 20060131202350.GZ95850@pervasive.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Fri, Jan 27, 2006 at 11:18:23AM +0100, Christian Kratzer wrote:
> Hi,
>
> On Thu, 26 Jan 2006, Eric B. Ridge wrote:
> <snip/>
> ><long pause>
> >
> >hahaha, *blush*. I could just use "now()", right? pg8.1 docs say that
> >now()/CURRENT_TIMESTAMP "return the start time of the current transaction;
> >their values do not change during the transaction". I could use a
> >composite of (now(), GetTopTransctionId()) to assume batch uniqueness.
>
> Or use a touple of (now(), pg_backend_pid()) for this kind of stuff.
> pg_backend_pid() should sufficiently disambiguate now() to make obove
> touple unique.

That doesn't provide very good protection against the system clock
moving backwards though. I suspect you'd be better doing a tuple of
now() and a 2 byte sequence.
--
Jim C. Nasby, Sr. Engineering Consultant jnasby(at)pervasive(dot)com
Pervasive Software http://pervasive.com work: 512-231-6117
vcard: http://jim.nasby.net/pervasive.vcf cell: 512-569-9461

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2006-01-31 20:40:25 Re: help with locked table(s)/transactions(s)
Previous Message Jim C. Nasby 2006-01-31 19:52:05 Re: VACUUM Question