<tt>JT Kirkpatrick ha scritto:</tt><blockquote type="CITE"><tt>I'm trying to do an update query that compares an int4
fieldto a variable</tt><br /><tt>which I think contains a string (it was passed in through cgi.pm). can I</tt><br
/><tt>convertthat string to an integer? - it will always be a number passing</tt><br /><tt>through. I vaguely remember
oraclehaving a to_number function - does</tt><br /><tt>postgres have something
similar?</tt><tt></tt><p><tt>jt</tt></blockquote><tt>Trythis:</tt><tt></tt><p><tt>prova=> create table test(t text,
iinteger);</tt><br /><tt>CREATE</tt><tt></tt><p><tt>prova=> insert into test values('123',123);</tt><br /><tt>INSERT
645791</tt><tt></tt><p><tt>prova=> select cast(i as text),cast(t as int)from test;</tt><br /><tt>text|int4</tt><br
/><tt>----+----</tt><br/><tt> 123| 123</tt><br /><tt>(1 row)</tt><p>José <br />