Re: [GENERAL] CHECK for 2 FKs to be non equal

2017-03-11 Thread Alexander Farber
Thank you Alban and Francisco - On Sat, Mar 11, 2017 at 11:52 AM, Alban Hertroys wrote: > > > On 11 Mar 2017, at 10:41, Alexander Farber > wrote: > > uid integer NOT NULL REFERENCES words_users(uid) CHECK (uid <> > author) ON DELETE CASCADE, > > > You put your CHECK constraint definitio

Re: [GENERAL] CHECK for 2 FKs to be non equal

2017-03-11 Thread Alban Hertroys
> On 11 Mar 2017, at 10:41, Alexander Farber wrote: > > uid integer NOT NULL REFERENCES words_users(uid) CHECK (uid <> > author) ON DELETE CASCADE, > but get syntax error in 9.5: > > ERROR: syntax error at or near "ON" > LINE 2: ...REFERENCES words_users(uid) CHECK (uid <> author) O

Re: [GENERAL] CHECK for 2 FKs to be non equal

2017-03-11 Thread Francisco Olarte
Alexander: On Sat, Mar 11, 2017 at 10:41 AM, Alexander Farber wrote: > uid integer NOT NULL REFERENCES words_users(uid) CHECK (uid <> > author) ON DELETE CASCADE, Maybe a stupid question, but have you tried "refereces.. on delete .. check"? I mean, the manual for create table says: >>

[GENERAL] CHECK for 2 FKs to be non equal

2017-03-11 Thread Alexander Farber
Good morning, I am trying to add a table holding player reviews of each other: words=> CREATE TABLE words_reviews ( uid integer NOT NULL REFERENCES words_users(uid) CHECK (uid <> author) ON DELETE CASCADE, author integer NOT NULL REFERENCES words_users(uid) ON DELETE CASCADE,