Re: [GENERAL] CHECK for 2 FKs to be non equal - Mailing list pgsql-general

From Alexander Farber
Subject Re: [GENERAL] CHECK for 2 FKs to be non equal
Date
Msg-id CAADeyWhAnBmbniSCa+6pr_7hXV4wKFZGcy6F4+aqi0iAuuKSUQ@mail.gmail.com
Whole thread Raw
In response to Re: [GENERAL] CHECK for 2 FKs to be non equal  (Alban Hertroys <haramrae@gmail.com>)
List pgsql-general
Thank you Alban and Francisco -

On Sat, Mar 11, 2017 at 11:52 AM, Alban Hertroys <haramrae@gmail.com> wrote:
> On 11 Mar 2017, at 10:41, Alexander Farber <alexander.farber@gmail.com> wrote:
>          uid integer NOT NULL REFERENCES words_users(uid) CHECK (uid <> author) ON DELETE CASCADE,


You put your CHECK constraint definition smack in the middle of the FK constraint definition, which starts with REFERENCES and ends with the delete CASCADE.


you are both correct!

pgsql-general by date:

Previous
From: Alban Hertroys
Date:
Subject: Re: [GENERAL] CHECK for 2 FKs to be non equal
Next
From: SuperCiccio
Date:
Subject: [GENERAL] Index using in jsonb query