Re: INT64_MIN and _MAX - Mailing list pgsql-hackers

From Kevin Grittner
Subject Re: INT64_MIN and _MAX
Date
Msg-id 852327450.819250.1427232470366.JavaMail.yahoo@mail.yahoo.com
Whole thread Raw
In response to Re: INT64_MIN and _MAX  (Andrew Gierth <andrew@tao11.riddles.org.uk>)
Responses Re: INT64_MIN and _MAX
List pgsql-hackers
Andrew Gierth <andrew@tao11.riddles.org.uk> wrote:

> I didn't replace the 0xFFFFFFFF ones because most or all of them looked
> like basically bit-masking operations rather than actually dealing with
> the bounds of an unsigned int or uint32. I was specifically looking for
> places where literals were being used to represent maximum or minimum
> values.

Well, InvalidSerCommitSeqNo was initially defined to be UINT64_MAX
-- but some buildfarm members didn't know about that so it was
changed to UINT64CONST(0xFFFFFFFFFFFFFFFF).  It is very much about
wanting the maximum value for uint64.  As the comment says:

* - InvalidSerCommitSeqNo is used to indicate a transaction that
*   hasn't committed yet, so use a number greater than all valid
*   ones to make comparison do the expected thing

It does seem odd to only define *some* of these constants.

--
Kevin Grittner
EDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company



pgsql-hackers by date:

Previous
From: Petr Jelinek
Date:
Subject: Re: Replication identifiers, take 4
Next
From: Andrew Gierth
Date:
Subject: Re: Exposing PG_VERSION_NUM in pg_config