Re: What is the best way to create Primary Key on a large table in Postgresql 9.5? - Mailing list pgsql-admin

From David G. Johnston
Subject Re: What is the best way to create Primary Key on a large table in Postgresql 9.5?
Date
Msg-id CAKFQuwaBvCEPfGA3DUBS6dKJ7M+ZTpLFRKa=2yL=6pm3Xc9TOg@mail.gmail.com
Whole thread Raw
In response to Re: What is the best way to create Primary Key on a large table in Postgresql 9.5?  (Ravi Tammineni <rtammineni@partner.aligntech.com>)
List pgsql-admin
On Thu, Aug 18, 2016 at 5:19 PM, Ravi Tammineni <rtammineni@partner.aligntech.com> wrote:

 I have to add a new id column to the existing table,


You will have to write/create a brand new table file.  That will take time.  I suspect that using some combination of views and triggers, and object renaming, will allow you to put together a custom scheme to do this with minimal impact on production (though you cannot avoid the I/O, you can maybe spread it out).

A lot depends on the exact usage pattern of the table in question.

David J.


pgsql-admin by date:

Previous
From: Ravi Tammineni
Date:
Subject: Re: What is the best way to create Primary Key on a large table in Postgresql 9.5?
Next
From: Esteban Casuscelli
Date:
Subject: Re: What is the best way to create Primary Key on a large table in Postgresql 9.5?