Re: operators +/- with oids

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: ivan <iv(at)psycho(dot)pl>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: operators +/- with oids
Date: 2004-01-05 08:31:01
Message-ID: 29803.1073291461@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

ivan <iv(at)psycho(dot)pl> writes:
> why there are no operators +-*/ to oid data type ?

Why should there be? Addition on OIDs seems like a meaningless
operation, at least for the intended usage of OIDs (namely as
opaque identifiers).

Yes, I know we have < and >= and similar operators on OID, but those
are only there to support btree indexes on OIDs. Equality is the only
user-meaningful operator in the lot, IMHO.

If you are desperate you can cast OID to int4 and then arithmetize it
all you want.

regards, tom lane

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Oleg Bartunov 2004-01-05 08:33:56 Re: Composite GiST indexes?
Previous Message ivan 2004-01-05 08:17:37 operators +/- with oids