From: | Tino Wildenhain <tino(at)wildenhain(dot)de> |
---|---|
To: | Assad Jarrahian <jarraa(at)gmail(dot)com> |
Cc: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, pgsql-general(at)postgresql(dot)org |
Subject: | Re: sql (Stored procedure) design question |
Date: | 2006-01-12 15:03:51 |
Message-ID: | 43C66FD7.7040907@wildenhain.de |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | 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? ...
From | Date | Subject | |
---|---|---|---|
Next Message | Joshua D. Drake | 2006-01-12 16:23:27 | Re: Plans for 8.2? |
Previous Message | Kai Hessing | 2006-01-12 14:55:40 | Problem with restoring database from 7.3.1 to 8.0.1 |