Multiple Columns Keys - Good or Bad idea?

From: Rob Brown-Bayliss <rob(at)ZOOstation(dot)cc>
To: PGSQL Novice List <pgsql-novice(at)postgresql(dot)org>
Subject: Multiple Columns Keys - Good or Bad idea?
Date: 2001-06-11 08:09:54
Message-ID: 992246994.17443.0.camel@ZOOstation.cc
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

Hi, this is not really a postgres question, more of a design question so
I hope no one minds...

I have to intergrate data from several sites, updates and new data, etc
etc, so I have come up with the following idea:

all tables will have a sequence and location column, these two columns
are the primary key. each site has it's own location number and own
sequence inserted by default.

Is this a good idea? would it be better to have just the sequence as
primary key, and make sure each site has a different sequence (ie: site
one starting at 1, site 2 starting at 10,000,000)

The second idea seems a bit kludgy to me, but if I go the first way I
have two have two cloumns as links in each table, you know SELECT * FROM
foo WHERE key1=77 and key2=4

Stuck and awaiting help...

Thanks

--

Rob Brown-Bayliss
---======o======---

Responses

Browse pgsql-novice by date

  From Date Subject
Next Message Ryan Ho 2001-06-11 08:48:26 Re: Multiple Columns Keys - Good or Bad idea?
Previous Message Rob Brown-Bayliss 2001-06-11 05:38:08 Rules Questions