Re: SQL state: 22P02 - Mailing list pgsql-sql

From Rodrigo De León
Subject Re: SQL state: 22P02
Date
Msg-id a55915760711220806gb77d638wc68cb853e8c3013@mail.gmail.com
Whole thread Raw
In response to SQL state: 22P02  (Franklin Haut <franklin.haut@gmail.com>)
List pgsql-sql
On Nov 22, 2007 11:24 AM, Franklin Haut <franklin.haut@gmail.com> wrote:
>    num      return
>    ----     ------
>    0         0
>    null      false
>    12        12
>    a         false
>    12ab      false
>
>  it´s possible get these results ?

Try:

SELECT   NUM , CASE     WHEN TRIM(NUM) ~ '^[0-9]+(.[0-9]+){0,1}$'     THEN NUM     ELSE 'false'   END AS RETURN
FROM TEST;

pgsql-sql by date:

Previous
From: Franklin Haut
Date:
Subject: SQL state: 22P02
Next
From: Martin Marques
Date:
Subject: Re: PL argument max size, and doubt