Re: BUG #2905: min and max return incorrect text type

From: Adriaan van Os <postgres(at)microbizz(dot)nl>
To: Peter Eisentraut <peter_e(at)gmx(dot)net>
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #2905: min and max return incorrect text type
Date: 2007-01-21 13:42:37
Message-ID: 45B36DCD.8030409@microbizz.nl
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Bruce Momjian 2007-01-21 14:43:53 Re: BUG #2905: min and max return incorrect text type
Previous Message Peter Eisentraut 2007-01-21 12:32:37 Re: BUG #2905: min and max return incorrect text type