Re: sql (Stored procedure) design question

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Assad Jarrahian <jarraa(at)gmail(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: sql (Stored procedure) design question
Date: 2006-01-12 05:16:05
Message-ID: 1370.1137042965@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Assad Jarrahian <jarraa(at)gmail(dot)com> 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.
The pain you are now experiencing is just the first taste of why that's
a bad idea.

Store the usernames and groupnames separately. If you have an
application that's too dumb to concatenate them for itself, you
can make a view on the table that provides the display representation
the application needs.

regards, tom lane

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2006-01-12 05:19:09 Re: Granting Privleges on All Tables in One Comand?
Previous Message Bruce Momjian 2006-01-12 04:43:17 Re: Granting Privleges on All Tables in One Comand?