Re: type casting varchar to int

From: Stephan Szabo <sszabo(at)megazone23(dot)bigpanda(dot)com>
To: Hoosain Madhi <MADHIH(at)vodacom(dot)co(dot)za>
Cc: pgsql-general(at)hub(dot)org
Subject: Re: type casting varchar to int
Date: 2000-09-08 15:43:13
Message-ID: Pine.BSF.4.10.10009080840270.98168-100000@megazone23.bigpanda.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general


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(at)bigpanda(dot)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.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Stephan Szabo 2000-09-08 15:47:40 Re: SERIAL type in RULES
Previous Message Pablo Prieto 2000-09-08 15:41:57 Minutes in an interval