On Thu, Mar 10, 2011 at 8:12 AM, Zotov <zo...@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 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers