diff options
author | Michael Paquier <michael@paquier.xyz> | 2019-09-25 10:13:52 +0900 |
---|---|---|
committer | Michael Paquier <michael@paquier.xyz> | 2019-09-25 10:13:52 +0900 |
commit | 69f94108079d70093b59096a3ae0ad82c842b4c0 (patch) | |
tree | b8caed9bae606203a6a5f069c2d5f6a3dc82c306 /contrib/bloom/blutils.c | |
parent | 736b84eede6cfdadf1114cf5a0e950d7f4986d82 (diff) |
Allow definition of lock mode for custom reloptions
Relation options can define a lock mode other than AccessExclusiveMode
since 47167b7, but modules defining custom relation options did not
really have a way to enforce that. Correct that by extending the
current API set so as modules can define a custom lock mode.
Author: Michael Paquier
Reviewed-by: Kuntal Ghosh
Discussion: https://postgr.es/m/20190920013831.GD1844@paquier.xyz
Diffstat (limited to 'contrib/bloom/blutils.c')
-rw-r--r-- | contrib/bloom/blutils.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/contrib/bloom/blutils.c b/contrib/bloom/blutils.c index cc1670934fb..dbb24cb5b24 100644 --- a/contrib/bloom/blutils.c +++ b/contrib/bloom/blutils.c @@ -60,7 +60,8 @@ _PG_init(void) /* Option for length of signature */ add_int_reloption(bl_relopt_kind, "length", "Length of signature in bits", - DEFAULT_BLOOM_LENGTH, 1, MAX_BLOOM_LENGTH); + DEFAULT_BLOOM_LENGTH, 1, MAX_BLOOM_LENGTH, + AccessExclusiveLock); bl_relopt_tab[0].optname = "length"; bl_relopt_tab[0].opttype = RELOPT_TYPE_INT; bl_relopt_tab[0].offset = offsetof(BloomOptions, bloomLength); @@ -71,7 +72,8 @@ _PG_init(void) snprintf(buf, sizeof(buf), "col%d", i + 1); add_int_reloption(bl_relopt_kind, buf, "Number of bits generated for each index column", - DEFAULT_BLOOM_BITS, 1, MAX_BLOOM_BITS); + DEFAULT_BLOOM_BITS, 1, MAX_BLOOM_BITS, + AccessExclusiveLock); bl_relopt_tab[i + 1].optname = MemoryContextStrdup(TopMemoryContext, buf); bl_relopt_tab[i + 1].opttype = RELOPT_TYPE_INT; |