public inbox for [email protected]  
help / color / mirror / Atom feed
From: David G. Johnston <[email protected]>
To: Ron Johnson <[email protected]>
Cc: Pgsql-admin <[email protected]>
Subject: Re: Are these metadata ALTER TABLE commands transactionally safe?
Date: Thu, 14 May 2026 18:13:03 -0700
Message-ID: <CAKFQuwYNKr8_ro8_-jwbfxwGaOWrA9e7-9E3+1mboMAPnR-V+w@mail.gmail.com> (raw)
In-Reply-To: <CANzqJaAqg37Q7HM6uo=BRE2c6_==kawD8EBO6og_MbTp-ayo4w@mail.gmail.com>
References: <CANzqJaB2NCCvyigAWH3=1G=2A-oybCo-oQXxWF4UuniCebqhPQ@mail.gmail.com>
	<CAKFQuwbZQ6nquZaw3Xoa2GyFa0_kGzmuVAH71LN7tO-z+sAoAA@mail.gmail.com>
	<CANzqJaAqg37Q7HM6uo=BRE2c6_==kawD8EBO6og_MbTp-ayo4w@mail.gmail.com>

On Thursday, May 14, 2026, Ron Johnson <[email protected]> wrote:

> On Thu, May 14, 2026 at 5:26 PM David G. Johnston <
> [email protected]> wrote:
>
>> On Thursday, May 14, 2026, Ron Johnson <[email protected]> wrote:
>>
>>> PG 17.9
>>>
>>> BEGIN;
>>> ALTER TABLE x RENAME TO x_hold;
>>> ALTER TABLE y.x SET SCHEMA a;
>>> ALTER TABLE x OWNER TO foo;
>>> COMMIT;
>>>
>>>
>> Define “transactionally safe”.
>>
>
> Any open transactions will still see the original tables.
>
>

That would involve locking, most DDL simply won’t happen while open
transactions are using the objects.  Normal visibility semantics then apply
beyond that - which depend on isolation level.

David J.


reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected], [email protected], [email protected]
  Subject: Re: Are these metadata ALTER TABLE commands transactionally safe?
  In-Reply-To: <CAKFQuwYNKr8_ro8_-jwbfxwGaOWrA9e7-9E3+1mboMAPnR-V+w@mail.gmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox