Re: Database normalization

From: "Sebastian Ritter" <ritter(dot)sebastian(at)gmail(dot)com>
To: pgsql-sql(at)postgresql(dot)org
Subject: Re: Database normalization
Date: 2007-08-28 15:35:29
Message-ID: 99b656cb0708280835l4652bcfcje2c9a111a9a33d06@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Thanks guys,

Sebastian

On 8/28/07, Bart Degryse <Bart(dot)Degryse(at)indicator(dot)be> wrote:
>
> <quote>Im using Django as my Object relational Mapper so im pretty sure I
> can not add a constraint such as ...</quote>
> Then you should seriously consider changing your mapper.
>
> >>> "Sebastian Ritter" <ritter(dot)sebastian(at)gmail(dot)com> 2007-08-28 16:37 >>>
> Thanks for the information.
>
> Both tables would be exactly sames apart from the foreign key relation to
> clients or services. I agree that it seems strange to have one column that
> is always null. Im using Django as my Object relational Mapper so im pretty
> sure I can not add a constraint such as : CHECK constraint where !(col1
> IS NULL and col2 IS NULL).
>
> Another factor ive been considering is that one of the fields in this
> table(s) definition(s) is free flowing text which could potentially become
> very large. Should I take this in to
> consideration when deciding whether to split the tables? In terms of
> searching speed that is.
>
> Kindest regards.
> Sebastian
>
> On 8/28/07, Andrew Sullivan <ajs(at)crankycanuck(dot)ca> wrote:
> >
> > On Tue, Aug 28, 2007 at 12:47:45PM +0100, Sebastian Ritter wrote:
> > > > The update/message format is exactly the same for both. Should I
> > make two
> > > > different tables:
> >
> > > > one table with extra columns : is_client, client_id, service_id,
> > where
> > > > either client_id or service_id would be null depending on the
> > is_client
> > > > boolean?
> >
> > Is the rest of the data the same? If so, then one table is right.
> > If not, then more than one table. In either case, I really hate the
> > idea of two columns, one of which is always null. But if you're
> > going to do that, make sure you add a CHECK constraint where !(col1
> > IS NULL and col2 IS NULL).
> >
> > A
> >
> > --
> > Andrew Sullivan | ajs(at)crankycanuck(dot)ca
> > I remember when computers were frustrating because they *did* exactly
> > what
> > you told them to. That actually seems sort of quaint now.
> > --J.D. Baldwin
> >
> > ---------------------------(end of broadcast)---------------------------
> > TIP 3: Have you checked our extensive FAQ?
> >
> > http://www.postgresql.org/docs/faq
> >
>
>

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Guy Fraser 2007-08-28 16:05:03 Was: fetch first rows of grouped data
Previous Message Andrew Sullivan 2007-08-28 15:19:08 Re: Database normalization