... 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.
* CREATE TEXT SEARCH CONFIGURATION
*/
ObjectAddress
-DefineTSConfiguration(List *names, List *parameters)
+DefineTSConfiguration(List *names, List *parameters, ObjectAddress *copied)
{
Relation cfgRel;
Relation mapRel = NULL;
(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.
*/
case OBJECT_TSCONFIGURATION:
Assert(stmt->args == NIL);
DefineTSConfiguration(stmt->defnames,
- stmt->definition);
+ stmt->definition,
+ NULL);
break;
case OBJECT_COLLATION:
Assert(stmt->args == NIL);
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);