summaryrefslogtreecommitdiff
path: root/src/backend/utils/cache/ts_cache.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/backend/utils/cache/ts_cache.c')
-rw-r--r--src/backend/utils/cache/ts_cache.c20
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 9c4e72f24e9..e895a990315 100644
--- a/src/backend/utils/cache/ts_cache.c
+++ b/src/backend/utils/cache/ts_cache.c
@@ -608,8 +608,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