Re: CREATE TYPE in Postgres 7.3.4

From: Alex Page <alex(dot)page(at)cancer(dot)org(dot)uk>
To: Oliver Elphick <olly(at)lfix(dot)co(dot)uk>
Cc: PostgreSQL general list <pgsql-general(at)postgresql(dot)org>
Subject: Re: CREATE TYPE in Postgres 7.3.4
Date: 2003-12-02 17:15:47
Message-ID: 20031202171547.GU22296@halcyon.ox.icnet.uk
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

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(dot)page(at)cancer(dot)org(dot)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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Alex Page 2003-12-02 17:27:59 Re: CREATE TYPE in Postgres 7.3.4
Previous Message Richard Huxton 2003-12-02 17:12:51 Re: how many quotes?