Re: sql (Stored procedure) design question - Mailing list pgsql-general

From Tino Wildenhain
Subject Re: sql (Stored procedure) design question
Date
Msg-id 43C66FD7.7040907@wildenhain.de
Whole thread Raw
In response to Re: sql (Stored procedure) design question  (Assad Jarrahian <jarraa@gmail.com>)
Responses Re: sql (Stored procedure) design question
List pgsql-general
Assad Jarrahian schrieb:
> Tino, thanks for your response
>
>>Your schema could rather look like this:
>>
>>documentid,username,groupname  (as real fields)
>>
>
>
> Okay, so a typical document can be addressed to any number of users/groups.  so
> according to an example with the to field = 'jarraa, postgres, keith',
> some rows could be like
>
> (1, jarraa, )
> (1,  , postgres)
> (1, keith, )
>

No, it would look like this:

(1,'jarraa','postgres','keith') to match your original schema.

But it really depends on what you want to solve here.
What data exactly do you have and how do you want to look
for data? I mean, what are the keys?

Do you have a specific "group" and want to see all "docs" for
that group? And then you have a user and want to see all "docs"
for this user? Or is it the other way round and you have
a "doc" and want to see responsible users and/or groups?
And are groups independend from users? Or are users always
in one or many groups? ...


pgsql-general by date:

Previous
From: SunWuKung
Date:
Subject: Re: select into multiple variables
Next
From: "Mikael Carneholm"
Date:
Subject: Plans for 8.2?