mirror of
https://github.com/postgres/postgres.git
synced 2025-07-08 11:42:09 +03:00
Adjust more backend functions to return OID rather than void.
This is again intended to support extensions to the event trigger functionality. This may go a bit further than we need for that purpose, but there's some value in being consistent, and the OID may be useful for other purposes also. Dimitri Fontaine
This commit is contained in:
@ -614,7 +614,7 @@ RemoveTSDictionaryById(Oid dictId)
|
||||
/*
|
||||
* ALTER TEXT SEARCH DICTIONARY
|
||||
*/
|
||||
void
|
||||
Oid
|
||||
AlterTSDictionary(AlterTSDictionaryStmt *stmt)
|
||||
{
|
||||
HeapTuple tup,
|
||||
@ -722,6 +722,8 @@ AlterTSDictionary(AlterTSDictionaryStmt *stmt)
|
||||
ReleaseSysCache(tup);
|
||||
|
||||
heap_close(rel, RowExclusiveLock);
|
||||
|
||||
return dictId;
|
||||
}
|
||||
|
||||
/* ---------------------- TS Template commands -----------------------*/
|
||||
@ -1349,10 +1351,11 @@ RemoveTSConfigurationById(Oid cfgId)
|
||||
/*
|
||||
* ALTER TEXT SEARCH CONFIGURATION - main entry point
|
||||
*/
|
||||
void
|
||||
Oid
|
||||
AlterTSConfiguration(AlterTSConfigurationStmt *stmt)
|
||||
{
|
||||
HeapTuple tup;
|
||||
Oid cfgId;
|
||||
Relation relMap;
|
||||
|
||||
/* Find the configuration */
|
||||
@ -1363,6 +1366,8 @@ AlterTSConfiguration(AlterTSConfigurationStmt *stmt)
|
||||
errmsg("text search configuration \"%s\" does not exist",
|
||||
NameListToString(stmt->cfgname))));
|
||||
|
||||
cfgId = HeapTupleGetOid(tup);
|
||||
|
||||
/* must be owner */
|
||||
if (!pg_ts_config_ownercheck(HeapTupleGetOid(tup), GetUserId()))
|
||||
aclcheck_error(ACLCHECK_NOT_OWNER, ACL_KIND_TSCONFIGURATION,
|
||||
@ -1382,6 +1387,8 @@ AlterTSConfiguration(AlterTSConfigurationStmt *stmt)
|
||||
heap_close(relMap, RowExclusiveLock);
|
||||
|
||||
ReleaseSysCache(tup);
|
||||
|
||||
return cfgId;
|
||||
}
|
||||
|
||||
/*
|
||||
|
Reference in New Issue
Block a user