Skip site navigation (1) Skip section navigation (2)

Re: xlog location arithmetic

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Magnus Hagander <magnus(at)hagander(dot)net>
Cc: Euler Taveira de Oliveira <euler(at)timbira(dot)com>, Pgsql Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: xlog location arithmetic
Date: 2011-12-06 16:11:32
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-hackers
On Tue, Dec 6, 2011 at 5:14 AM, Magnus Hagander <magnus(at)hagander(dot)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
The Enterprise PostgreSQL Company

Attachment: lsn.patch
Description: application/octet-stream (11.4 KB)

In response to


pgsql-hackers by date

Next:From: Kevin GrittnerDate: 2011-12-06 16:25:38
Subject: Re: Recover data....
Previous:From: Tom LaneDate: 2011-12-06 16:07:56
Subject: Re: [HACKERS] Moving tablespaces

Privacy Policy | About PostgreSQL
Copyright © 1996-2018 The PostgreSQL Global Development Group