diff options
Diffstat (limited to 'src/backend/utils/cache')
| -rw-r--r-- | src/backend/utils/cache/ts_cache.c | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/src/backend/utils/cache/ts_cache.c b/src/backend/utils/cache/ts_cache.c index 52a79e9996f..731cafd56cf 100644 --- a/src/backend/utils/cache/ts_cache.c +++ b/src/backend/utils/cache/ts_cache.c @@ -603,8 +603,26 @@ assignTSCurrentConfig(const char *newval, bool doit, GucSource source) cfgId = TSConfigGetCfgid(stringToQualifiedNameList(newval), true); + /* + * When source == PGC_S_TEST, we are checking the argument of an + * ALTER DATABASE SET or ALTER USER SET command. It could be that + * the intended use of the setting is for some other database, so + * we should not error out if the text search configuration is not + * present in the current database. We issue a NOTICE instead. + */ if (!OidIsValid(cfgId)) - return NULL; + { + if (source == PGC_S_TEST && !doit) + { + ereport(NOTICE, + (errcode(ERRCODE_UNDEFINED_OBJECT), + errmsg("text search configuration \"%s\" does not exist", + newval))); + return newval; + } + else + return NULL; + } /* * Modify the actually stored value to be fully qualified, to ensure |
