mirror of
https://github.com/postgres/postgres.git
synced 2025-11-29 23:43:17 +03:00
Standardize get_whatever_oid functions for other object types.
- Rename TSParserGetPrsid to get_ts_parser_oid. - Rename TSDictionaryGetDictid to get_ts_dict_oid. - Rename TSTemplateGetTmplid to get_ts_template_oid. - Rename TSConfigGetCfgid to get_ts_config_oid. - Rename FindConversionByName to get_conversion_oid. - Rename GetConstraintName to get_constraint_oid. - Add new functions get_opclass_oid, get_opfamily_oid, get_rewrite_oid, get_rewrite_oid_without_relid, get_trigger_oid, and get_cast_oid. The name of each function matches the corresponding catalog. Thanks to KaiGai Kohei for the review.
This commit is contained in:
@@ -13,7 +13,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $PostgreSQL: pgsql/src/backend/utils/adt/regproc.c,v 1.113 2010/02/14 18:42:16 rhaas Exp $
|
||||
* $PostgreSQL: pgsql/src/backend/utils/adt/regproc.c,v 1.114 2010/08/05 15:25:35 rhaas Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -1096,7 +1096,7 @@ regconfigin(PG_FUNCTION_ARGS)
|
||||
*/
|
||||
names = stringToQualifiedNameList(cfg_name_or_oid);
|
||||
|
||||
result = TSConfigGetCfgid(names, false);
|
||||
result = get_ts_config_oid(names, false);
|
||||
|
||||
PG_RETURN_OID(result);
|
||||
}
|
||||
@@ -1206,7 +1206,7 @@ regdictionaryin(PG_FUNCTION_ARGS)
|
||||
*/
|
||||
names = stringToQualifiedNameList(dict_name_or_oid);
|
||||
|
||||
result = TSDictionaryGetDictid(names, false);
|
||||
result = get_ts_dict_oid(names, false);
|
||||
|
||||
PG_RETURN_OID(result);
|
||||
}
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $PostgreSQL: pgsql/src/backend/utils/adt/tsvector_op.c,v 1.26 2010/01/02 16:57:55 momjian Exp $
|
||||
* $PostgreSQL: pgsql/src/backend/utils/adt/tsvector_op.c,v 1.27 2010/08/05 15:25:35 rhaas Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -1326,7 +1326,7 @@ tsvector_update_trigger(PG_FUNCTION_ARGS, bool config_column)
|
||||
(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
|
||||
errmsg("text search configuration name \"%s\" must be schema-qualified",
|
||||
trigger->tgargs[1])));
|
||||
cfgId = TSConfigGetCfgid(names, false);
|
||||
cfgId = get_ts_config_oid(names, false);
|
||||
}
|
||||
|
||||
/* initialize parse state */
|
||||
|
||||
6
src/backend/utils/cache/ts_cache.c
vendored
6
src/backend/utils/cache/ts_cache.c
vendored
@@ -20,7 +20,7 @@
|
||||
* Copyright (c) 2006-2010, PostgreSQL Global Development Group
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $PostgreSQL: pgsql/src/backend/utils/cache/ts_cache.c,v 1.12 2010/02/14 18:42:17 rhaas Exp $
|
||||
* $PostgreSQL: pgsql/src/backend/utils/cache/ts_cache.c,v 1.13 2010/08/05 15:25:35 rhaas Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -581,7 +581,7 @@ getTSCurrentConfig(bool emitError)
|
||||
|
||||
/* Look up the config */
|
||||
TSCurrentConfigCache =
|
||||
TSConfigGetCfgid(stringToQualifiedNameList(TSCurrentConfig),
|
||||
get_ts_config_oid(stringToQualifiedNameList(TSCurrentConfig),
|
||||
!emitError);
|
||||
|
||||
return TSCurrentConfigCache;
|
||||
@@ -601,7 +601,7 @@ assignTSCurrentConfig(const char *newval, bool doit, GucSource source)
|
||||
Form_pg_ts_config cfg;
|
||||
char *buf;
|
||||
|
||||
cfgId = TSConfigGetCfgid(stringToQualifiedNameList(newval), true);
|
||||
cfgId = get_ts_config_oid(stringToQualifiedNameList(newval), true);
|
||||
|
||||
if (!OidIsValid(cfgId))
|
||||
return NULL;
|
||||
|
||||
Reference in New Issue
Block a user