From: Bryce Nesbitt (mailing list account) <bryce1@obviously.com>
To: pgsql-sql@postgresql.org
Subject: Re: casting character varying to integer - order by numeric
Date: Wed, 19 Oct 2005 23:57:18 -0700
Message-ID: <43573FCE.7070301@obviously.com> (raw)
In-Reply-To: <3687.1129779194@sss.pgh.pa.us>
References: <4356EC5D.4080706@obviously.com>
<3687.1129779194@sss.pgh.pa.us>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
<title></title>
</head>
<body bgcolor="#ffffff" text="#000000">
Tom Lane wrote:<br>
<blockquote cite="mid3687.1129779194@sss.pgh.pa.us" type="cite">
<blockquote type="cite">
<pre wrap="">But postgres 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 command to get the server
version? As close as I can find is:<br>
<br>
stage=> \copyright<br>
PostgreSQL Data Base Management 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" works fine. Thanks.<br>
</body>
</html>
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-sql@postgresql.org
Cc: bryce1@obviously.com
Subject: Re: casting character varying to integer - order by numeric
In-Reply-To: <43573FCE.7070301@obviously.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox