Re: Fwd: SELECT MAX with char => BUG? - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Fwd: SELECT MAX with char => BUG?
Date
Msg-id 21503.1100969727@sss.pgh.pa.us
Whole thread Raw
In response to Fwd: SELECT MAX with char => BUG?  (Rodrigo Carvalhaes <grupos@carvalhaes.net>)
List 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 by date:

Previous
From: Tom Lane
Date:
Subject: Re: New compile warnings
Next
From: "Brusser, Michael"
Date:
Subject: Re: Relation does not exist