| От | Stephan Szabo |
|---|---|
| Тема | Re: how to add primary key to existing table with multiple |
| Дата | |
| Msg-id | 20060228185121.O86334@megazone.bigpanda.com обсуждение |
| Ответ на | how to add primary key to existing table with multiple primary keys ("Daniel Joo" <djoo@vistagen-inc.com>) |
| Список | pgsql-sql |
On Thu, 23 Feb 2006, Daniel Joo wrote: > 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: You only can have one primary key. The table you gave has a single primary key with two columns. Are you trying to guarantee that expid along is unique or that the set (probeid, tissueid, expid) is unique? You can make expid UNIQUE and NOT NULL for the first case which is similar to a primary key (although it's not a default foreign key target). In the second you can drop the current constraint and add one on the three columns. > Indexes: > > "extprobe2tissue_pkey" PRIMARY KEY, btree (probeid, tissueid) > "extprobe2tissue_probeid" btree (probeid) > "extprobe2tissue_tissueid" btree (tissueid)
В списке pgsql-sql по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера