Re: Implicit coercions need to be reined in

From: Thomas Lockhart <thomas(at)fourpalms(dot)org>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Zeugswetter Andreas SB SD <ZeugswetterA(at)spardat(dot)at>, Thomas Lockhart <lockhart(at)fourpalms(dot)org>, Barry Lind <barry(at)xythos(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Implicit coercions need to be reined in
Date: 2002-04-17 15:09:27
Message-ID: 3CBD9027.EEC27E93@fourpalms.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Michael Loftis 2002-04-17 15:11:18 Re: Index Scans become Seq Scans after VACUUM ANALYSE
Previous Message Thomas Lockhart 2002-04-17 15:01:06 Re: Index Scans become Seq Scans after VACUUM ANALYSE