Re: [GENERAL] sql (Stored procedure) design question

2006-01-14 Thread Assad Jarrahian
So is it still advisable not to store it in a string format like 'jarraa, mooreg3, flowerpower' [read my comments below please] awaiting some feedback. -assad On 1/12/06, Assad Jarrahian <[EMAIL PROTECTED]> wrote: > Alban and Tino, > More explanations lie below. > A document contains to field,

Re: [GENERAL] sql (Stored procedure) design question

2006-01-12 Thread Assad Jarrahian
Alban and Tino, More explanations lie below. A document contains to field, from field, subject, message, etc > >>documentid,username,groupname (as real fields) > No, it would look like this: > > (1,'jarraa','postgres','keith') to match your original schema. I dont understand it. what type would

Re: [GENERAL] sql (Stored procedure) design question

2006-01-12 Thread Tino Wildenhain
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 = 'j

Re: [GENERAL] sql (Stored procedure) design question

2006-01-12 Thread Alban Hertroys
Assad Jarrahian wrote: what drove me to store it that way was more of a performance issue. So if I store a documentID and then have a seperate table names, to_field Why a seperate table? From what you showed us you don't seem to need that. Just use 3 columns for the seperate entries instead o

Re: [GENERAL] sql (Stored procedure) design question

2006-01-12 Thread Assad Jarrahian
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 b

Re: [GENERAL] sql (Stored procedure) design question

2006-01-11 Thread Tino Wildenhain
Assad Jarrahian schrieb: > what drove me to store it that way was more of a performance issue. > > So if I store a documentID and then have a seperate table names, to_field > I will have to store the username/groupname as such > to_field: > documentID username > docuementID groupname > docuementID

Re: [GENERAL] sql (Stored procedure) design question

2006-01-11 Thread Assad Jarrahian
what drove me to store it that way was more of a performance issue. So if I store a documentID and then have a seperate table names, to_field I will have to store the username/groupname as such to_field: documentID username docuementID groupname docuementID usernamename ... based on that it seem

Re: [GENERAL] sql (Stored procedure) design question

2006-01-11 Thread Tom Lane
Assad Jarrahian <[EMAIL PROTECTED]> writes: > A column of type text contains username's and groupname's followed > by comma (eg. 'jarraa, mooreg3, keith') [it is stored this way > because it will be displayed in this format]. You should *not* allow display concerns to drive your database layout

[GENERAL] sql (Stored procedure) design question

2006-01-11 Thread Assad Jarrahian
Problem: A column of type text contains username's and groupname's followed by comma (eg. 'jarraa, mooreg3, keith') [it is stored this way because it will be displayed in this format]. What is needed is a constrain check. To make sure that every time a row is inserted into the table, this colum