Thread: type casting varchar to int

type casting varchar to int

From
Hoosain Madhi
Date:
Is it possible to type cast from varchar to int? Postgres backend complains
when I try to do this.

Hoosain Madhi
Switching Engineering
VODACOM CORPORATE PARK
Tel    :    +27 11 653 5030
Fax    :    +27 11 653 5941


Re: type casting varchar to int

From
Stephan Szabo
Date:
You can make an intermediate step through text
<colume>::text::int

However, it'll fail if there are any values it cannot
turn into an integer (with an elog) which may not
be what you want.

Stephan Szabo
sszabo@bigpanda.com

On Fri, 8 Sep 2000, Hoosain Madhi wrote:

> Is it possible to type cast from varchar to int? Postgres backend complains
> when I try to do this.