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