summaryrefslogtreecommitdiff
path: root/src/backend/commands
diff options
context:
space:
mode:
authorAlvaro Herrera2015-03-25 18:57:08 +0000
committerAlvaro Herrera2015-03-25 18:57:08 +0000
commit8217fb1441ce4b4e1785f9acfa0ce50039247a10 (patch)
tree48f8c77a36f1bf9617e202fcc60ab63c574797ac /src/backend/commands
parentb3196e65f5bfc997ec7fa3f91645a09289c10dee (diff)
Add OID output argument to DefineTSConfiguration
... which is set to the OID of a copied text search config, whenever the COPY clause is used. This is in the spirit of commit a2e35b53c39.
Diffstat (limited to 'src/backend/commands')
-rw-r--r--src/backend/commands/tsearchcmds.c10
1 files changed, 9 insertions, 1 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.
*/