use of SEQ_MINVALUE in btree_gin

Started by Peter Eisentrautalmost 10 years ago2 messageshackers
Jump to latest
#1Peter Eisentraut
peter_e@gmx.net

btree_gin uses SEQ_MINVALUE as a way to get the smallest int64 value.
This is actually wrong because the smallest int64 value is
SEQ_MINVALUE-1, so this might be slightly broken.

The whole thing was done as a convenience when INT64_IS_BUSTED had to be
considered, but I think we can get rid of that now. See attached
proposed patch.

--
Peter Eisentraut http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

Attachments:

btree-gin-seq-minvalue.patchtext/plain; charset=UTF-8; name=btree-gin-seq-minvalue.patch; x-mac-creator=0; x-mac-type=0Download+2-8
#2Tom Lane
tgl@sss.pgh.pa.us
In reply to: Peter Eisentraut (#1)
Re: use of SEQ_MINVALUE in btree_gin

Peter Eisentraut <peter.eisentraut@2ndquadrant.com> writes:

btree_gin uses SEQ_MINVALUE as a way to get the smallest int64 value.
This is actually wrong because the smallest int64 value is
SEQ_MINVALUE-1, so this might be slightly broken.

The whole thing was done as a convenience when INT64_IS_BUSTED had to be
considered, but I think we can get rid of that now. See attached
proposed patch.

+1. I agree that this is actually a bug fix, so it should be back-patched.

regards, tom lane

--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers