Re: Implicit coercions need to be reined in - Mailing list pgsql-hackers

From Thomas Lockhart
Subject Re: Implicit coercions need to be reined in
Date
Msg-id 3CBD9027.EEC27E93@fourpalms.org
Whole thread Raw
In response to Re: Implicit coercions need to be reined in  ("Zeugswetter Andreas SB SD" <ZeugswetterA@spardat.at>)
List pgsql-hackers
...
> Could we do anything based on looking at the whole set of candidate
> operators?  For example, I think that the reason "apples || oranges"
> is so appealing is that there really is only one way to interpret
> the || operator; whereas of course there are lots of different <=
> operators.  Perhaps we could be more forgiving of implicit coercions
> when there are fewer candidate operators, in some way?  Again, something
> based on type categories would make sense to me.  Perhaps allow
> cross-category implicit coercions only if there are no candidate
> operators accepting the input's native category?

Hmm. That might be a winner. Since everything can be turned into text,
there will always be a fallback to text available. Allow it for
operators which are text-only operators (are there any built in besides
"||"?) and disallow that fallback for the others?

One edge case which we are probably concerned about is the "typeless
literal". I'd guess that we make the right choice in *most* cases
already.

I guess I'm worried that we may be cutting back on the allowed implicit
coersions, when we might really be missing only one or two explicit
coersion functions to fill in the set. I haven't looked at that in a
while...
                  - Thomas


pgsql-hackers by date:

Previous
From: "Christopher Kings-Lynne"
Date:
Subject: Re: Index Scans become Seq Scans after VACUUM ANALYSE
Next
From: Michael Loftis
Date:
Subject: Re: Index Scans become Seq Scans after VACUUM ANALYSE