Re: Fwd: SELECT MAX with char => BUG?

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Fwd: SELECT MAX with char => BUG?
Дата
Msg-id 21503.1100969727@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Fwd: SELECT MAX with char => BUG?  (Rodrigo Carvalhaes <grupos@carvalhaes.net>)
Список pgsql-hackers
Rodrigo Carvalhaes <grupos@carvalhaes.net> writes:
> My problem is the "select max(id) FROM test" the result is 20 but the 
> right is 1020. Is this a BUG or I am crazy ??

You seem to be confused about the difference between numbers and
character strings.  max() on a char(n) column returns the
lexicographically largest item.
        regards, tom lane


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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: New compile warnings
Следующее
От: "Brusser, Michael"
Дата:
Сообщение: Re: Relation does not exist