Cast Problem

From: <operationsengineer1(at)yahoo(dot)com>
To: pgsql-novice(at)postgresql(dot)org
Subject: Cast Problem
Date: 2005-08-11 18:50:02
Message-ID: 20050811185002.4043.qmail@web33303.mail.mud.yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

i do a sort by serial number. in order to sort the
way i want, i need to cast serial_number (type text)
as an integer.

... ORDER By serial_number::integer ASC;

this works great in pgsql 7.4.x (whatever i'm using on
my dev box, i think 7.4.3, but not sure), but it
doesn't work in pgsql 7.3.9.

it doesn't allow the query to complete and i
eventually get a "non object" error.

is there someting equivalent to the above line that
will work in 7.3.9?

i know, these are old versions of pgsql. we are going
to bring the db in house and i will start working the
latest and greatest pgsql and php shortly. until
then, though, i'd like to display my serial numbers in
a manner that looks nice to the user (iow, "10" won't
come before "2").

as always, tia.


__________________________________
Yahoo! Mail
Stay connected, organized, and protected. Take the tour:
http://tour.mail.yahoo.com/mailtour.html

In response to

Responses

Browse pgsql-novice by date

  From Date Subject
Next Message Michael Fuhr 2005-08-11 19:52:17 Re: Cast Problem
Previous Message Walker, Jed S 2005-08-11 17:42:28 Re: Forcing WAL switch