From jkanter@virginia.edu Mon Dec 22 17:18:29 2003 X-Original-To: pgsql-admin-postgresql.org@localhost.postgresql.org Received: from localhost (neptune.hub.org [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id D8541D1CA61 for ; Mon, 22 Dec 2003 17:18:29 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (neptune.hub.org [200.46.204.2]) (amavisd-new, port 10024) with ESMTP id 52111-03 for ; Mon, 22 Dec 2003 13:17:41 -0400 (AST) Received: from unix.mail.Virginia.EDU (unix.mail.Virginia.EDU [128.143.2.28]) by svr1.postgresql.org (Postfix) with ESMTP id 1FF3CD1CA71 for ; Mon, 22 Dec 2003 13:13:51 -0400 (AST) Received: from smtp.mail.Virginia.EDU (smtp.mail.Virginia.EDU [128.143.22.52]) by unix.mail.Virginia.EDU (Postfix) with ESMTP id 6AABDA9EE for ; Mon, 22 Dec 2003 12:13:45 -0500 (EST) Received: from virginia.edu (d-137-133-128.bootp.Virginia.EDU [137.54.133.128]) by smtp.mail.Virginia.EDU (Postfix) with ESMTP id 5574B21029 for ; Mon, 22 Dec 2003 12:13:44 -0500 (EST) Message-ID: <3FE7293A.8010203@virginia.edu> Date: Mon, 22 Dec 2003 12:26:18 -0500 From: Jodi Kanter User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.5) Gecko/20031007 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Postgres Admin List Subject: constaint addition to existing schema Content-Type: multipart/alternative; boundary="------------070707070203050803080005" X-Virus-Scanned: by amavisd-new at postgresql.org X-Spam-Status: No, hits=0.2 tagged_above=0.0 required=5.0 tests=ASCII_FORM_ENTRY, BAYES_30, HTML_70_80, USER_AGENT_MOZILLA_UA X-Spam-Level: X-Archive-Number: 200312/301 X-Sequence-Number: 11807 This is a multi-part message in MIME format. --------------070707070203050803080005 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit I missed a constraint the last time that I loaded my database. Can I add an additional constraint without having to drop and rerun the table? If not, can I do just that one table without having to do the entire schema? Jodi -- /_______________________________ //Jodi L Kanter BioInformatics Database Administrator University of Virginia (434) 924-2846 jkanter@virginia.edu / / / / / --------------070707070203050803080005 Content-Type: text/html; charset=us-ascii Content-Transfer-Encoding: 7bit I missed a constraint the last time that I loaded my database. Can I add an additional constraint without having to drop and rerun the table?
If not, can I do just that one table without having to do the entire schema?
Jodi
--
________________________________

_______________________________
Jodi L Kanter
BioInformatics Database Administrator
University of Virginia
(434) 924-2846
jkanter@virginia.edu


 

 

 

--------------070707070203050803080005-- From ys2n@virginia.edu Mon Dec 22 20:19:06 2003 X-Original-To: pgsql-admin-postgresql.org@localhost.postgresql.org Received: from localhost (neptune.hub.org [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id E1DC4D1B4D7 for ; Mon, 22 Dec 2003 20:19:06 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (neptune.hub.org [200.46.204.2]) (amavisd-new, port 10024) with ESMTP id 75186-08 for ; Mon, 22 Dec 2003 16:18:18 -0400 (AST) Received: from cms.mail.virginia.edu (fork3.mail.Virginia.EDU [128.143.2.193]) by svr1.postgresql.org (Postfix) with ESMTP id AFFEDD1B43A for ; Mon, 22 Dec 2003 16:18:16 -0400 (AST) Received: from atg2000.itc.virginia.edu (atg2000.itc.Virginia.EDU [128.143.87.239]) by cms.mail.virginia.edu (Postfix) with ESMTP id A6E00168102; Mon, 22 Dec 2003 15:18:17 -0500 (EST) Date: Mon, 22 Dec 2003 15:17:02 -0500 (EST) From: Yuji Shinozaki X-X-Sender: ys2n@atg2000.itc.virginia.edu To: Jodi Kanter Cc: Postgres Admin List Subject: Re: constaint addition to existing schema In-Reply-To: <3FE7293A.8010203@virginia.edu> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200312/303 X-Sequence-Number: 11809 You should probably read about the specifics in the documentation (see http://www.postgresql.org/docs/) But you could use something like (e.g.) ALTER TABLE ONLY question_category ADD CONSTRAINT question_category_external_id_key UNIQUE (external_id); which adds a UNIQUE constraint to the column external_id in table question_category. Other types of constraints have slightly different syntax. HTH, yuji ---- On Mon, 22 Dec 2003, Jodi Kanter wrote: > I missed a constraint the last time that I loaded my database. Can I add > an additional constraint without having to drop and rerun the table? > If not, can I do just that one table without having to do the entire schema? > Jodi > -- > > /_______________________________ > //Jodi L Kanter > BioInformatics Database Administrator > University of Virginia > (434) 924-2846 > jkanter@virginia.edu / > > > > / / > > / / > > Yuji Shinozaki Computer Systems Senior Engineer ys2n@virginia.edu Advanced Technologies Group (434)924-7171 Information Technology & Communication http://www.people.virginia.edu/~ys2n University of Virginia From bruno@wolff.to Wed Dec 24 04:07:24 2003 X-Original-To: pgsql-admin-postgresql.org@localhost.postgresql.org Received: from localhost (neptune.hub.org [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id DA6EAD1B439 for ; Wed, 24 Dec 2003 04:07:24 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (neptune.hub.org [200.46.204.2]) (amavisd-new, port 10024) with ESMTP id 92864-07 for ; Wed, 24 Dec 2003 00:06:34 -0400 (AST) Received: from wolff.to (wolff.to [66.93.249.74]) by svr1.postgresql.org (Postfix) with SMTP id 24416D1B496 for ; Wed, 24 Dec 2003 00:06:34 -0400 (AST) Received: (qmail 29254 invoked by uid 500); 24 Dec 2003 04:06:38 -0000 Date: Tue, 23 Dec 2003 22:06:38 -0600 From: Bruno Wolff III To: Jodi Kanter Cc: Postgres Admin List Subject: Re: constaint addition to existing schema Message-ID: <20031224040638.GB626@wolff.to> Mail-Followup-To: Jodi Kanter , Postgres Admin List References: <3FE7293A.8010203@virginia.edu> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <3FE7293A.8010203@virginia.edu> User-Agent: Mutt/1.5.4i X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200312/304 X-Sequence-Number: 11810 On Mon, Dec 22, 2003 at 12:26:18 -0500, Jodi Kanter wrote: > I missed a constraint the last time that I loaded my database. Can I add > an additional constraint without having to drop and rerun the table? > If not, can I do just that one table without having to do the entire schema? > Jodi ALTER TABLE should allow you to do this.