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 20020321113145.E84DBFA1D@bugs.unl.edu.ar
Whole thread Raw
In response to Migrating a MySQL schema with an enum  (Keith Gray <keith@heart.com.au>)
Responses Re: Migrating a MySQL schema with an enum  ("Ross J. Reedstrom" <reedstrm@rice.edu>)
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                  |        mmarques@unl.edu.ar
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