On Feb 7, 2007, at 10:05 AM, MargaretGillon@chromalloy.com wrote:
> I was using the flag table to keep the flags consistent between all
> the tables in the database that might use them. I didn't know about
> CREATE DOMAIN which will do what I want perfectly
Note that DOMAIN support unfortunately isn't perfect; for example,
plpgsql doesn't enforce domain constraints (IIRC there's some other
bugs as well). So you should probably do a test to make sure
everything you'll be doing with domains will work before you re-code
everything.
Also, I suggest using "char" instead of just char. "char" is a
special data type that's limited to storing a single character; the
advantage is that it's much smaller and faster than a char.
If you do end up back at using foreign keys, I suggest using either a
smallint or "char"... the savings across the number of fields you're
looking at would start to add up, especially if you start putting a
decent number of rows in the table.
--
Jim Nasby jim@nasby.net
EnterpriseDB http://enterprisedb.com 512.569.9461 (cell)