Re: Why is a check constraint not working ?

From: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
To: David Gauthier <davegauthierpg(at)gmail(dot)com>
Cc: Postgres General <pgsql-general(at)postgresql(dot)org>
Subject: Re: Why is a check constraint not working ?
Date: 2020-04-29 15:19:53
Message-ID: CAKFQuwaYcbZbXQzS74h6ONJPVCKW5Q67ACyTwH5rKB9CuyweBg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Wed, Apr 29, 2020 at 8:17 AM David Gauthier <davegauthierpg(at)gmail(dot)com>
wrote:

>
> Check constraints:
> "dvm_events_status_check" CHECK (status::text = ANY
> (ARRAY['passed'::character varying, 'failed'::character varying,
> NULL::character varying]::text[]))
>
>
> What could cause this ?
>

NULL in the array.

"status = NULL" yields NULL which is a pass for a check constraint.

David J.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Don Seiler 2020-04-29 20:10:37 Re: Mixed Locales and Upgrading
Previous Message David Gauthier 2020-04-29 15:17:40 Why is a check constraint not working ?