Tom Lane wrote:Oooh, I'd be so happy to. But I don't know. Yes, I don't know.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 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. |
Re: [SQL] casting character varying to integer - order by numeric
Bryce Nesbitt (mailing list account) Thu, 20 Oct 2005 00:00:07 -0700
- Re: [SQL] casting character varying t... Bryce Nesbitt (mailing list account)
- Re: [SQL] casting character vary... Richard Huxton
- Re: [SQL] casting character ... Bryce Nesbitt (mailing list account)