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
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;
This includes tests for all relation option types:
- boolean
+- enum
- integer
- real
- strings (with and without NULL as default)
option_bool = false,
option_int = 5,
option_real = 3.1,
+ option_enum = 'two',
option_string_val = NULL,
option_string_null = 'val');
NOTICE: new option value for string parameter null
option_bool=false
option_int=5
option_real=3.1
+ option_enum=two
option_string_val=null
option_string_null=val
-(5 rows)
+(6 rows)
-- ALTER INDEX .. SET
ALTER INDEX dummy_test_idx SET (option_int = 10);
option_bool = false,
option_int = 5,
option_real = 3.1,
+ option_enum = 'two',
option_string_val = NULL,
option_string_null = 'val');
-- Silence again validation checks for strings until the end of the test.