| От | Dmitry Tkach |
|---|---|
| Тема | Re: Recreating a primary key |
| Дата | |
| Msg-id | 3E5FE2EA.6090200@openratings.com обсуждение исходный текст |
| Ответ на | Recreating a primary key (Ericson Smith <eric@did-it.com>) |
| Список | pgsql-general |
Ericson Smith wrote: > Hi, > > Is there a way to re-create a primary key? > > So I create tables with CREATE TABLE... PRIMARY KEY(col...) syntax. > > I later want to drop the primary key and re-create it (performance > considerations, and to not worry about exclusive table locking with a > rebuild index). > > The documentation says that primary keys are basically UNIQUE and NOT > NULL keys, but checking with pg_index, I see the "indisprimary" column > is set to true. > > Any quick and dirty way to rebuild these indices? > > Not sure I understand what you mean - whatever "quick and dirty" way you choose to rebuild an index, it has to lock the table, because otherwise the resulting index will be incorrect...
В списке pgsql-general по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера