pgsql: Lock owned sequences during ALTER TABLE SET { LOGGED | UNLOGGED

Поиск
Список
Период
Сортировка
От Noah Misch
Тема pgsql: Lock owned sequences during ALTER TABLE SET { LOGGED | UNLOGGED
Дата
Msg-id E1sN1K9-003Iz8-Oo@gemulon.postgresql.org
обсуждение исходный текст
Список pgsql-committers
Lock owned sequences during ALTER TABLE SET { LOGGED | UNLOGGED }.

These commands already make the persistence of owned sequences follow
owned table persistence changes.  They didn't lock those sequences.
They lost the effect of nextval() calls that other sessions make after
the ALTER TABLE command, before the ALTER TABLE transaction commits.
Fix by acquiring the same lock that ALTER SEQUENCE SET { LOGGED |
UNLOGGED } acquires.  This might cause more deadlocks.  Back-patch to
v15, where commit 344d62fb9a978a72cf8347f0369b9ee643fd0b31 introduced
unlogged sequences.

Reviewed (in an earlier version) by Robert Haas.

Discussion: https://postgr.es/m/20240611024525.9f.nmisch@google.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/f88cdb36c457f673a1966a22883ce47e565a37db

Modified Files
--------------
src/backend/commands/sequence.c | 7 +++++++
1 file changed, 7 insertions(+)


В списке pgsql-committers по дате отправления:

Предыдущее
От: Amit Langote
Дата:
Сообщение: pgsql: SQL/JSON: Document behavior when input document is not jsonb
Следующее
От: Noah Misch
Дата:
Сообщение: pgsql: Remove comment about xl_heap_inplace "AT END OF STRUCT".