Received: from davinci.ethosmedia.com (davinci.ethosmedia.com [209.10.40.250]) by postgresql.org (Postfix) with ESMTP id C3EA747595B for ; Thu, 21 Feb 2002 14:07:46 -0500 (EST) Received: from [209.10.40.250] (account ) by davinci.ethosmedia.com (CommuniGate Pro WebUser 3.5.2) with HTTP id 699705; Thu, 21 Feb 2002 11:07:44 -0800 From: "Josh Berkus" Subject: Re: Changing column constraints? To: hjholland@gmx.net, pgsql sql-list X-Mailer: CommuniGate Pro Web Mailer v.3.5.2 Date: Thu, 21 Feb 2002 11:07:44 -0800 Message-ID: In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 8bit X-Archive-Number: 200202/270 X-Sequence-Number: 6693 Henry, > If I have a column constraint: > addr_type char( 10 ) default 'street' > CHECK( addr_type = 'street' || addr_type = 'pobox' ), > in a table, how can I add another choice to the list after I've > already > entered data into the table? Three options: One, drop and rebuild the table with the constraint modified. Sorry, but until we have ALTER CONSTRAINT implemented, this is the only simple way to modify and exisiting constraint. Two, mess with system tables to alter the constraint. I do not reccomend this. Three, drop and re-build the table, and this time do it right: have column addr_type reference another table called "addr_types" that list the acceptable type values. Then use a foriegn key to enforce this. -Josh Berkus