pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Daniel Joo <djoo@vistagen-inc.com>
To: pgsql-sql@postgresql.org
Subject: how to add primary key to existing table with multiple primary keys
Date: Thu, 23 Feb 2006 17:45:03 -0800
Message-ID: <20060224015148.A9BB99DC9E3@postgresql.org> (raw)

Hi there,

 

I am trying to add another primary key to an existing table with two other
primary keys.  I got the following error when I tried this command:

 

alter table extprobe2tissue ADD primary key (expid);

ERROR:  multiple primary keys for table "extprobe2tissue" are not allowed

 

The details of the extprobe2tissue table is: 

 

\d extprobe2tissue;

          Table "public.extprobe2tissue"

   Column    |          Type          | Modifiers

-------------+------------------------+-----------

 probeid     | integer                | not null

 tissueid    | integer                | not null

 value       | double precision       | not null

 entrydate   | date                   | not null

 description | character varying(200) |

 qval        | double precision       |

 expid       | integer                | not null

Indexes:

    "extprobe2tissue_pkey" PRIMARY KEY, btree (probeid, tissueid)

    "extprobe2tissue_probeid" btree (probeid)

    "extprobe2tissue_tissueid" btree (tissueid)

Foreign-key constraints:

    "extprobe2tissue_tissueid_fkey" FOREIGN KEY (tissueid) REFERENCES
tissue(tissueid)

    "extprobe2tissue_probeid_fkey" FOREIGN KEY (probeid) REFERENCES
extprobe(probeid)

 

Any suggestion would be much appreciated.

 

Thanks!  

view thread (3+ messages)  latest in thread

Message-ID: <20060224015148.A9BB99DC9E3@postgresql.org>
Permalink:  ../20060224015148.A9BB99DC9E3@postgresql.org/
Also on:    postgresql.org/message-id/20060224015148.A9BB99DC9E3@postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: djoo@vistagen-inc.com
  Subject: Re: how to add primary key to existing table with multiple primary keys
  In-Reply-To: <20060224015148.A9BB99DC9E3@postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox