Re: ERROR: check constraint - PostgreSQL 9.2 - Mailing list pgsql-general

From Vick Khera
Subject Re: ERROR: check constraint - PostgreSQL 9.2
Date
Msg-id CALd+dceQYNXm45RuhoESL2BzSbfwwEK=PiFco43-bauq5Ng=DQ@mail.gmail.com
Whole thread Raw
In response to ERROR: check constraint - PostgreSQL 9.2  ("drum.lucas@gmail.com" <drum.lucas@gmail.com>)
List pgsql-general
On Sun, Jan 24, 2016 at 11:12 PM, drum.lucas@gmail.com
<drum.lucas@gmail.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.


pgsql-general by date:

Previous
From: "David G. Johnston"
Date:
Subject: Re: Request - repeat value of \pset title during \watch interations
Next
From: Achilleas Mantzios
Date:
Subject: Re: BSD initdb without ICU support and switch later