Re: Male/female

Поиск
Список
Период
Сортировка
От Ron Johnson
Тема Re: Male/female
Дата
Msg-id 457985E5.3060902@cox.net
обсуждение исходный текст
Ответ на Male/female  ("Raymond O'Donnell" <rod@iol.ie>)
Список pgsql-general
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 12/08/06 09: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?

I've only ever seen a CHAR(1) restricted to 'M'/'F'.

- --
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)

iD8DBQFFeYXkS9HxQb37XmcRAtoeAKCmupJdzyH7MzEqfmWGI9lPtM6MfwCg13X6
wdPnXc1DrLN+8oKPSusVk0g=
=5Xwk
-----END PGP SIGNATURE-----

В списке pgsql-general по дате отправления:

Предыдущее
От: John Meyer
Дата:
Сообщение: Re: Male/female
Следующее
От: Andreas Kretschmer
Дата:
Сообщение: Re: Male/female