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

Поиск
Список
Период
Сортировка
От Alvaro Herrera
Тема Re: BUG #2905: min and max return incorrect text type
Дата
Msg-id 20070123200435.GI26006@alvh.no-ip.org
обсуждение исходный текст
Ответ на Re: BUG #2905: min and max return incorrect text type  (Adriaan van Os <postgres@microbizz.nl>)
Ответы Re: BUG #2905: min and max return incorrect text type  (Bruce Momjian <bruce@momjian.us>)
Список pgsql-bugs
Adriaan van Os wrote:
> Tom Lane wrote:
> >Bruce Momjian <bruce@momjian.us> writes:
> >>Peter Eisentraut wrote:
> >>>Aside from the apparent discrepancy between the documentation and the
> >>>actual behavior, is there an actual use case where this is a problem?
> >
> >>No, I don't think so, and I am reluctant to adjust the documentation to
> >>say "or similar".
> >
> >The documentation is correct as it stands: max(text) returns text.
> >Adriaan's complaint about max(varchar) is off base because there is
> >no such function.
>
> No, the documentation says that the Argument Type of max and min can be
> "any array, numeric, string, or date/time type" and that the Return type is
> the "same as argument type". The functions min and max applied to a field
> of type varchar return a function result of type text. So, if a
> max(varchar) function is missing and the cause of the text result type is
> implicit type casting, then the fact that there is no max(varchar) function
> is exactly the bug.

Do you have a specific situation on which this causes a problem for you?
I mean, are you asking because it really bugs you, or just for the sake
of being pedantic?

--
Alvaro Herrera       Valdivia, Chile   ICBM: S 39º 49' 18.1", W 73º 13' 56.4"
Tulio: oh, para qué servirá este boton, Juan Carlos?
Policarpo: No, aléjense, no toquen la consola!
Juan Carlos: Lo apretaré una y otra vez.

В списке pgsql-bugs по дате отправления:

Предыдущее
От: Adriaan van Os
Дата:
Сообщение: Re: BUG #2905: min and max return incorrect text type
Следующее
От: Bruce Momjian
Дата:
Сообщение: Re: BUG #2905: min and max return incorrect text type