Re: pgsql: Further code review for pg_lsn data type.

From: Andres Freund <andres(at)2ndquadrant(dot)com>
To: Robert Haas <rhaas(at)postgresql(dot)org>
Cc: pgsql-committers(at)postgresql(dot)org
Subject: Re: pgsql: Further code review for pg_lsn data type.
Date: 2014-02-20 00:56:47
Message-ID: 20140220005647.GN28858@alap3.anarazel.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Hi,

On 2014-02-19 15:10:52 +0000, Robert Haas wrote:
> Change input function error messages to be more consistent with what is
> done elsewhere. Remove a bunch of redundant type casts, so that the
> compiler will warn us if we screw up. Don't pass LSNs by value on
> platforms where a Datum is only 32 bytes, per buildfarm. Move macros
> for packing and unpacking LSNs to pg_lsn.h so that we can include
> access/xlogdefs.h, to avoid an unsatisfied dependency on XLogRecPtr.

Hm, won't
#define DatumGetLSN(X) ((XLogRecPtr) DatumGetInt64(X))
#define LSNGetDatum(X) (Int64GetDatum((int64) (X)))
possibly truncate the value if it's larger than 2^(63-1) as int is
signed but XLogRecPtr is unsigned?

I am afraid you're going to have to copy the whole #ifdef
USE_FLOAT8_BYVAL dance.

Not that it's too likely to have that big values in reality atm...

Greetings,

Andres Freund

--
Andres Freund http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services

In response to

Responses

Browse pgsql-committers by date

  From Date Subject
Next Message Tom Lane 2014-02-20 02:08:55 pgsql: Remove inappropriate EXPORTS line.
Previous Message Michael Paquier 2014-02-20 00:49:35 Re: [HACKERS] Re: pgsql: Add a GUC to report whether data page checksums are enabled.