Re: casting character varying to integer - order by numeric - Mailing list pgsql-sql

From Bryce Nesbitt (mailing list account)
Subject Re: casting character varying to integer - order by numeric
Date
Msg-id 43573FCE.7070301@obviously.com
Whole thread Raw
In response to Re: casting character varying to integer - order by numeric sort  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: casting character varying to integer - order by numeric  (Richard Huxton <dev@archonet.com>)
List pgsql-sql
Tom Lane wrote:<br /><blockquote cite="mid3687.1129779194@sss.pgh.pa.us" type="cite"><blockquote type="cite"><pre
wrap="">Butpostgres 7 rejects this with "ERROR:  cannot cast type character 
 
varying to integer".   </pre></blockquote><pre wrap="">
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 </pre></blockquote> Oooh, I'd be so happy to.  But I don't know.  Yes, I don't know.<br /><br
/>I know which version of "psql" is installed on my local machine, but the actual database is remote.  Is there a 
commandto get the server version?  As close as I can find is:<br /><br /> stage=> \copyright<br /> PostgreSQL Data
BaseManagement System<br /><br /> Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group<br /><br /><br
/>             -Bryce<br /><br /> PS: If it's a hint, "select username from eg_member order by username::text::integer"
worksfine.  Thanks.<br /> 

pgsql-sql by date:

Previous
From: Tom Lane
Date:
Subject: Re: casting character varying to integer - order by numeric sort
Next
From: Richard Huxton
Date:
Subject: Re: casting character varying to integer - order by numeric