Re: Domains as Subtypes

Поиск
Список
Период
Сортировка
От elein
Тема Re: Domains as Subtypes
Дата
Msg-id 20060325001053.GG15165@varlena.com
обсуждение исходный текст
Ответ на Re: Domains as Subtypes  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
On Fri, Mar 24, 2006 at 06:27:13PM -0500, Tom Lane wrote:
> elein <elein@varlena.com> writes:
> > Operators have the single distinction from functions in that when one argument
> > has an unknown type, then an exact match is tried with the unknown arg
> > type set to the known type.  This code has always been in there.
> 
> Yeah, but it's just a fast special case of the generic UNKNOWN handling
> in func_select_candidate.  The domain special case in binary_oper_exact
> is a wart --- ideally it should be excised not enlarged ;-).  It's
> mainly there because we didn't want to complicate func_select_candidate
> to deal with domains.  If you're going to do the latter anyway, it may
> be possible to remove the domain special case in binary_oper_exact.

OK.  I'll see what I can do.

> 
> In any case, the patch is very poorly thought through: it will not
> behave reasonably if there are multiple levels of domains with different
> candidate operators attached to each domain.  (I can tell you have not
> tested this: getBaseType drills all the way down, so mk_oper_arg_list
> isn't doing what you think.)  

I did test this. But maybe not deep enough :(

> You need some kind of policy as to which
> candidate is more preferable if some are "closer" types on one input and
> some are "closer" on another, and binary_oper_exact is not the place for
> that kind of decision.  

This policy was my intent, however, it need not be in binary_oper_exact.

> It's only supposed to be a fast short-circuit
> for the cases of exact matches and exact-after-substituting-other-type-
> for-UNKNOWN matches.  

OK.
> If you make it do more you'll be upsetting some
> careful compromises in the type resolution rules.

If you know of any cases that are not tested in regression let me
know and I'll include them in my test cases.  So far, I have 
broken nothing that I know about. (Well, maybe during development
I, like, broke everything, but that was fixed :)

OK.  Back to the code in the func sel context.

> 
>             regards, tom lane
> 
> ---------------------------(end of broadcast)---------------------------
> TIP 2: Don't 'kill -9' the postmaster
> 

elein
elein@varlena.com


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

Предыдущее
От: Stephen Frost
Дата:
Сообщение: Re: Role incompatibilities
Следующее
От: Josh Berkus
Дата:
Сообщение: Re: Domains as Subtypes