Re: [RFC] Unsigned integer support. - Mailing list pgsql-hackers

From Alvaro Herrera
Subject Re: [RFC] Unsigned integer support.
Date
Msg-id 20080725154253.GM9891@alvh.no-ip.org
Whole thread Raw
In response to Re: [RFC] Unsigned integer support.  (Gregory Stark <stark@enterprisedb.com>)
Responses Re: [RFC] Unsigned integer support.  (Gregory Stark <stark@enterprisedb.com>)
List pgsql-hackers
Gregory Stark escribió:

> One other idea that's been mentioned before is treating integral constants
> like 150000 as type "unknown" like the quoted '150000' constant is. That way
> the parser would see uint4+unknown and could pick the uint4 operator. But that
> would be a pretty massive semantics change.

Hmm, if we do that, how would the system resolve something like this?

select 1000 + 1000

There would be no clue as to what + operator to pick, since both
operands are unknown.  This is in fact what happens today with

alvherre=# select '100' + '100';
ERROR:  operator is not unique: unknown + unknown at character 14
HINT:  Could not choose a best candidate operator. You might need to add explicit type casts.
STATEMENT:  select '100' + '100';

I think this is a nonstarter.

-- 
Alvaro Herrera                                http://www.CommandPrompt.com/
The PostgreSQL Company - Command Prompt, Inc.


pgsql-hackers by date:

Previous
From: "Ryan Bradetich"
Date:
Subject: Re: [RFC] Unsigned integer support.
Next
From: "Hiroshi Saito"
Date:
Subject: Re: Do we really want to migrate plproxy and citext intoPG core distribution?