diff options
author | Robert Haas <rhaas@postgresql.org> | 2010-08-05 14:45:09 +0000 |
---|---|---|
committer | Robert Haas <rhaas@postgresql.org> | 2010-08-05 14:45:09 +0000 |
commit | 2a6ef3445c73473edb222abf108b323fb7f002dc (patch) | |
tree | ca6a6f51dcf5193303f466c4072b243e3f979227 /src/backend/commands/indexcmds.c | |
parent | 641459f26954b04f74d098a758b716297b6554ea (diff) |
Standardize get_whatever_oid functions for object types with
unqualified names.
- Add a missing_ok parameter to get_tablespace_oid.
- Avoid duplicating get_tablespace_od guts in objectNamesToOids.
- Add a missing_ok parameter to get_database_oid.
- Replace get_roleid and get_role_checked with get_role_oid.
- Add get_namespace_oid, get_language_oid, get_am_oid.
- Refactor existing code to use new interfaces.
Thanks to KaiGai Kohei for the review.
Diffstat (limited to 'src/backend/commands/indexcmds.c')
-rw-r--r-- | src/backend/commands/indexcmds.c | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c index 780dbc23ede..e1ae6b2a13c 100644 --- a/src/backend/commands/indexcmds.c +++ b/src/backend/commands/indexcmds.c @@ -8,7 +8,7 @@ * * * IDENTIFICATION - * $PostgreSQL: pgsql/src/backend/commands/indexcmds.c,v 1.198 2010/07/06 19:18:56 momjian Exp $ + * $PostgreSQL: pgsql/src/backend/commands/indexcmds.c,v 1.199 2010/08/05 14:45:00 rhaas Exp $ * *------------------------------------------------------------------------- */ @@ -218,12 +218,7 @@ DefineIndex(RangeVar *heapRelation, */ if (tableSpaceName) { - tablespaceId = get_tablespace_oid(tableSpaceName); - if (!OidIsValid(tablespaceId)) - ereport(ERROR, - (errcode(ERRCODE_UNDEFINED_OBJECT), - errmsg("tablespace \"%s\" does not exist", - tableSpaceName))); + tablespaceId = get_tablespace_oid(tableSpaceName, false); } else { |