Re: Migrating tables to new schema with minimal downtime

From: hubert depesz lubaczewski <depesz(at)depesz(dot)com>
To: Joseph Hammerman <joe(dot)hammerman(at)datadoghq(dot)com>
Cc: pgsql-admin(at)lists(dot)postgresql(dot)org
Subject: Re: Migrating tables to new schema with minimal downtime
Date: 2023-03-07 11:59:58
Message-ID: ZAcnPjgwX4zF5QXf@depesz.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

On Mon, Mar 06, 2023 at 01:00:15PM -0800, Joseph Hammerman wrote:
> Would it be data safe if I took an ACCESS EXCLUSIVE lock on the table?

alter table gets ACCESS EXCLUSIVE lock on its own.

You can test it trivially in psql on some side table.

Best regards,

depesz

In response to

Browse pgsql-admin by date

  From Date Subject
Next Message Erik Serrano 2023-03-07 15:42:15 Replication between two different versions
Previous Message Laurenz Albe 2023-03-07 06:29:19 Re: Migrating tables to new schema with minimal downtime