Search Postgresql Archives

Male/female

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxx
----------------------------------------------------------------------




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux