"Decibel!" <decibel(at)decibel(dot)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).
Get trained by Bruce Momjian - ask me about EnterpriseDB's PostgreSQL training!
In response to
pgsql-hackers by date
|Next:||From: Tom Lane||Date: 2008-07-28 23:04:14|
|Subject: Re: WITH RECUSIVE patches 0723 |
|Previous:||From: Tom Lane||Date: 2008-07-28 22:48:24|
|Subject: Re: Do we really want to migrate plproxy and citext into PG core distribution? |