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

From Gregory Stark
Subject Re: [RFC] Unsigned integer support.
Date
Msg-id 87fxptsjq3.fsf@oxford.xeocode.com
Whole thread Raw
In response to Re: [RFC] Unsigned integer support.  (Decibel! <decibel@decibel.org>)
Responses Re: [RFC] Unsigned integer support.  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
"Decibel!" <decibel@decibel.org> writes:

> On Jul 25, 2008, at 11:44 AM, Alvaro Herrera wrote:
>> However, it would be neat if this behaved the same as
>>
>> alvherre=# select '0.42' + 1;
>> ERROR:  invalid input syntax for integer: "0.42"
>> STATEMENT:  select '0.42' + 1;
>
>
> Do we really want to be making it easier for people to wrap numbers  in quotes?

Currently wrapping numbers in quotes is really the way Postgres expects to get
them. Quoted constants in Postgres are just "unknown" type which are parsed
according to context. Unquoted constants in Postgres are assigned a type by
the parser based on what they look like and then have to be cast to something
else if that turns out to be the wrong data type.

I think people from other languages expect quoted constants to be strings and
they often go out of their way to avoid them (causing themselves headaches
when they then need to deal with casting rules).

--  Gregory Stark EnterpriseDB          http://www.enterprisedb.com Get trained by Bruce Momjian - ask me about
EnterpriseDB'sPostgreSQL training!
 


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Do we really want to migrate plproxy and citext into PG core distribution?
Next
From: Tom Lane
Date:
Subject: Re: WITH RECUSIVE patches 0723