The old code used SEQ_MINVALUE to get the smallest int64 value. This
was done as a convenience to avoid having to deal with INT64_IS_BUSTED,
but that is obsolete now. Also, it is incorrect because the smallest
int64 value is actually SEQ_MINVALUE-1. Fix by using PG_INT64_MIN.
static Datum
leftmostvalue_int8(void)
{
- /*
- * Use sequence's definition to keep compatibility.
- */
- return Int64GetDatum(SEQ_MINVALUE);
+ return Int64GetDatum(PG_INT64_MIN);
}
GIN_SUPPORT(int8, false, leftmostvalue_int8, btint8cmp)
static Datum
leftmostvalue_money(void)
{
- /*
- * Use sequence's definition to keep compatibility.
- */
- return Int64GetDatum(SEQ_MINVALUE);
+ return Int64GetDatum(PG_INT64_MIN);
}
GIN_SUPPORT(money, false, leftmostvalue_money, cash_cmp)