X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 5F29F3A3BA1 for ; Sat, 11 Dec 2004 18:16:54 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 02399-04 for ; Sat, 11 Dec 2004 18:16:44 +0000 (GMT) Received: from davinci.ethosmedia.com (server226.ethosmedia.com [209.128.84.226]) by svr1.postgresql.org (Postfix) with ESMTP id 2E3CB3A6351 for ; Sat, 11 Dec 2004 18:16:44 +0000 (GMT) Received: from [63.195.55.98] (account josh@agliodbs.com HELO spooky) by davinci.ethosmedia.com (CommuniGate Pro SMTP 4.1.8) with ESMTP id 6774819; Sat, 11 Dec 2004 10:18:16 -0800 From: Josh Berkus Organization: Aglio Database Solutions To: pgsql-sql@postgresql.org Subject: Re: replacing mysql enum Date: Sat, 11 Dec 2004 10:16:25 -0800 User-Agent: KMail/1.6.2 Cc: Kenneth Gonsalves References: <04121110305520.21547@thenilgiris.com> In-Reply-To: <04121110305520.21547@thenilgiris.com> MIME-Version: 1.0 Content-Disposition: inline Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <200412111016.25046.josh@agliodbs.com> X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests= X-Spam-Level: X-Archive-Number: 200412/67 X-Sequence-Number: 19687 Kenneth, > i translated this as: > > field varchar(2) check (field in (null,'a','b','c')), While this isn't the question you asked, might I encourage you to use DOMAINs instead? I.e.: CREATE DOMAIN abc_col AS TEXT CHECK VALUE IN ( 'a', 'b', 'c' ); Then you declare the table as: table ( field abc_col, ); I find that DOMAINs give vastly enhanced managability compared to table constraints. -- Josh Berkus Aglio Database Solutions San Francisco