Received: from localhost (maia-1.hub.org [200.46.204.191]) by postgresql.org (Postfix) with ESMTP id 46A6F9F9258 for ; Tue, 28 Aug 2007 12:19:04 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.191]) (amavisd-maia, port 10024) with ESMTP id 33837-08 for ; Tue, 28 Aug 2007 12:18:54 -0300 (ADT) X-Greylist: delayed 00:35:18.365488 by SQLgrey-1.7.5 Received: from interscan.indicator.com (unknown [193.121.199.3]) by postgresql.org (Postfix) with ESMTP id 17F289F94EC for ; Tue, 28 Aug 2007 12:18:53 -0300 (ADT) Received: from webaccess.indicator.be ([10.100.1.7]) by interscan.indicator.com with InterScan Message Security Suite; Tue, 28 Aug 2007 16:26:28 +0200 Received: from DOMEXT-MTA by webaccess.indicator.bewith Novell_GroupWise; Tue, 28 Aug 2007 16:43:32 +0200 Message-Id: <46D450A4.A3DD.0030.0@indicator.be> X-Mailer: Novell GroupWise Internet Agent 7.0.1 Date: Tue, 28 Aug 2007 16:43:17 +0200 From: "Bart Degryse" To: Subject: Re: Database normalization References: <99b656cb0708210709j5182b73cna63a2d275efa0e84@mail.gmail.com><99 b656cb0708280447x4eb7c45axec01c8d0ebc6c82d@mail.gmail.com><20070828132604.G B461@phlogiston.dyndns.org><99b656cb0708280737l3d50585fifcfef7103b26059b@mail.gmail.com> In-Reply-To: <99b656cb0708280737l3d50585fifcfef7103b26059b@mail.gmail.com> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="=__Part5B7CC495.0__=" X-imss-version: 2.047 X-imss-result: Passed X-imss-approveListMatch: *@indicator.be X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.143 tagged_above=0 required=5 tests=AWL=0.226, BAYES_40=-0.185, HTML_MESSAGE=0.001, RDNS_NONE=0.1, UNPARSEABLE_RELAY=0.001 X-Spam-Level: X-Archive-Number: 200708/244 X-Sequence-Number: 29182 --=__Part5B7CC495.0__= Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Im using Django as my Object relational Mapper so im pretty sure I = can not add a constraint such as ... Then you should seriously consider changing your mapper. >>> "Sebastian Ritter" 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=20 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=20 consideration when deciding whether to split the tables? In terms of = searching speed that is. Kindest regards. Sebastian On 8/28/07, Andrew Sullivan wrote: On Tue, Aug 28, 2007 at 12:47:45PM +0100, Sebastian Ritter wrote:=20 > > 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=20 > > 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=20 going to do that, make sure you add a CHECK constraint where !(col1 IS NULL and col2 IS NULL). A -- Andrew Sullivan | ajs@crankycanuck.ca=20 I remember when computers were frustrating because they *did* exactly = what=20 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?=20 http://www.postgresql.org/docs/faq=20 --=__Part5B7CC495.0__= Content-Type: text/html; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Content-Description: HTML
<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.

>&g= t;> "Sebastian Ritter" <ritter.sebastian@gmail.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, Andr= ew Sullivan <ajs@crankycanuck= .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. &= nbsp;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@crankycanuck.ca
I remember when computers = were frustrating because they *did* exactly what
you told them = to.  That actually seems sort of quaint now.
   = ;            &n= bsp;--J.D. Baldwin

---------------------------(end of broadcast)----= -----------------------
TIP 3: Have you checked our extensive FAQ? =

           &= nbsp;   http://www= .postgresql.org/docs/faq

--=__Part5B7CC495.0__=--