Re: Are globally defined constants possible at all ?

Поиск
Список
Период
Сортировка
От Gregory Seidman
Тема Re: Are globally defined constants possible at all ?
Дата
Msg-id 20020607212927.GA25261@jamaica.cs.brown.edu
обсуждение исходный текст
Ответ на Re: Are globally defined constants possible at all ?  (Andrew Sullivan <andrew@libertyrms.info>)
Ответы Re: Are globally defined constants possible at all ?
Список pgsql-general
Andrew Sullivan sez:
} On Fri, Jun 07, 2002 at 02:36:35PM -0400, Gregory Seidman wrote:
}
} > I am in the exact same position. I have a number of things which are
} > essentially enumerations. Since PostgreSQL does not support an enumeration
} > type (MySQL does, but then it doesn't have a proper boolean type), I have a
}
} Why don't you use a CHECK contraint?  That's the standard way to do
} it.

Er, could you expand on that? Are you suggesting something like this:

CREATE TABLE Foo (
    KindID int,
    ...
    CONSTRAINT fooenum
    CHECK KindID IN ('SOFTWARE', 'HARDWARE')
);

} A
--Greg


В списке pgsql-general по дате отправления:

Предыдущее
От: Andrew Sullivan
Дата:
Сообщение: Re: Are globally defined constants possible at all ?
Следующее
От: "Nigel J. Andrews"
Дата:
Сообщение: Re: Are globally defined constants possible at all ?