Re: [RFC] Unsigned integer support.

Поиск
Список
Период
Сортировка
От Gregory Stark
Тема Re: [RFC] Unsigned integer support.
Дата
Msg-id 87fxptsjq3.fsf@oxford.xeocode.com
обсуждение исходный текст
Ответ на Re: [RFC] Unsigned integer support.  (Decibel! <decibel@decibel.org>)
Ответы Re: [RFC] Unsigned integer support.  (Tom Lane <tgl@sss.pgh.pa.us>)
Список 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 по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Do we really want to migrate plproxy and citext into PG core distribution?
Следующее
От: Tom Lane
Дата:
Сообщение: Re: WITH RECUSIVE patches 0723