Re: isnumeric - checking if text variable is convertable to numeric - Mailing list pgsql-general

From Jaime Casanova
Subject Re: isnumeric - checking if text variable is convertable to numeric
Date
Msg-id c2d9e70e0604242116j49bd4c8crde68026d1f83015e@mail.gmail.com
Whole thread Raw
In response to Re: isnumeric - checking if text variable is convertable to numeric  ("SunWuKung" <Balazs.Klein@t-online.hu>)
Responses Re: isnumeric - checking if text variable is convertable to numeric  ("SunWuKung" <Balazs.Klein@t-online.hu>)
List pgsql-general
On 24 Apr 2006 12:49:51 -0700, SunWuKung <Balazs.Klein@t-online.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

pgsql-general by date:

Previous
From: Christopher Browne
Date:
Subject: Re: How to have a blind-superuser
Next
From: Luckys
Date:
Subject: Re: to know