Re: Migrating a MySQL schema with an enum
| От | Martín Marqués |
|---|---|
| Тема | Re: Migrating a MySQL schema with an enum |
| Дата | |
| Msg-id | 20020321114341.6FD67FA1D@bugs.unl.edu.ar обсуждение исходный текст |
| Ответ на | Re: Migrating a MySQL schema with an enum ("Christopher Kings-Lynne" <chriskl@familyhealth.com.au>) |
| Список | pgsql-sql |
On Mié 20 Mar 2002 23:31, you wrote:
> > Keith Gray writes:
> > > Migrating a MySQL schema with an enum to PostgreSQL,
> > > is there an equivalent type or do I have to declare
> > > another table for "enum" values.
> >
> > Generally, you'd use a text field with a check constraint. For example:
> >
> > CREATE TABLE car (
> > ...
> > color text check (color in ('blue', 'green', 'yellow')),
> > ...
> > );
>
> Nope - cos you need 'blue,green' as a value, etc. as well.
That's not how enum() works.
--
Porqué usar una base de datos relacional cualquiera,
si podés usar PostgreSQL?
-----------------------------------------------------------------
Martín Marqués | mmarques@unl.edu.ar
Programador, Administrador, DBA | Centro de Telematica Universidad Nacional
del Litoral
-----------------------------------------------------------------
В списке pgsql-sql по дате отправления: