Re: test CHECK on command line

From: Josh Kupershmidt <schmiddy(at)gmail(dot)com>
To: "Jean-Yves F(dot) Barbier" <12ukwn(at)gmail(dot)com>
Cc: pgsql-novice(at)postgresql(dot)org
Subject: Re: test CHECK on command line
Date: 2011-06-21 21:51:31
Message-ID: BANLkTi=FLjzmZ-ezHoucCaxsGK0iXapztQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

On Fri, Jun 17, 2011 at 12:12 AM, Jean-Yves F. Barbier <12ukwn(at)gmail(dot)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

In response to

Browse pgsql-novice by date

  From Date Subject
Next Message Leon Starr 2011-06-22 04:13:03 How to trap error: nextval: reached maximum value of sequence
Previous Message Josh Kupershmidt 2011-06-21 21:48:08 Re: change p/w hashing