Re: isnumeric - checking if text variable is convertable to numeric

From: "Jaime Casanova" <systemguards(at)gmail(dot)com>
To: SunWuKung <Balazs(dot)Klein(at)t-online(dot)hu>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: isnumeric - checking if text variable is convertable to numeric
Date: 2006-04-25 04:16:03
Message-ID: c2d9e70e0604242116j49bd4c8crde68026d1f83015e@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 24 Apr 2006 12:49:51 -0700, SunWuKung <Balazs(dot)Klein(at)t-online(dot)hu> wrote:
> I was trying to actually do a cast and trap the error but (beside not
> having succeeded in doing so) this is a much nicer way.
>
> Thanks.
> Balázs
>
>

in 8.1 you can use exception blocks

BEGIN
statements
EXCEPTION
WHEN condition [ OR condition ... ] THEN
handler_statements
[ WHEN condition [ OR condition ... ] THEN
handler_statements
... ]
END;

http://www.postgresql.org/docs/8.1/static/plpgsql-control-structures.html#PLPGSQL-ERROR-TRAPPING

--
regards,
Jaime Casanova

"What they (MySQL) lose in usability, they gain back in benchmarks, and that's
all that matters: getting the wrong answer really fast."
Randal L. Schwartz

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Luckys 2006-04-25 05:30:00 Re: to know
Previous Message Tom Lane 2006-04-25 04:02:56 Re: [GENERAL] Concurrency problem building indexes