summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/backend/commands/tsearchcmds.c10
-rw-r--r--src/backend/tcop/utility.c3
-rw-r--r--src/include/commands/defrem.h3
3 files changed, 13 insertions, 3 deletions
diff --git a/src/backend/commands/tsearchcmds.c b/src/backend/commands/tsearchcmds.c
index 45bafd31707..4c404e73d09 100644
--- a/src/backend/commands/tsearchcmds.c
+++ b/src/backend/commands/tsearchcmds.c
@@ -964,7 +964,7 @@ makeConfigurationDependencies(HeapTuple tuple, bool removeOld,
* CREATE TEXT SEARCH CONFIGURATION
*/
ObjectAddress
-DefineTSConfiguration(List *names, List *parameters)
+DefineTSConfiguration(List *names, List *parameters, ObjectAddress *copied)
{
Relation cfgRel;
Relation mapRel = NULL;
@@ -1013,6 +1013,14 @@ DefineTSConfiguration(List *names, List *parameters)
(errcode(ERRCODE_SYNTAX_ERROR),
errmsg("cannot specify both PARSER and COPY options")));
+ /* make copied tsconfig available to callers */
+ if (copied && OidIsValid(sourceOid))
+ {
+ ObjectAddressSet(*copied,
+ TSConfigRelationId,
+ sourceOid);
+ }
+
/*
* Look up source config if given.
*/
diff --git a/src/backend/tcop/utility.c b/src/backend/tcop/utility.c
index d9443b1496a..fd09d3ad9ed 100644
--- a/src/backend/tcop/utility.c
+++ b/src/backend/tcop/utility.c
@@ -1129,7 +1129,8 @@ ProcessUtilitySlow(Node *parsetree,
case OBJECT_TSCONFIGURATION:
Assert(stmt->args == NIL);
DefineTSConfiguration(stmt->defnames,
- stmt->definition);
+ stmt->definition,
+ NULL);
break;
case OBJECT_COLLATION:
Assert(stmt->args == NIL);
diff --git a/src/include/commands/defrem.h b/src/include/commands/defrem.h
index a9c67838a63..595f93f79a5 100644
--- a/src/include/commands/defrem.h
+++ b/src/include/commands/defrem.h
@@ -101,7 +101,8 @@ extern ObjectAddress AlterTSDictionary(AlterTSDictionaryStmt *stmt);
extern ObjectAddress DefineTSTemplate(List *names, List *parameters);
extern void RemoveTSTemplateById(Oid tmplId);
-extern ObjectAddress DefineTSConfiguration(List *names, List *parameters);
+extern ObjectAddress DefineTSConfiguration(List *names, List *parameters,
+ ObjectAddress *copied);
extern void RemoveTSConfigurationById(Oid cfgId);
extern ObjectAddress AlterTSConfiguration(AlterTSConfigurationStmt *stmt);