Re: Code tables, conditional foreign keys?

From: Alban Hertroys <dalroi(at)solfertje(dot)student(dot)utwente(dot)nl>
To: Conrad Lender <crlender(at)gmail(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Code tables, conditional foreign keys?
Date: 2009-05-23 10:05:51
Message-ID: B3EC5FD6-ABD0-4724-AA9A-93858AF89969@solfertje.student.utwente.nl
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

> Here's an example of the value groups that were contained in the
> table:
>
> fax status:
> pending, active, sent, error
> department:
> office, accounting, it, legal, experts
> deadline type:
> official, unofficial
> ...

> Is it really advisable to put all these values into 70 separate tables
> with the exact same layout? I don't quite see the benefit.

You could use the ENUM type for that (http://www.postgresql.org/docs/current/static/datatype-enum.html
), although that works best if these values are really static. If
users should be able to edit them they're probably not the best choice.

Alban Hertroys

--
If you can't see the forest for the trees,
cut the trees and you'll see there is no forest.

!DSPAM:737,4a17ca8210091499713462!

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Leif B. Kristensen 2009-05-23 10:22:24 Re: Asssociative Arrays: Best practices / snippets?
Previous Message Alban Hertroys 2009-05-23 09:45:00 Re: performance tuning on Vista problem