Re: ERROR: check constraint - PostgreSQL 9.2

From: Vick Khera <vivek(at)khera(dot)org>
To: "drum(dot)lucas(at)gmail(dot)com" <drum(dot)lucas(at)gmail(dot)com>
Cc: Postgres General <pgsql-general(at)postgresql(dot)org>
Subject: Re: ERROR: check constraint - PostgreSQL 9.2
Date: 2016-01-29 15:33:40
Message-ID: CALd+dceQYNXm45RuhoESL2BzSbfwwEK=PiFco43-bauq5Ng=DQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Sun, Jan 24, 2016 at 11:12 PM, drum(dot)lucas(at)gmail(dot)com
<drum(dot)lucas(at)gmail(dot)com> wrote:
> So, I made a SELECT to get some data, to see where's the issue:
>
> SELECT * FROM integrations.accounts WHERE qb_settings IS NULL OR
> xero_settings IS NULL OR freshbooks_settings IS NULL OR myob_settings IS
> NULL OR ppy_settings IS NULL;

If you have a check constraint X, and you want to find all the rows
that are currently NOT X, you are using the wrong query here. You need
to AND your parts together. Look up DeMorgan's laws for boolean logic.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Achilleas Mantzios 2016-01-29 15:39:35 Re: BSD initdb without ICU support and switch later
Previous Message David G. Johnston 2016-01-29 15:32:19 Re: Request - repeat value of \pset title during \watch interations