Thread: test CHECK on command line

test CHECK on command line

From
"Jean-Yves F. Barbier"
Date:
Hi list,

I'm trying to test CHECK constraints on command line but I miss something:

SELECT '1234567890123' ~ 'CHECK(char_length(VALUE) = 13)';

always return FALSE :(

JY
--
    "What did you do when the ship sank?"
    "I grabbed a cake of soap and washed myself ashore."

Re: test CHECK on command line

From
Josh Kupershmidt
Date:
On Fri, Jun 17, 2011 at 12:12 AM, Jean-Yves F. Barbier <12ukwn@gmail.com> wrote:
> I'm trying to test CHECK constraints on command line but I miss something:
>
> SELECT '1234567890123' ~ 'CHECK(char_length(VALUE) = 13)';
>
> always return FALSE :(

I would test out that CHECK constraint with something like:
   SELECT some_column FROM table WHERE char_length(some_column) != 13

I'm not sure what's going on with the SELECT statement you posted, but
that doesn't look valid.

Josh