Re: Infinite Interval - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Infinite Interval
Date
Msg-id 1072037.1680476054@sss.pgh.pa.us
Whole thread Raw
In response to Re: Infinite Interval  (Joseph Koshakow <koshy44@gmail.com>)
Responses Re: Infinite Interval
List pgsql-hackers
Joseph Koshakow <koshy44@gmail.com> writes:
>> I've added an errcontext to all the errors of the form "X out of
>> range".

Please note the style guidelines [1]:

    errcontext(const char *msg, ...) is not normally called directly from
    an ereport message site; rather it is used in error_context_stack
    callback functions to provide information about the context in which
    an error occurred, such as the current location in a PL function.

If we should have this at all, which I doubt, it's probably
errdetail not errcontext.

> How do you feel about redefining interval_mi in terms of interval_um
> and interval_pl? That one felt like an improvement to me even outside
> of the context of this change.

I did not think so.  For one thing, it introduces integer-overflow
hazards that you would not have otherwise; ie, interval_um might have
to throw an error for INT_MIN input, even though the end result of
the calculation would have been in range.

            regards, tom lane

[1] https://www.postgresql.org/docs/devel/error-message-reporting.html



pgsql-hackers by date:

Previous
From: Peter Geoghegan
Date:
Subject: Re: Pass heaprel to GlobalVisTestFor() in vacuumRedirectAndPlaceholder()
Next
From: Jeff Davis
Date:
Subject: Re: Minimal logical decoding on standbys