Received: from bugs.unl.edu.ar (bugs.unl.edu.ar [168.96.132.208]) by postgresql.org (Postfix) with ESMTP id 46D9E4758DD for ; Thu, 21 Mar 2002 06:42:48 -0500 (EST) Received: from localhost (localhost [127.0.0.1]) by bugs.unl.edu.ar (Postfix) with ESMTP id 24F81FDD3 for ; Thu, 21 Mar 2002 08:43:43 -0300 (GMT) Received: from there (bugs [168.96.132.208]) by bugs.unl.edu.ar (Postfix) with SMTP id 6FD67FA1D for ; Thu, 21 Mar 2002 08:43:41 -0300 (GMT) Content-Type: text/plain; charset="iso-8859-1" From: =?iso-8859-1?q?Mart=EDn=20Marqu=E9s?= To: "SQL" Subject: Re: Migrating a MySQL schema with an enum Date: Thu, 21 Mar 2002 08:43:40 -0300 X-Mailer: KMail [version 1.3.2] References: In-Reply-To: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Message-Id: <20020321114341.6FD67FA1D@bugs.unl.edu.ar> X-Virus-Scanned: by AMaViS snapshot-20011031 X-Archive-Number: 200203/275 X-Sequence-Number: 7154 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 -----------------------------------------------------------------