Re: CHECK for 2 FKs to be non equal

From: Alexander Farber <alexander(dot)farber(at)gmail(dot)com>
To:
Cc: pgsql-general <pgsql-general(at)postgresql(dot)org>
Subject: Re: CHECK for 2 FKs to be non equal
Date: 2017-03-11 13:09:23
Message-ID: CAADeyWhAnBmbniSCa+6pr_7hXV4wKFZGcy6F4+aqi0iAuuKSUQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Thank you Alban and Francisco -

On Sat, Mar 11, 2017 at 11:52 AM, Alban Hertroys <haramrae(at)gmail(dot)com> wrote:
>
> > On 11 Mar 2017, at 10:41, Alexander Farber <alexander(dot)farber(at)gmail(dot)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!

In response to

Browse pgsql-general by date

  From Date Subject
Next Message SuperCiccio 2017-03-11 23:55:43 Index using in jsonb query
Previous Message Alban Hertroys 2017-03-11 10:52:27 Re: CHECK for 2 FKs to be non equal