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 29975.1018995889@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:
> Wow, I am completely at a loss why you would not allow implicit coercions
> that do not loose any data in the process. 

Haven't you read the previous threads?  Implicit coercions are
dangerous, because they cause the system to resolve operators in
unexpected ways.  See, eg, bug #484:
http://archives.postgresql.org/pgsql-bugs/2001-10/msg00103.php
http://archives.postgresql.org/pgsql-bugs/2001-10/msg00108.php

I'm not by any means opposed to *all* implicit coercions, but
cross-type-category ones strike me as bad news.

In particular, if all datatypes have implicit coercions to text then
type checking is pretty much a thing of the past :-( ... the system will
be able to resolve nearly anything by interpreting it as a text
operation.  See above bug.

I suspect you are going to argue that you are prepared to live with such
misbehavior because it's too darn convenient not to have to write
::text.  Well, maybe that is indeed the community consensus, but I want
to see a discussion about it first.  And in any case I want a fairly
well-defined, circumscribed policy about which implicit coercions we
will have.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: [PATCHES] WITH DELIMITERS in COPY
Next
From: Peter Eisentraut
Date:
Subject: Re: Operators and schemas