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?
CREATE TABLE xxx (
...
gender CHAR(1) CONSTRAINT "valid gender"
CHECK (gender IN ('M', 'F')),
...
);
--
Oliver Elphick Oliver.Elphick@lfix.co.uk
Isle of Wight, UK http://www.lfix.co.uk/oliver
GPG: 1024D/3E1D0C1C: CA12 09E0 E8D5 8870 5839 932A 614D 4C34 3E1D 0C1C
========================================
"But grow in grace, and in the knowledge of our Lord
and Saviour Jesus Christ. To him be glory both now and
for ever. Amen." II Peter 3:18