From: | Ron Johnson <ron(dot)l(dot)johnson(at)cox(dot)net> |
---|---|
To: | pgsql-general(at)postgresql(dot)org |
Subject: | Re: Male/female |
Date: | 2006-12-08 19:08:58 |
Message-ID: | 4579B84A.6000503@cox.net |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On 12/08/06 09:40, Leif B. Kristensen wrote:
> On Friday 8. December 2006 16:23, Raymond O'Donnell wrote:
>> 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?
>
> There's actually an ISO standard (ISO 5218) for representing gender with
> numeric values: 0 = Unknown, 1 = Male, 2 = Female, 9 = not specified
> (or N/A).
Well, I guess that's what I'll be using next time.
- --
Ron Johnson, Jr.
Jefferson LA USA
Is "common sense" really valid?
For example, it is "common sense" to white-power racists that
whites are superior to blacks, and that those with brown skins
are mud people.
However, that "common sense" is obviously wrong.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (GNU/Linux)
iD8DBQFFebhKS9HxQb37XmcRApRrAJ9nzAPIsJEDfKEv1SmIOCxQYV7sjACZAUZc
RTxnJcStattu74wwPcp/VR8=
=1IYS
-----END PGP SIGNATURE-----
From | Date | Subject | |
---|---|---|---|
Next Message | Ron Johnson | 2006-12-08 19:12:39 | Re: Re: Male/female |
Previous Message | Ron Johnson | 2006-12-08 19:06:13 | Re: Male/female |