mirror of
https://github.com/postgres/postgres.git
synced 2025-07-02 09:02:37 +03:00
Fix lockmode initialization for custom relation options
The code was enforcing AccessExclusiveLock for all custom relation
options, which is incorrect as the APIs allow a custom lock level to be
set.
While on it, fix a couple of inconsistencies in the tests and the README
of dummy_index_am.
Oversights in commit 773df88
.
Discussion: https://postgr.es/m/20190925234152.GA2115@paquier.xyz
This commit is contained in:
@ -700,13 +700,6 @@ allocate_reloption(bits32 kinds, int type, const char *name, const char *desc,
|
||||
newoption->type = type;
|
||||
newoption->lockmode = lockmode;
|
||||
|
||||
/*
|
||||
* Set the default lock mode for this option. There is no actual way
|
||||
* for a module to enforce it when declaring a custom relation option,
|
||||
* so just use the highest level, which is safe for all cases.
|
||||
*/
|
||||
newoption->lockmode = AccessExclusiveLock;
|
||||
|
||||
MemoryContextSwitchTo(oldcxt);
|
||||
|
||||
return newoption;
|
||||
|
Reference in New Issue
Block a user