]> git.ipfire.org Git - thirdparty/postgresql.git/commit
AccessExclusiveLock new relations just after assigning the OID.
authorNoah Misch <noah@leadboat.com>
Fri, 28 Jun 2024 02:21:05 +0000 (19:21 -0700)
committerNoah Misch <noah@leadboat.com>
Fri, 28 Jun 2024 02:21:11 +0000 (19:21 -0700)
commit0f2835ea6fc140869b062f61c62a87acf3295153
tree6f9454397309bced0247b6c0a18ada8a397c5d88
parenta338e41374e4cf7efded6839ac58a60916b31ba7
AccessExclusiveLock new relations just after assigning the OID.

This has no user-visible, important consequences, since other sessions'
catalog scans can't find the relation until we commit.  However, this
unblocks introducing a rule about locks required to heap_update() a
pg_class row.  CREATE TABLE has been acquiring this lock eventually, but
it can heap_update() pg_class.relchecks earlier.  create_toast_table()
has been acquiring only ShareLock.  Back-patch to v12 (all supported
versions), the plan for the commit relying on the new rule.

Reviewed (in an earlier version) by Robert Haas.

Discussion: https://postgr.es/m/20240611024525.9f.nmisch@google.com
src/backend/catalog/heap.c