Re: Enforcing Join condition

From: சிவகுமார் மா <masivakumar(at)gmail(dot)com>
To: "Sam Mason" <sam(at)samason(dot)me(dot)uk>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Enforcing Join condition
Date: 2007-11-15 14:16:46
Message-ID: 139e14f00711150616s91dbb3dje00f6983ac0395c2@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Nov 15, 2007 5:52 PM, Sam Mason <sam(at)samason(dot)me(dot)uk> wrote:
> What I tend to do here, is something like:
>
> CREATE TABLE test (
> type INTEGER,
> ref1 INTEGER REFERENCES table1 CHECK ((type = 1) = (ref1 IS NOT NULL)),
> ref2 INTEGER REFERENCES table2 CHECK ((type = 2) = (ref2 IS NOT NULL)),
> ref3 INTEGER REFERENCES table3 CHECK ((type = 3) = (ref3 IS NOT NULL))
> );

Thanks for sharing. Will try it. But, we have more than 10 types in
one table. Will be tough to handle.

Ma Sivakumar
--
மா சிவகுமார்
எல்லோரும் எல்லாமும் பெற வேண்டும்
http://masivakumar.blogspot.com

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Abraham, Danny 2007-11-15 14:18:27 Re: Chunk Delete
Previous Message dcrespo 2007-11-15 14:02:35 Query Performance Test