Re: What is the best way to create Primary Key on a large table in Postgresql 9.5?

Поиск
Список
Период
Сортировка
От David G. Johnston
Тема Re: What is the best way to create Primary Key on a large table in Postgresql 9.5?
Дата
Msg-id CAKFQuwau_S_7+sR87uE_D51Ta4BB3ySHyXbWWoxFur+AsQe-qQ@mail.gmail.com
обсуждение исходный текст
Ответ на Re: What is the best way to create Primary Key on a large table in Postgresql 9.5?  (Samed YILDIRIM <samed@reddoc.net>)
Список pgsql-admin
On Thu, Aug 18, 2016 at 5:05 PM, Samed YILDIRIM <samed@reddoc.net> wrote:

Hi Ravi,

You can use CREATE INDEX with CONCURRENTLY keyword. It will not lock your table during the process.

​After which you would do:

ALTER TABLE tbl ADD PRIMARY KEY USING INDEX <index name from above>;
 

See the note on the linked page advising this exact procedure.

David J. 

В списке pgsql-admin по дате отправления:

Предыдущее
От: Keith
Дата:
Сообщение: Re: What is the best way to create Primary Key on a large table in Postgresql 9.5?
Следующее
От: Ravi Tammineni
Дата:
Сообщение: Re: What is the best way to create Primary Key on a large table in Postgresql 9.5?