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

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: grupos(at)carvalhaes(dot)net
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Fwd: SELECT MAX with char => BUG?
Date: 2004-11-20 16:55:27
Message-ID: 21503.1100969727@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Rodrigo Carvalhaes <grupos(at)carvalhaes(dot)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

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Brusser, Michael 2004-11-20 17:10:32 Re: Relation does not exist
Previous Message Tom Lane 2004-11-20 16:53:31 Re: New compile warnings