Received: from merganser.its.uu.se (merganser.its.uu.se [130.238.6.236]) by hub.org (8.9.3/8.9.3) with ESMTP id MAA67341 for ; Sat, 4 Mar 2000 12:03:08 -0500 (EST) (envelope-from peter@localhost.its.uu.se) Received: from regulus.its.uu.se ([130.238.7.19]:64977 "EHLO regulus.its.uu.se") by merganser.its.uu.se with ESMTP id ; Sat, 4 Mar 2000 18:02:24 +0100 Received: from peter (helo=localhost) by regulus.its.uu.se with local-esmtp (Exim 3.02 #2) id 12RHzo-0000BW-00; Sat, 04 Mar 2000 18:05:40 +0100 Date: Sat, 4 Mar 2000 18:05:40 +0100 (CET) From: Peter Eisentraut To: Kyle Bateman cc: pgsql-sql@postgresql.org Subject: Re: [SQL] ENUM Type In-Reply-To: <38C030AC.6C69BD01@actarg.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=ISO-8859-1 Content-Transfer-Encoding: 8BIT Sender: Peter Eisentraut Kyle Bateman writes: > Does PostgreSQL have support for an ENUM type? No. You can create a separate table that maps some, say integer, key to a, say, string. That's usually how ENUM stuff is ported away from MySQL (also known as TheirSQL). Alternatively you can also pull something like this: CREATE TABLE test ( ... a text check (a in ('value1', 'value2', ...)), ... ) You get the idea. > I didn't see it in the docs, but maybe someone has figured out how to > create one easily with the add new type stuff... That "add new type stuff" isn't all one might think it is either. -- Peter Eisentraut Sernanders väg 10:115 peter_e@gmx.net 75262 Uppsala http://yi.org/peter-e/ Sweden