Re: Prefered Types

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Alvaro Herrera <alvherre(at)commandprompt(dot)com>
Cc: Зотов Роман <zotov(at)oe-it(dot)ru>, Robert Haas <robertmhaas(at)gmail(dot)com>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Prefered Types
Date: 2011-05-03 19:06:06
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

I wrote:
> Alvaro Herrera <alvherre(at)commandprompt(dot)com> writes:
>> The interesting discussion is what happens next. To me, this is all
>> related to this previous discussion:

> Yeah, there doesn't seem like much point unless we have a clear idea
> what we're going to do with the change.

BTW, it occurs to me to wonder whether, instead of making types be more
or less preferred, we should attack the issue from a different direction
and assign preferred-ness ratings to casts. That seems to be more or
less the direction that Robert was considering in the above-linked
thread. I'm not sure it's better than putting the ratings on types ---
in particular, neither viewpoint seems to offer a really clean answer
about what to do when trying to resolve a multiple-argument function
in which one possible resolution offers a more-preferred conversion for
one argument but a less-preferred conversion for another one. But it's
an alternative we ought to think about before betting all the chips on
generalizing typispreferred.

Personally I've always felt that the typispreferred mechanism was a bit
of a wart; changing it from a bool to an int won't improve that, it'll
just make it a more complicated wart. Casts have already got a
standards-blessed notion that some are more equal than others, so
maybe attaching preferredness ratings to them will be less of a wart.
Not sure about it though.

regards, tom lane

In response to


Browse pgsql-hackers by date

  From Date Subject
Next Message Simon Riggs 2011-05-03 19:21:30 Re: Unlogged tables, persistent kind
Previous Message Dave Page 2011-05-03 18:59:22 Re: A small step towards more organized beta testing