Re: Modeling Friendship Relationships - Mailing list pgsql-general

From John R Pierce
Subject Re: Modeling Friendship Relationships
Date
Msg-id 5462B9E0.9040703@hogranch.com
Whole thread Raw
In response to Re: Modeling Friendship Relationships  (David G Johnston <david.g.johnston@gmail.com>)
List pgsql-general
On 11/11/2014 5:32 PM, David G Johnston wrote:
> Bill's solution:
>
>   PRIMARY KEY (person1, person2),
>   CHECK (person1 < person2)
>
> seems to make this constraint fairly simple...am I missing something?

oh, I guess I missed that part.   of course, you'll have to make sure
you swap any relation into lesser,greater before inserting into this
table, but such is life.    I suppose a insert trigger could force this.




--
john r pierce                                      37N 122W
somewhere on the middle of the left coast



pgsql-general by date:

Previous
From: David G Johnston
Date:
Subject: Re: Modeling Friendship Relationships
Next
From: Benjamin Scherrey
Date:
Subject: Using bdr replication with SERIAL pseudo-type.