aboutsummaryrefslogtreecommitdiff
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.c19
1 files changed, 18 insertions, 1 deletions
diff --git a/src/backend/utils/cache/ts_cache.c b/src/backend/utils/cache/ts_cache.c
index a8c4d76565a..6a6cbbf90c1 100644
--- a/src/backend/utils/cache/ts_cache.c
+++ b/src/backend/utils/cache/ts_cache.c
@@ -604,8 +604,25 @@ check_TSCurrentConfig(char **newval, void **extra, GucSource source)
cfgId = get_ts_config_oid(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 false;
+ {
+ if (source == PGC_S_TEST)
+ {
+ ereport(NOTICE,
+ (errcode(ERRCODE_UNDEFINED_OBJECT),
+ errmsg("text search configuration \"%s\" does not exist", *newval)));
+ return true;
+ }
+ else
+ return false;
+ }
/*
* Modify the actually stored value to be fully qualified, to ensure