Thanks to visit codestin.com
Credit goes to postgrespro.com

Re: Migrating a MySQL schema with an enum - Mailing list pgsql-sql

From Martín Marqués
Subject Re: Migrating a MySQL schema with an enum
Date
Msg-id [email protected]
Whole thread Raw
In response to Migrating a MySQL schema with an enum  (Keith Gray <[email protected]>)
Responses Re: Migrating a MySQL schema with an enum
List pgsql-sql
On Mié 20 Mar 2002 20:41, you wrote:
> SQL gurus,
>
> 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.

I had to migrate a DB from MySQL to PostgreSQL that had some enum as field 
data type (I can't believe that something like that exists), and because it 
was something like:

enum('s','n')

I changed it for:

col1 CHAR CHECK (col1 IN ('s','n'))

Which is SQL. :-)

If what is enumerated are numbres, just use INT instead of CHAR.

Saludos... :-)

-- 
Porqué usar una base de datos relacional cualquiera,
si podés usar PostgreSQL?
-----------------------------------------------------------------
Martín Marqués                  |        [email protected]
Programador, Administrador, DBA |       Centro de Telematica                      Universidad Nacional
        del Litoral
 
-----------------------------------------------------------------


pgsql-sql by date:

Previous
From: Peter Eisentraut
Date:
Subject: Re: Migrating a MySQL schema with an enum
Next
From: Martín Marqués
Date:
Subject: Re: Migrating a MySQL schema with an enum