Tom Lane wrote:
But postgres 7 rejects this with "ERROR:  cannot cast type character 
varying to integer".
    

As a general rule, you need to be more specific than that about which
version you are working with ;-)

You may find that username::text::integer will work, depending on which
7.x this actually is.

			regards, tom lane
  
Oooh, I'd be so happy to.  But I don't know.  Yes, I don't know.

I know which version of "psql" is installed on my local machine, but the actual database is remote.  Is there a  command to get the server version?  As close as I can find is:

stage=> \copyright
PostgreSQL Data Base Management System

Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group


             -Bryce

PS: If it's a hint, "select username from eg_member order by username::text::integer" works fine.  Thanks.