Re: Prefered Types

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Zotov <zotov(at)oe-it(dot)ru>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Prefered Types
Date: 2011-03-11 14:01:00
Message-ID: AANLkTiksFb7J6j3WstPeFSAX0S0sdRsYC0apQ4OY6wQ2@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thu, Mar 10, 2011 at 8:12 AM, Zotov <zotov(at)oe-it(dot)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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2011-03-11 14:03:33 Re: Sync Rep v19
Previous Message Bruce Momjian 2011-03-11 13:59:57 Re: Add support for logging the current role