Re: constaint addition to existing schema

From: Yuji Shinozaki <ys2n(at)virginia(dot)edu>
To: Jodi Kanter <jkanter(at)virginia(dot)edu>
Cc: Postgres Admin List <pgsql-admin(at)postgresql(dot)org>
Subject: Re: constaint addition to existing schema
Date: 2003-12-22 20:17:02
Message-ID: Pine.LNX.4.44.0312221512270.740-100000@atg2000.itc.virginia.edu
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin


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(at)virginia(dot)edu <mailto:jkanter(at)virginia(dot)edu>/
>
>
>
> / /
>
> / /
>
>

Yuji Shinozaki Computer Systems Senior Engineer
ys2n(at)virginia(dot)edu Advanced Technologies Group
(434)924-7171 Information Technology & Communication
http://www.people.virginia.edu/~ys2n University of Virginia

In response to

Browse pgsql-admin by date

  From Date Subject
Next Message Iain 2003-12-24 02:10:30 Re: ERROR: canceling query due to user request
Previous Message scott.marlowe 2003-12-22 17:31:15 Re: pg_dump vs pg_dumpall - small database cluster,