Search Postgresql Archives

Re: Enforcing Join condition

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Nov 15, 2007 5:52 PM, Sam Mason <sam@xxxxxxxxxxxxx> 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 inone table. Will be tough to handle.
Ma Sivakumar-- மா சிவகுமார்எல்லோரும் எல்லாமும் பெற வேண்டும்http://masivakumar.blogspot.com
---------------------------(end of broadcast)---------------------------TIP 4: Have you searched our list archives?
               http://archives.postgresql.org/

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux