postgresql/src/backend/commands
Noah Misch f88cdb36c4 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 344d62fb9a introduced
unlogged sequences.

Reviewed (in an earlier version) by Robert Haas.

Discussion: https://postgr.es/m/20240611024525.9f.nmisch@google.com
2024-06-27 19:21:05 -07:00
..
aggregatecmds.c Remove unused #include's from backend .c files 2024-03-04 12:02:20 +01:00
alter.c Repair ALTER EXTENSION ... SET SCHEMA. 2024-05-09 12:19:52 -04:00
amcmds.c Fix typos and duplicate words 2024-04-18 21:28:07 +02:00
analyze.c revert: Generalize relation analyze in table AM interface 2024-04-16 13:14:20 +03:00
async.c Remove unused typedefs 2024-05-17 07:36:12 +02:00
cluster.c Avoid repeating loads of frozen ID values. 2024-04-29 10:25:33 -07:00
collationcmds.c Address more review comments on commit 2d819a08a1. 2024-03-18 11:58:13 -07:00
comment.c Update copyright for 2024 2024-01-03 20:49:05 -05:00
constraint.c Add missing index_insert_cleanup calls 2024-04-19 16:08:34 +02:00
conversioncmds.c Remove unused #include's from backend .c files 2024-03-04 12:02:20 +01:00
copy.c Disallow specifying ON_ERROR option without value. 2024-04-17 11:31:27 +09:00
copyfrom.c Fix typos and duplicate words 2024-04-18 21:28:07 +02:00
copyfromparse.c Remove obsolete comment in CopyReadLineText(). 2024-04-06 11:16:27 -04:00
copyto.c Add RETURNING support to MERGE. 2024-03-17 13:58:59 +00:00
createas.c Revert: Let table AM insertion methods control index insertion 2024-04-11 16:01:30 +03:00
dbcommands.c Fix locale options checking in CREATE DATABASE. 2024-04-30 17:32:03 -07:00
define.c Remove unused #include's from backend .c files 2024-03-04 12:02:20 +01:00
discard.c Update copyright for 2024 2024-01-03 20:49:05 -05:00
dropcmds.c Remove unused #include's from backend .c files 2024-03-04 12:02:20 +01:00
event_trigger.c Fix typos with function name in event_trigger.c 2024-04-17 14:56:31 +09:00
explain.c Fix some inconsistencies in EXPLAIN output 2024-05-16 12:50:16 +12:00
extension.c Repair ALTER EXTENSION ... SET SCHEMA. 2024-05-09 12:19:52 -04:00
foreigncmds.c Update copyright for 2024 2024-01-03 20:49:05 -05:00
functioncmds.c Fix handling of polymorphic output arguments for procedures. 2024-05-14 20:19:20 -04:00
indexcmds.c Revert temporal primary keys and foreign keys 2024-05-16 08:17:46 +02:00
lockcmds.c Reintroduce MAINTAIN privilege and pg_maintain predefined role. 2024-03-13 14:49:26 -05:00
Makefile Revert: Implement pg_wal_replay_wait() stored procedure 2024-04-11 17:28:15 +03:00
matview.c Revert: Let table AM insertion methods control index insertion 2024-04-11 16:01:30 +03:00
meson.build Revert: Implement pg_wal_replay_wait() stored procedure 2024-04-11 17:28:15 +03:00
opclasscmds.c Remove unused #include's from backend .c files 2024-03-04 12:02:20 +01:00
operatorcmds.c Remove unused #include's from backend .c files 2024-03-04 12:02:20 +01:00
policy.c Remove unused #include's from backend .c files 2024-03-04 12:02:20 +01:00
portalcmds.c Update copyright for 2024 2024-01-03 20:49:05 -05:00
prepare.c Remove unused #include's from backend .c files 2024-03-04 12:02:20 +01:00
proclang.c Remove unused #include's from backend .c files 2024-03-04 12:02:20 +01:00
publicationcmds.c Revise GUC names quoting in messages again 2024-05-17 11:44:26 +02:00
schemacmds.c Update copyright for 2024 2024-01-03 20:49:05 -05:00
seclabel.c Update copyright for 2024 2024-01-03 20:49:05 -05:00
sequence.c Lock owned sequences during ALTER TABLE SET { LOGGED | UNLOGGED }. 2024-06-27 19:21:05 -07:00
statscmds.c Initialize variables to placate compiler. 2024-03-17 20:16:15 -05:00
subscriptioncmds.c Fix the handling of the failover option in subscription commands. 2024-04-23 12:22:30 +05:30
tablecmds.c Harmonize function parameter names for Postgres 17. 2024-06-12 17:01:51 -04:00
tablespace.c Remove unused #include's from backend .c files 2024-03-04 12:02:20 +01:00
trigger.c Don't throw an error if a queued AFTER trigger no longer exists. 2024-06-20 14:21:36 -04:00
tsearchcmds.c Remove unused #include's from backend .c files 2024-03-04 12:02:20 +01:00
typecmds.c Revert temporal primary keys and foreign keys 2024-05-16 08:17:46 +02:00
user.c Remove unused #include's from backend .c files 2024-03-04 12:02:20 +01:00
vacuum.c Revise GUC names quoting in messages again 2024-05-17 11:44:26 +02:00
vacuumparallel.c Fix typos and duplicate words 2024-04-18 21:28:07 +02:00
variable.c Revise GUC names quoting in messages again 2024-05-17 11:44:26 +02:00
view.c Separate equalRowTypes() from equalTupleDescs() 2024-03-17 05:58:04 +01:00