1
0
mirror of https://github.com/postgres/postgres.git synced 2025-06-16 06:01:02 +03:00

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.
This commit is contained in:
Robert Haas
2010-08-05 14:45:09 +00:00
parent 641459f269
commit 2a6ef3445c
25 changed files with 259 additions and 437 deletions

View File

@ -26,7 +26,7 @@
*
*
* IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/executor/execMain.c,v 1.353 2010/07/25 23:21:21 rhaas Exp $
* $PostgreSQL: pgsql/src/backend/executor/execMain.c,v 1.354 2010/08/05 14:45:02 rhaas Exp $
*
*-------------------------------------------------------------------------
*/
@ -2134,12 +2134,7 @@ OpenIntoRel(QueryDesc *queryDesc)
*/
if (into->tableSpaceName)
{
tablespaceId = get_tablespace_oid(into->tableSpaceName);
if (!OidIsValid(tablespaceId))
ereport(ERROR,
(errcode(ERRCODE_UNDEFINED_OBJECT),
errmsg("tablespace \"%s\" does not exist",
into->tableSpaceName)));
tablespaceId = get_tablespace_oid(into->tableSpaceName, false);
}
else
{