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

From Tom Lane
Subject Re: Implicit coercions need to be reined in
Date
Msg-id 1221.1006447610@sss.pgh.pa.us
Whole thread Raw
In response to Re: Implicit coercions need to be reined in  ("Zeugswetter Andreas SB SD" <ZeugswetterA@spardat.at>)
List pgsql-hackers
"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


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: OCTET_LENGTH is wrong
Next
From: Brent Verner
Date:
Subject: Re: Can't "EXTRACT" from a field?