Re: multiple UNIQUE indices for FK

From: Rafal Pietrak <rafal(at)ztk-rp(dot)eu>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: multiple UNIQUE indices for FK
Date: 2016-03-01 07:04:15
Message-ID: 56D53EEF.1050201@ztk-rp.eu
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

W dniu 28.02.2016 o 03:35, David G. Johnston pisze:
> W dniu 23.02.2016 o 09:39, Rafal Pietrak pisze:
> > Can anybody suggest any other way out of this mass?
>
>
> ​The only thought that sticks while reading your prose is:​
>
> ​message ----> message-person <---- person​
>
>
> ​message-person (message_id, person_id, relationship_type[sender, receiver])

It just occured to me: how do I make sure (e.g. force within a database)
with the above structure, that a message can have *only one* sender?
but, allow for multiple recepients?

-R

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Sridhar N Bamandlapally 2016-03-01 10:07:13 Rules on View
Previous Message David G. Johnston 2016-03-01 01:23:39 Re: Function fixing - PostgreSQL 9.2