Re: BUG #2905: min and max return incorrect text type - Mailing list pgsql-bugs

From Adriaan van Os
Subject Re: BUG #2905: min and max return incorrect text type
Date
Msg-id 45B36DCD.8030409@microbizz.nl
Whole thread Raw
In response to Re: BUG #2905: min and max return incorrect text type  (Peter Eisentraut <peter_e@gmx.net>)
List pgsql-bugs
Peter Eisentraut wrote:
> Adriaan van Os wrote:
>>>> However, min(VARCHAROID) and max(VARCHAROID) return TEXTOID as a
>>>> result type.
>>> Yea, they are internally treated as very similar types.
>> But "internally treated as very similar" is still not "same as
>> argument type". Computing requires exactness.
>
> Aside from the apparent discrepancy between the documentation and the
> actual behavior, is there an actual use case where this is a problem?

Dijkstra's "Rule 0: Don’t Make a Mess of It” <http://www.cs.utexas.edu/users/EWD/> and the virtues
of strong typing, which, for SQL, imply checks at runtime <http://en.wikipedia.org/wiki/Type_safety>.

Besides, the question is absurd. I stumble over a stone on the road, report it and then you ask "is
there an actual use case where this is a problem". Why else do I report it ? What you probably
wanted to ask is: "Apart from the missing warning along the road, couldn't you have walked around
that stone ?"

Well, in answer to that last question, I could have, but that is the wrong approach to computing.

Regards,

Adriaan van Os

pgsql-bugs by date:

Previous
From: "prasad mahit"
Date:
Subject: BUG #2916: SELECT query has no destination for result data
Next
From: Tom Lane
Date:
Subject: Re: BUG #2914: SELECT query has no destination for result data