Re: pg_lsn cast to/from int8 - Mailing list pgsql-hackers

From Magnus Hagander
Subject Re: pg_lsn cast to/from int8
Date
Msg-id CABUevEw6b7z+CHrywOF_3gXJU7kAYxCqZNbqETZnSJQFATVi_g@mail.gmail.com
Whole thread Raw
In response to Re: pg_lsn cast to/from int8  (Andres Freund <andres@anarazel.de>)
Responses Re: pg_lsn cast to/from int8  (Craig Ringer <craig@2ndquadrant.com>)
List pgsql-hackers


On Tue, Jan 26, 2016 at 3:00 PM, Andres Freund <andres@anarazel.de> wrote:
On 2016-01-26 14:56:21 +0100, Magnus Hagander wrote:
> Is there a reason we don't have casts between int8 and pg_lsn? AFAICT it
> works fine if I create the cast manually... Is it because of
> signed/unsigned if people have really really many transactions?

What for do you want that cast? Yes, the internally mostly share the
representation, but other than that, I don't really see why it's
interesting?

In this case, mostly legacy compatibility. Making an app that works with versions that don't have pg_lsn have a nice path forward to the modern world. Being able to cast from pg_lsn to int8 can also make it easier to work with the values in the client application, though I don't need that for this particular one.

--

pgsql-hackers by date:

Previous
From: Andres Freund
Date:
Subject: Re: pg_lsn cast to/from int8
Next
From: Fujii Masao
Date:
Subject: Re: Improve tab completion for REFRESH MATERIALIZED VIEW