Re: Prefered Types

Поиск
Список
Период
Сортировка
От Robert Haas
Тема Re: Prefered Types
Дата
Msg-id AANLkTiksFb7J6j3WstPeFSAX0S0sdRsYC0apQ4OY6wQ2@mail.gmail.com
обсуждение исходный текст
Ответ на Prefered Types  (Zotov <zotov@oe-it.ru>)
Ответы Re: Prefered Types  (Zotov <zotov@oe-it.ru>)
Список pgsql-hackers
On Thu, Mar 10, 2011 at 8:12 AM, Zotov <zotov@oe-it.ru> wrote:
> Hello, i  have an old system where used implicit casting
> float<->integer
> numeric<->float
> numeric<->integer
>
> I want define implicit casts, but postgresql don`t know cast priority
> now postgresql have PREFERRED flag, but only flag
> I can`t define prefer level like
> Integer=0
> Numeric=1
> Float=2
> Maybe
> text = 2 or 3
> and other to define My prefer cast more detail than just flag
> i understand what it more dificult tuning, but more flexible
> now i can only create duplicate operators like
> numeric+integer, integer+numeric, integer>numeric.... and many other
> What can i do? Can i wait for prefer flag changed to prefer level?

Interestingly, I've also had the thought that it might make sense to
change typispreferred to an integer typpreference.  But I'm not sure
we actually have any consensus on that point, and it probably wouldn't
happen until 9.2 at the earliest, so you're probably best off finding
some other way to attack the problem.  It's not going to help with
text vs. integer/float/numeric anyway, I think, because they have
different typcategory values.  The whole typcategory system seems a
little wonky to me, actually...

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company


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

Предыдущее
От: Bruce Momjian
Дата:
Сообщение: Re: Add support for logging the current role
Следующее
От: Robert Haas
Дата:
Сообщение: Re: Sync Rep v19