Re: CREATE TYPE in Postgres 7.3.4
От | Oliver Elphick |
---|---|
Тема | Re: CREATE TYPE in Postgres 7.3.4 |
Дата | |
Msg-id | 1070226061.7727.2563.camel@linda.lfix.co.uk обсуждение исходный текст |
Ответ на | CREATE TYPE in Postgres 7.3.4 (Alex Page <alex.page@cancer.org.uk>) |
Ответы |
Re: CREATE TYPE in Postgres 7.3.4
|
Список | pgsql-general |
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
В списке pgsql-general по дате отправления: