"Decibel!" <[EMAIL PROTECTED]> 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's PostgreSQL 
training!

-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

Reply via email to