Re: [RFC] Unsigned integer support.

From: Alvaro Herrera <alvherre(at)commandprompt(dot)com>
To: Gregory Stark <stark(at)enterprisedb(dot)com>
Cc: Ryan Bradetich <rbradetich(at)gmail(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: [RFC] Unsigned integer support.
Date: 2008-07-25 15:42:53
Message-ID: 20080725154253.GM9891@alvh.no-ip.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Hiroshi Saito 2008-07-25 16:25:55 Re: Do we really want to migrate plproxy and citext intoPG core distribution?
Previous Message Ryan Bradetich 2008-07-25 15:25:48 Re: [RFC] Unsigned integer support.