Search Postgresql Archives

Re: sql (Stored procedure) design question

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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? ...



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux