mirror of
https://git.postgresql.org/git/postgresql.git
synced 2024-12-15 08:20:16 +08:00
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 a2e35b53c3
.
This commit is contained in:
parent
b3196e65f5
commit
8217fb1441
@ -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.
|
||||
*/
|
||||
|
@ -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);
|
||||
|
@ -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);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user