Re: MySQL search query is not executing in Postgres DB

Поиск
Список
Период
Сортировка
От Jim Nasby
Тема Re: MySQL search query is not executing in Postgres DB
Дата
Msg-id 503D028C.2070409@nasby.net
обсуждение исходный текст
Ответ на Re: MySQL search query is not executing in Postgres DB  ("Greg Sabino Mullane" <greg@turnstep.com>)
Список pgsql-hackers
On 8/27/12 5:19 PM, Greg Sabino Mullane wrote:
> Tom Lane replied:
>>>> >>>Come on, really?  Note that the above example works without casts if
>>>> >>>you use int*or*  bigint*or*  numeric, but not smallint.  That could be
>>>> >>>fixed by causing sufficiently-small integers to lex as smallints,
>>> >>Is there any general interest in adjusting smallint casting?
> ...
>> >It's conceivable that a change in the lexer behavior combined with a
>> >massive reorganization of the integer-related operators would bring us
>> >to a nicer place than where we are now.  But it'd be a lot of work for
>> >dubious reward, and it would almost certainly generate a pile of
>> >application compatibility problems.
> Okay, but what about a more targeted solution to the original
> poster's problem? That seems doable without causing major
> breakage elsewhere....

FWIW, this causes problems for me at work as well.

For the case of
 const op const

instead of trying to small-cast the 2 constants, would it be possible to large-cast them, perform the operation, and
thenre-cast the results of the operation? ISTM that would solve the operator issue (ie, the case of 20000+20000).
 
-- 
Jim C. Nasby, Database Architect                   jim@nasby.net
512.569.9461 (cell)                         http://jim.nasby.net



В списке pgsql-hackers по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: MySQL search query is not executing in Postgres DB
Следующее
От: Tom Lane
Дата:
Сообщение: Re: "default deny" for roles