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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Aug 18, 2016 at 5:05 PM, Samed YILDIRIM <samed@xxxxxxxxxx> 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. 

[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux