Search Postgresql Archives

Re: Check constraints do not seem to be working!!!

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Thanks Nikolay

I read that but is there a way to meet the above requirement. And I will like to add that IS NULL and IS NOT NULL should evaluate to true/false. These operators are made for this and should not be returning NULL.

Regards,
Jitendra

On Wed 11 Nov, 2020, 14:18 Nikolay Samokhvalov, <samokhvalov@xxxxxxxxx> wrote:
On Wed, Nov 11, 2020 at 12:26 AM Jitendra Loyal <jitendra.loyal@xxxxxxxxx> wrote:
Despite the above two constraints, the following rows get into the table:
     insert into t (b , c) values (null, true), (null, false);  


> It should be noted that a check constraint is satisfied if the check _expression_ evaluates to true or the null value. Since most expressions will evaluate to the null value if any operand is null, they will not prevent null values in the constrained columns. To ensure that a column does not contain null values, the not-null constraint described in the next section can be used.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]

  Powered by Linux