public inbox for pgsql-admin@postgresql.org  
help / color / mirror / Atom feed
Are these metadata ALTER TABLE commands transactionally safe?
4+ messages / 2 participants
[nested] [flat]

* Are these metadata ALTER TABLE commands transactionally safe?
@ 2026-05-14 20:05 Ron Johnson <ronljohnsonjr@gmail.com>
  2026-05-14 21:26 ` Re: Are these metadata ALTER TABLE commands transactionally safe? David G. Johnston <david.g.johnston@gmail.com>
  0 siblings, 1 reply; 4+ messages in thread

From: Ron Johnson @ 2026-05-14 20:05 UTC (permalink / raw)
  To: Pgsql-admin <pgsql-admin@lists.postgresql.org>

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;

I don't trust the validity of synthetic tests when Prod is ill-behaved JDBC
connections.

-- 
Death to <Redacted>, and butter sauce.
Don't boil me, I'm still alive.
<Redacted> lobster!


^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: Are these metadata ALTER TABLE commands transactionally safe?
  2026-05-14 20:05 Are these metadata ALTER TABLE commands transactionally safe? Ron Johnson <ronljohnsonjr@gmail.com>
@ 2026-05-14 21:26 ` David G. Johnston <david.g.johnston@gmail.com>
  2026-05-15 01:03   ` Re: Are these metadata ALTER TABLE commands transactionally safe? Ron Johnson <ronljohnsonjr@gmail.com>
  0 siblings, 1 reply; 4+ messages in thread

From: David G. Johnston @ 2026-05-14 21:26 UTC (permalink / raw)
  To: Ron Johnson <ronljohnsonjr@gmail.com>; +Cc: Pgsql-admin <pgsql-admin@lists.postgresql.org>

On Thursday, May 14, 2026, Ron Johnson <ronljohnsonjr@gmail.com> 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”.


> I don't trust the validity of synthetic tests when Prod is ill-behaved
> JDBC connections.
>
>
Then do them over a local connection using psql?

David J.


^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: Are these metadata ALTER TABLE commands transactionally safe?
  2026-05-14 20:05 Are these metadata ALTER TABLE commands transactionally safe? Ron Johnson <ronljohnsonjr@gmail.com>
  2026-05-14 21:26 ` Re: Are these metadata ALTER TABLE commands transactionally safe? David G. Johnston <david.g.johnston@gmail.com>
@ 2026-05-15 01:03   ` Ron Johnson <ronljohnsonjr@gmail.com>
  2026-05-15 01:13     ` Re: Are these metadata ALTER TABLE commands transactionally safe? David G. Johnston <david.g.johnston@gmail.com>
  0 siblings, 1 reply; 4+ messages in thread

From: Ron Johnson @ 2026-05-15 01:03 UTC (permalink / raw)
  To: Pgsql-admin <pgsql-admin@lists.postgresql.org>

On Thu, May 14, 2026 at 5:26 PM David G. Johnston <
david.g.johnston@gmail.com> wrote:

> On Thursday, May 14, 2026, Ron Johnson <ronljohnsonjr@gmail.com> 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.


>
>
>> I don't trust the validity of synthetic tests when Prod is ill-behaved
>> JDBC connections.
>>
>>
> Then do them over a local connection using psql?
>

The applications which I don't want to throw errors are ill-behaved JDBC
connections.  Sorry for the ambiguity.

-- 
Death to <Redacted>, and butter sauce.
Don't boil me, I'm still alive.
<Redacted> lobster!


^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: Are these metadata ALTER TABLE commands transactionally safe?
  2026-05-14 20:05 Are these metadata ALTER TABLE commands transactionally safe? Ron Johnson <ronljohnsonjr@gmail.com>
  2026-05-14 21:26 ` Re: Are these metadata ALTER TABLE commands transactionally safe? David G. Johnston <david.g.johnston@gmail.com>
  2026-05-15 01:03   ` Re: Are these metadata ALTER TABLE commands transactionally safe? Ron Johnson <ronljohnsonjr@gmail.com>
@ 2026-05-15 01:13     ` David G. Johnston <david.g.johnston@gmail.com>
  0 siblings, 0 replies; 4+ messages in thread

From: David G. Johnston @ 2026-05-15 01:13 UTC (permalink / raw)
  To: Ron Johnson <ronljohnsonjr@gmail.com>; +Cc: Pgsql-admin <pgsql-admin@lists.postgresql.org>

On Thursday, May 14, 2026, Ron Johnson <ronljohnsonjr@gmail.com> wrote:

> On Thu, May 14, 2026 at 5:26 PM David G. Johnston <
> david.g.johnston@gmail.com> wrote:
>
>> On Thursday, May 14, 2026, Ron Johnson <ronljohnsonjr@gmail.com> 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.


^ permalink  raw  reply  [nested|flat] 4+ messages in thread


end of thread, other threads:[~2026-05-15 01:13 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2026-05-14 20:05 Are these metadata ALTER TABLE commands transactionally safe? Ron Johnson <ronljohnsonjr@gmail.com>
2026-05-14 21:26 ` David G. Johnston <david.g.johnston@gmail.com>
2026-05-15 01:03   ` Ron Johnson <ronljohnsonjr@gmail.com>
2026-05-15 01:13     ` David G. Johnston <david.g.johnston@gmail.com>

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