Male/female
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@iol.ie
----------------------------------------------------------------------
Second method might be better.
Of course, you could also do a one chracter gender "M/F" if you want to
save space.
Raymond O'Donnell wrote:
Show quoted text
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@iol.ie
-------------------------------------------------------------------------------------------------(end of broadcast)---------------------------
TIP 3: Have you checked our extensive FAQ?
-----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-----
Raymond O'Donnell <rod@iol.ie> schrieb:
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)))
What about with Hermaphroditism?
SCNR.
Andreas
--
Really, I'm not out to destroy Microsoft. That will just be a completely
unintentional side effect. (Linus Torvalds)
"If I was god, I would recompile penguin with --enable-fly." (unknow)
Kaufbach, Saxony, Germany, Europe. N 51.05082�, E 13.56889�
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?
--
-- PostgreSQL database dump
--
CREATE TABLE gender (
gender_pk SERIAL,
gender character varying(9) NOT NULL
);
COMMENT ON TABLE gender IS 'This table defines currently valid gender
types (and allows for god knows what..).';
COPY gender (gender_pk, gender) FROM stdin;
0 (unknown)
1 Male
2 Female
3 Trans
\.
ALTER TABLE ONLY gender ADD CONSTRAINT gender_pkey PRIMARY KEY (gender_pk);
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).
--
Leif Biberg Kristensen | Registered Linux User #338009
http://solumslekt.org/ | Cruising with Gentoo/KDE
Andreas Kretschmer wrote:
What about with Hermaphroditism?
More seriously - is the gender something you always know? There
are situations in the US where you cannot force someone to divulge
their gender. So you may need an 'unreported' value of some sort.
--
Steve Wampler -- swampler@noao.edu
The gods that smiled on your birth are now laughing out loud.
COPY gender (gender_pk, gender) FROM stdin;
0 (unknown)
1 Male
2 Female
3 Trans
\.
Not to take this completely off track, but isn't transgendered not so
much a gender as it is a process of moving from one gender to another?
On Fri, Dec 08, 2006 at 03:23:11PM -0000, Raymond O'Donnell wrote:
Just wondering.....how do list member represent gender when storing
details of people in a database?
I usually use a table called gender which has one TEXT column, that
being its primary key. For one client I had, there were seven rows in
this table.
Cheers,
D
--
David Fetter <david@fetter.org> http://fetter.org/
phone: +1 415 235 3778 AIM: dfetter666
Skype: davidfetter
Remember to vote!
Seven genders? Even San Fransisco thinks that's over the top.
David Fetter wrote:
Show quoted text
On Fri, Dec 08, 2006 at 03:23:11PM -0000, Raymond O'Donnell wrote:
Just wondering.....how do list member represent gender when storing
details of people in a database?I usually use a table called gender which has one TEXT column, that
being its primary key. For one client I had, there were seven rows in
this table.Cheers,
D
On Fri, 2006-12-08 at 09:31 -0700, John Meyer wrote:
COPY gender (gender_pk, gender) FROM stdin;
0 (unknown)
1 Male
2 Female
3 Trans
\.Not to take this completely off track, but isn't transgendered not so
much a gender as it is a process of moving from one gender to another?
Yes, but further I don't know of any country that recognizes anything
but Male or Female.
Joshua D. Drake
---------------------------(end of broadcast)---------------------------
TIP 6: explain analyze is your friend
--
=== The PostgreSQL Company: Command Prompt, Inc. ===
Sales/Support: +1.503.667.4564 || 24x7/Emergency: +1.800.492.2240
Providing the most comprehensive PostgreSQL solutions since 1997
http://www.commandprompt.com/
Donate to the PostgreSQL Project: http://www.postgresql.org/about/donate
"Joshua D. Drake" <jd@commandprompt.com> writes:
Yes, but further I don't know of any country that recognizes anything
but Male or Female.
I haven't read the beginning of the thread, but will this table be used only
for humans? There are animals that are hermafrodites (I hope I got the
English correct...) or whose sex is only identifiable after a period of time
(days or months, usually).
So, for researchers it would be interesting to have more options.
Also, if you're doing statistics on something where the sexual option (and
transgerderness) is important, then there should be some way to point that.
--
Jorge Godoy <jgodoy@gmail.com>
On Fri, 2006-12-08 at 10:44, John Meyer wrote:
David Fetter wrote:
On Fri, Dec 08, 2006 at 03:23:11PM -0000, Raymond O'Donnell wrote:
Just wondering.....how do list member represent gender when storing
details of people in a database?I usually use a table called gender which has one TEXT column, that
being its primary key. For one client I had, there were seven rows in
this table.Seven genders? Even San Fransisco thinks that's over the top.
Let's see.
Male
Female
Hermaphrodite
Trans (MTF)
Trans (FTM)
Neuter
and... I can't think of a seventh possibility.
On Fri, 2006-12-08 at 11:05, Joshua D. Drake wrote:
On Fri, 2006-12-08 at 09:31 -0700, John Meyer wrote:
COPY gender (gender_pk, gender) FROM stdin;
0 (unknown)
1 Male
2 Female
3 Trans
\.Not to take this completely off track, but isn't transgendered not so
much a gender as it is a process of moving from one gender to another?Yes, but further I don't know of any country that recognizes anything
but Male or Female.
In thailand, there are highschools with bathrooms for the transgendered
MTF girls. Not sure if the country itself recognized MTF trans as a
gender or not though.
Joshua D. Drake wrote:
On Fri, 2006-12-08 at 09:31 -0700, John Meyer wrote:
COPY gender (gender_pk, gender) FROM stdin;
0 (unknown)
1 Male
2 Female
3 Trans
\.Not to take this completely off track, but isn't transgendered not so
much a gender as it is a process of moving from one gender to another?Yes, but further I don't know of any country that recognizes anything
but Male or Female.
... Yet.
Scott Marlowe wrote:
On Fri, 2006-12-08 at 10:44, John Meyer wrote:
David Fetter wrote:
On Fri, Dec 08, 2006 at 03:23:11PM -0000, Raymond O'Donnell wrote:
Just wondering.....how do list member represent gender when storing
details of people in a database?I usually use a table called gender which has one TEXT column, that
being its primary key. For one client I had, there were seven rows in
this table.Seven genders? Even San Fransisco thinks that's over the top.
Let's see.
Male
Female
Hermaphrodite
Trans (MTF)
Trans (FTM)
Neuterand... I can't think of a seventh possibility.
"Unspecified"
Scott Marlowe wrote:
On Fri, 2006-12-08 at 10:44, John Meyer wrote:
David Fetter wrote:
On Fri, Dec 08, 2006 at 03:23:11PM -0000, Raymond O'Donnell wrote:
Just wondering.....how do list member represent gender when storing
details of people in a database?I usually use a table called gender which has one TEXT column, that
being its primary key. For one client I had, there were seven rows in
this table.Seven genders? Even San Fransisco thinks that's over the top.
Let's see.
Male
Female
Hermaphrodite
Trans (MTF)
Trans (FTM)
Neuterand... I can't think of a seventh possibility.
As has been pointed out, some governments forbid the collection of
gender information, so the seventh would be unknown/unreported.
brian
Jorge Godoy wrote:
"Joshua D. Drake" <jd@commandprompt.com> writes:
Yes, but further I don't know of any country that recognizes anything
but Male or Female.I haven't read the beginning of the thread, but will this table be used only
for humans? There are animals that are hermafrodites (I hope I got the
English correct...) or whose sex is only identifiable after a period of time
(days or months, usually).So, for researchers it would be interesting to have more options.
Also, if you're doing statistics on something where the sexual option (and
transgerderness) is important, then there should be some way to point that.
Some people argue that gender is a spectrum. If you want to be very
inclusive. Maybe you could use a 'float' and stick with 0 = woman, 1 =
man (self documenting after all) with the option of '0.1 - 0.9' for
people who feel "in between". How efficient is 'float'? This would also
work for animals that fall outside then normal male/female designation.
Madi
I guess in the end it really depends on what the client wants to track
and what they don't. But this does actually have a serious implication,
and that is how do you code for something that is mutable vs. something
that supposedly is or very nearly immutable (i.e. the alphabet).
That not including Genetics,
where and individual could have
multiple X Chromomes individuals
Or be XY - female times those other
6 (or 7).
----- Original Message -----
From: "brian" <brian@zijn-digital.com>
To: <pgsql-general@postgresql.org>
Sent: Friday, December 08, 2006 9:19 AM
Subject: Re: [GENERAL] Male/female
Show quoted text
Scott Marlowe wrote:
On Fri, 2006-12-08 at 10:44, John Meyer wrote:
David Fetter wrote:
On Fri, Dec 08, 2006 at 03:23:11PM -0000, Raymond O'Donnell wrote:
Just wondering.....how do list member represent gender when storing
details of people in a database?I usually use a table called gender which has one TEXT column, that
being its primary key. For one client I had, there were seven rows in
this table.Seven genders? Even San Fransisco thinks that's over the top.
Let's see.
Male
Female
Hermaphrodite
Trans (MTF)
Trans (FTM)
Neuterand... I can't think of a seventh possibility.
As has been pointed out, some governments forbid the collection of
gender information, so the seventh would be unknown/unreported.brian
---------------------------(end of broadcast)---------------------------
TIP 9: In versions below 8.0, the planner will ignore your desire to
choose an index scan if your joining column's datatypes do not
match