Re: ALTER TABLE and vacuum

From: Vik Fearing <vik(at)2ndquadrant(dot)fr>
To: Rick Widmer <pgsql(at)rickwidmer(dot)com>, pgsql-general(at)postgresql(dot)org
Subject: Re: ALTER TABLE and vacuum
Date: 2016-06-06 09:01:38
Message-ID: 57553BF2.3000002@2ndquadrant.fr
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 06/06/16 10:55, Rick Widmer wrote:
> Do I need to vacuum after an alter table command?

If the specific command you do rewrites the table, you absolutely should
vacuum in order to restore the visibility map. Otherwise, it not necessary.

> Does it matter if there is a default or if we accept NULLs for the new
> field?

Yes, that makes a difference. If you add a column that defaults to
NULL, the table will not be rewritten.
--
Vik Fearing +33 6 46 75 15 36
http://2ndQuadrant.fr PostgreSQL : Expertise, Formation et Support

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Wim Bertels 2016-06-06 10:42:45 mobile apps: async repl/sync
Previous Message Rick Widmer 2016-06-06 08:55:35 ALTER TABLE and vacuum