Make oidin/oidout produce and consume unsigned representation of Oid,
Tom Lane <tgl@sss.pgh.pa.us>
Make oidin/oidout produce and consume unsigned representation of Oid, rather than just being aliases for int4in/int4out. Give type Oid a full set of comparison operators that do proper unsigned comparison, instead of reusing the int4 comparators. Since pg_dump is now doing unsigned comparisons of OIDs, it is now *necessary* that we play by the rules here. In fact, given that btoidcmp() has been doing unsigned comparison for quite some time, it seems likely that we have index- corruption problems in 7.0 and before once the Oid counter goes past 2G. Fixing these operators is a necessary step before we can think about 8-byte Oid, too.
Files
| Path | Change | +/− |
|---|---|---|
| src/backend/utils/adt/oid.c | modified | +68 −27 |
| src/include/catalog/catversion.h | modified | +2 −2 |
| src/include/catalog/pg_operator.h | modified | +20 −8 |
| src/include/catalog/pg_proc.h | modified | +10 −5 |
| src/include/utils/builtins.h | modified | +9 −7 |
| src/test/regress/expected/oid.out | modified | +51 −44 |
| src/test/regress/sql/oid.sql | modified | +11 −7 |