Re: type conversion discussion - Mailing list pgsql-hackers

From Tom Lane
Subject Re: type conversion discussion
Date
Msg-id 28567.958420203@sss.pgh.pa.us
Whole thread Raw
In response to Re: type conversion discussion  (Peter Eisentraut <peter_e@gmx.net>)
List pgsql-hackers
Peter Eisentraut <peter_e@gmx.net> writes:
>> if you wanted to refer to a specific row by OID.  However, while it
>> might be logically purer to insist that OIDs are not numbers, it's just
>> too damn handy to be laxer about the distinction.

> Definitely. But wouldn't three (or six) extra `=' operators be the road of
> least resistance or clearest separation? Not sure.

Actually, that's what we've got now: "oid = 1234" gets parsed into the
oideqint4 operator.  What bugs me about that is the shenanigans the
optimizer has to pull to use an index on the oid column.  I'm hoping
that we can clean up this mess enough so that the operator delivered by
the parser is the same thing the column's index claims to use in the
first place.

> One thing to keep in mind in any case is that oids might not be int4-like
> forever, eventually we might want int8, or the unsigned version thereof.

Agreed, but with any luck that case will work transparently too: the
constant will just get promoted up to int8 before we apply the operator.
        regards, tom lane


pgsql-hackers by date:

Previous
From: The Hermit Hacker
Date:
Subject: Re: FTP-sever ftp.postgresql.org unable to get dir-list ?
Next
From: Bruce Momjian
Date:
Subject: Re: Proposal: replace no-overwrite with Berkeley DB