Re: casting character varying to integer - order by numeric
От | Bryce Nesbitt (mailing list account) |
---|---|
Тема | Re: casting character varying to integer - order by numeric |
Дата | |
Msg-id | 43573FCE.7070301@obviously.com обсуждение исходный текст |
Ответ на | Re: casting character varying to integer - order by numeric sort (Tom Lane <tgl@sss.pgh.pa.us>) |
Ответы |
Re: casting character varying to integer - order by numeric
|
Список | 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 по дате отправления: