
> Thus, for example, int4 to float8 seems like an okay implicit
coercion,
> but not int4 to text.

int4 to text is imho one of the most important implicit coercions of
all.
Still, a field to mark an implicit coercion function is probably a good
thing. 

Imho a numeric to text implicit coercion would also be great :-) 

I come from a db where all coercions are possible implicitly,
this has not been a problem as long as there is a way to overrule.

Andreas

Thu, 22 Nov 2001 14:23:36 +0100
"Zeugswetter Andreas SB SD" <ZeugswetterA@spardat.at>
Re: Implicit coercions need to be reined in
"Zeugswetter Andreas SB SD" <ZeugswetterA@spardat.at> writes:
> I come from a db where all coercions are possible implicitly,
> this has not been a problem as long as there is a way to overrule.

Yeah, but how rich was its type structure compared to Postgres'?

It might indeed be safe/reasonable to allow implicit coercions to
text from all other types.  I'm not sure.  I am sure that if any
datatype coercion one could possibly want is available implicitly,
it's going to be very difficult to predict the system's behavior.
In fact, this would probably make the default behavior appear to
have *fewer* automatic coercions not more: anytime there wasn't
an exact type match, the parser would have too many alternatives
and would be unable to select a unique function or operator candidate
from among those it could reach by means of implicit coercions.
We've seen some reports of such problems already, and it'll get worse
as we add implicit coercions.

Of course, you could always turn on the "can be implicit coercion"
flag for whichever pg_proc entries you really wanted ...

			regards, tom lane

Thu, 22 Nov 2001 11:46:50 -0500
Tom Lane <tgl@sss.pgh.pa.us>
Re: Implicit coercions need to be reined in 