mirror of
https://git.postgresql.org/git/postgresql.git
synced 2024-12-27 08:39:28 +08:00
Replace RelidGetNamespaceId() by get_rel_namespace().
This commit is contained in:
parent
6f4855842c
commit
13437d1e9c
@ -13,7 +13,7 @@
|
|||||||
* Portions Copyright (c) 1994, Regents of the University of California
|
* Portions Copyright (c) 1994, Regents of the University of California
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $Header: /cvsroot/pgsql/src/backend/catalog/namespace.c,v 1.44 2003/01/10 22:03:27 petere Exp $
|
* $Header: /cvsroot/pgsql/src/backend/catalog/namespace.c,v 1.45 2003/01/12 18:19:37 petere Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@ -278,29 +278,6 @@ RelnameGetRelid(const char *relname)
|
|||||||
return InvalidOid;
|
return InvalidOid;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* RelidGetNamespaceId
|
|
||||||
* Given a relation OID, return the namespace OID.
|
|
||||||
*/
|
|
||||||
Oid
|
|
||||||
RelidGetNamespaceId(Oid relid)
|
|
||||||
{
|
|
||||||
HeapTuple tuple;
|
|
||||||
Form_pg_class pg_class_form;
|
|
||||||
Oid result;
|
|
||||||
|
|
||||||
tuple = SearchSysCache(RELOID,
|
|
||||||
ObjectIdGetDatum(relid),
|
|
||||||
0, 0, 0);
|
|
||||||
if (!HeapTupleIsValid(tuple))
|
|
||||||
elog(ERROR, "cache lookup failed for relation %u", relid);
|
|
||||||
pg_class_form = (Form_pg_class) GETSTRUCT(tuple);
|
|
||||||
|
|
||||||
result = pg_class_form->relnamespace;
|
|
||||||
ReleaseSysCache(tuple);
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* RelationIsVisible
|
* RelationIsVisible
|
||||||
|
@ -26,7 +26,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $Header: /cvsroot/pgsql/src/backend/executor/execMain.c,v 1.197 2003/01/10 22:03:27 petere Exp $
|
* $Header: /cvsroot/pgsql/src/backend/executor/execMain.c,v 1.198 2003/01/12 18:19:37 petere Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@ -419,7 +419,7 @@ ExecCheckXactReadOnly(Query *parsetree, CmdType operation)
|
|||||||
if (!rte->checkForWrite)
|
if (!rte->checkForWrite)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (isTempNamespace(RelidGetNamespaceId(rte->relid)))
|
if (isTempNamespace(get_rel_namespace(rte->relid)))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
goto fail;
|
goto fail;
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
* Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group
|
* Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group
|
||||||
* Portions Copyright (c) 1994, Regents of the University of California
|
* Portions Copyright (c) 1994, Regents of the University of California
|
||||||
*
|
*
|
||||||
* $Id: namespace.h,v 1.25 2003/01/10 22:03:30 petere Exp $
|
* $Id: namespace.h,v 1.26 2003/01/12 18:19:37 petere Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@ -51,7 +51,6 @@ typedef struct _OpclassCandidateList
|
|||||||
extern Oid RangeVarGetRelid(const RangeVar *relation, bool failOK);
|
extern Oid RangeVarGetRelid(const RangeVar *relation, bool failOK);
|
||||||
extern Oid RangeVarGetCreationNamespace(const RangeVar *newRelation);
|
extern Oid RangeVarGetCreationNamespace(const RangeVar *newRelation);
|
||||||
extern Oid RelnameGetRelid(const char *relname);
|
extern Oid RelnameGetRelid(const char *relname);
|
||||||
extern Oid RelidGetNamespaceId(Oid relid);
|
|
||||||
extern bool RelationIsVisible(Oid relid);
|
extern bool RelationIsVisible(Oid relid);
|
||||||
|
|
||||||
extern Oid TypenameGetTypid(const char *typname);
|
extern Oid TypenameGetTypid(const char *typname);
|
||||||
|
Loading…
Reference in New Issue
Block a user