On Sun, Nov 30, 2003 at 09:01:01PM +0000, Oliver Elphick wrote:
> On Thu, 2003-11-27 at 12:43, Alex Page wrote:
> > This is probably really basic, but I can't seem to get it to work. I'm
> > trying to create an enumerated type, using the following code:
> > CREATE FUNCTION enum_gender_in (cstring) RETURNS enum_gender IMMUTABLE AS
> ...
>
> Why not just use a CHECK constraint?
I'm fairly sure that a CHECK constraint will be a lot slower (even with
an index) than my own TYPE with an internal integer representation. I'd
like to check this, but of course I can't do any benchmarks until I've
got the CREATE TYPE working :)
Alex
--
Mail: Alex Page <alex.page@cancer.org.uk>
Real: Systems/Network Assistant, Epidemiology Unit, Oxford
Tel: 01865 302 223 (external) / 223 (internal)
PGP: 8868 21D7 3D35 DD77 9D06 BF0A 0746 2DE6 55EA 367E