From: | "Raymond O'Donnell" <rod(at)iol(dot)ie> |
---|---|
To: | pgsql-general(at)postgresql(dot)org |
Subject: | Male/female |
Date: | 2006-12-08 15:23:11 |
Message-ID: | 4579835F.11355.1DE571@rod.iol.ie |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
Just wondering.....how do list member represent gender when storing
details of people in a database?
I've done it two ways:
* A bool column, with the understanding that true/false represents
one gender or the other.
* Create a domain, something like:
CREATE DOMAIN gender_domain
AS character varying(7)
NOT NULL
CONSTRAINT gender_domain_check CHECK ((((VALUE)::text =
'male'::text) OR ((VALUE)::text = 'Female'::text)))
I personally prefer the second, as it's self-documenting...is there
any other/better way of doing it?
--Ray.
----------------------------------------------------------------------
Raymond O'Donnell
Director of Music, Galway Cathedral, Galway, Ireland
rod(at)iol(dot)ie
----------------------------------------------------------------------
From | Date | Subject | |
---|---|---|---|
Next Message | John Meyer | 2006-12-08 15:31:19 | Re: Male/female |
Previous Message | Tom Lane | 2006-12-08 15:21:30 | Re: Excluding schema from backup |