Re: Adding a New Composite Constraint to an Existing Table.

From: MindTerm <mindterm(at)yahoo(dot)com>
To: Bhuvan A <bhuvansql(at)yahoo(dot)com>, pgsql-sql(at)postgresql(dot)org
Subject: Re: Adding a New Composite Constraint to an Existing Table.
Date: 2002-02-09 12:57:33
Message-ID: 20020209125733.30285.qmail@web20203.mail.yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Dear Bhuvaneswar,

Postgresql 7.2 has implemented this feature. For
7.1, I am afraid that you should recreate the table.

M.T.

--- Bhuvan A <bhuvansql(at)yahoo(dot)com> wrote:
>
> Hi,
>
> I am using postgresql 7.1. I was unable to add a
> new PRIMARY KEY
> constraint to an existing table.
>
> i have table,
> CREATE TABLE xx
> (
> id int,
> name text,
> amount int
> );
>
> I have say some 10 records in this table, which are
> unique and not
> null (primary). Fine! Now, i am willing to have
> primary key constraint
> to all the 3 fields.
>
> I tried,
>
> bhuvan=> ALTER TABLE xx ADD primary key (id, name,
> amount);
> ERROR: ALTER TABLE / ADD CONSTRAINT is not
> implemented for that
> constraint type.
>
> Where i am wrong? How else, can i get that primary
> key constraint
> WITHOUT RECREATING that table?
>
> Hope to get some lights.
>
> Regards,
> Bhuvaneswar.
>
>
>
> ---------------------------(end of
> broadcast)---------------------------
> TIP 1: subscribe and unsubscribe commands go to
majordomo(at)postgresql(dot)org

__________________________________________________
Do You Yahoo!?
Send FREE Valentine eCards with Yahoo! Greetings!
http://greetings.yahoo.com

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Stephan Szabo 2002-02-09 17:43:58 Re: Adding a New Composite Constraint to an Existing Table.
Previous Message Bhuvan A 2002-02-09 10:28:38 Adding a New Composite Constraint to an Existing Table.