Received: from bologna.nettuno.it (bologna.nettuno.it [193.43.2.1]) by hub.org (8.9.3/8.9.1) with ESMTP id JAA59775 for ; Thu, 22 Apr 1999 09:55:34 -0400 (EDT) (envelope-from jose@sferacarta.com) Received: from proxy.sferacarta.com (mail@sfcabop1.nettuno.it [193.207.10.213]) by bologna.nettuno.it (8.8.6/8.8.6/NETTuno 3.1) with ESMTP id PAA24823; Thu, 22 Apr 1999 15:55:10 +0200 (MDT) Received: from rosso.sferacarta.com (sferacarta.com) [10.20.30.5] by proxy.sferacarta.com with esmtp (Exim 2.05 #1 (Debian)) id 10aKUf-0000oe-00; Thu, 22 Apr 1999 14:30:21 +0000 Message-ID: <371F1644.2B73C65C@sferacarta.com> Date: Thu, 22 Apr 1999 14:29:56 +0200 From: =?iso-8859-1?Q?Jos=E9?= Soares X-Mailer: Mozilla 4.5 [it] (Win95; I) X-Accept-Language: it MIME-Version: 1.0 To: JT Kirkpatrick CC: "'pgsql-sql@hub.org'" Subject: Re: [SQL] convert text to number or number to text References: <01BE8C04.0A52A9E0.jt-kirkpatrick@mpsllc.com> Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit This should work: select cast('123' as int), cast(123 as text); José JT Kirkpatrick ha scritto: > I'm trying to do an update query that compares an int4 field to a variable > which I think contains a string (it was passed in through cgi.pm). can I > convert that string to an integer? - it will always be a number passing > through. I vaguely remember oracle having a to_number function - does > postgres have something similar? > > jt