Re: Missing PG_INT32_MIN in numutils.c

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Michael Paquier <michael(dot)paquier(at)gmail(dot)com>, PostgreSQL mailing lists <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Missing PG_INT32_MIN in numutils.c
Date: 2016-04-13 14:13:35
Message-ID: CA+TgmoY2-WxSTW6uYAjzTT5D-5TBg4R+KqL42dD-X+oewJVZeQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, Apr 13, 2016 at 10:11 AM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> Robert Haas <robertmhaas(at)gmail(dot)com> writes:
>> On Wed, Apr 13, 2016 at 9:38 AM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
>>> I am not very convinced that this is an improvement, because you took
>>> what had been two hard-wired constants and replaced them with a symbol
>>> and a hard-wired constant.This is more prone to break, not less so.
>
>> I think it's kind of six of one, half a dozen of the other, but if you
>> feel strongly about it, revert the patch.
>
> I don't care enough to do that either, but I wanted to point out that
> it's pretty questionable whether this is a stylistic improvement.

Yeah, fair. I think it depends on whether you think it is more likely
that people will (a) grep for PG_INT_MIN32 to find places where we do
overflow handling or (b) observe the close relationship between the
two constants on adjacent lines. Probably I should have waited for
comments before committing, but I figured we wanted to avoid hardcoded
constants and didn't think much further.

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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2016-04-13 14:20:37 Re: Re: [COMMITTERS] pgsql: Avoid extra locks in GetSnapshotData if old_snapshot_threshold <
Previous Message José Luis Tallón 2016-04-13 14:11:45 Re: Parser extensions (maybe for 10?)