mirror of
https://github.com/postgres/postgres.git
synced 2025-10-24 01:29:19 +03:00
Reduce lock levels for ALTER TABLE SET autovacuum storage options
Reduce lock levels down to ShareUpdateExclusiveLock for all autovacuum-related relation options when setting them using ALTER TABLE. Add infrastructure to allow varying lock levels for relation options in later patches. Setting multiple options together uses the highest lock level required for any option. Works for both main and toast tables. Fabrízio Mello, reviewed by Michael Paquier, mild edit and additional regression tests from myself
This commit is contained in:
@@ -22,6 +22,7 @@
|
||||
#include "access/htup.h"
|
||||
#include "access/tupdesc.h"
|
||||
#include "nodes/pg_list.h"
|
||||
#include "storage/lock.h"
|
||||
|
||||
/* types supported by reloptions */
|
||||
typedef enum relopt_type
|
||||
@@ -62,6 +63,7 @@ typedef struct relopt_gen
|
||||
* marker) */
|
||||
const char *desc;
|
||||
bits32 kinds;
|
||||
LOCKMODE lockmode;
|
||||
int namelen;
|
||||
relopt_type type;
|
||||
} relopt_gen;
|
||||
@@ -274,5 +276,6 @@ extern bytea *index_reloptions(RegProcedure amoptions, Datum reloptions,
|
||||
bool validate);
|
||||
extern bytea *attribute_reloptions(Datum reloptions, bool validate);
|
||||
extern bytea *tablespace_reloptions(Datum reloptions, bool validate);
|
||||
extern LOCKMODE AlterTableGetRelOptionsLockLevel(List *defList);
|
||||
|
||||
#endif /* RELOPTIONS_H */
|
||||
|
||||
Reference in New Issue
Block a user