John R Pierce wrote > a difficulty of the single entry for joe<->bob is that its hard to have > a unique constraint across two fields. you'd want to ensure that > joe+bob is unique and that there's no bob+joe Bill's solution: PRIMARY KEY (person1, person2), CHECK (person1 < person2) seems to make this constraint fairly simple...am I missing something? Usage need permitting how difficult would setting up materialized views to maintain arrays of "friend_of" and "friends_are" and simply unnest those arrays if record-oriented access to the contained ids is required? More basically how performant (generally) are ~200 element arrays? David J. -- View this message in context: http://postgresql.nabble.com/Modeling-Friendship-Relationships-tp5826592p5826608.html Sent from the PostgreSQL - general mailing list archive at Nabble.com. -- Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general