Re: xlog location arithmetic - Mailing list pgsql-hackers

From Robert Haas
Subject Re: xlog location arithmetic
Date
Msg-id CA+TgmoZRMNN0eVEsD-kxB9e-MvdmwoTi6guuJUvQP_8q2C5Cyg@mail.gmail.com
Whole thread Raw
In response to Re: xlog location arithmetic  (Magnus Hagander <magnus@hagander.net>)
Responses Re: xlog location arithmetic  (Euler Taveira de Oliveira <euler@timbira.com>)
List pgsql-hackers
On Tue, Dec 6, 2011 at 5:14 AM, Magnus Hagander <magnus@hagander.net> wrote:
> I've been considering similar things, as you can find in the archives,
> but what I was thinking of was converting the number to just a plain
> bigint, then letting the user apply whatever arithmetic wanted at the
> SQL level. I never got around to acutally coding it, though. It could
> easily be extracted from your patch of course - and I think that's a
> more flexible approach. Is there some advantage to your method that
> I'm missing?

I went so far as to put together an lsn data type.  I didn't actually
get all that far with it, which is why I haven't posted it sooner, but
here's what I came up with.  It's missing indexing support and stuff,
but that could be added if people like the approach.  It solves this
problem by implementing -(lsn,lsn) => numeric (not int8, that can
overflow since it is not unsigned), which allows an lsn => numeric
conversion by just subtracting '0/0'::lsn.

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

Attachment

pgsql-hackers by date:

Previous
From: "Azghar Hussain"
Date:
Subject: Recover data....
Next
From: "Kevin Grittner"
Date:
Subject: Re: Recover data....