Skip to content

Commit 13437d1

Browse files
committed
Replace RelidGetNamespaceId() by get_rel_namespace().
1 parent 6f48558 commit 13437d1

File tree

3 files changed

+4
-28
lines changed

3 files changed

+4
-28
lines changed

src/backend/catalog/namespace.c

Lines changed: 1 addition & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
* Portions Copyright (c) 1994, Regents of the University of California
1414
*
1515
* IDENTIFICATION
16-
* $Header: /cvsroot/pgsql/src/backend/catalog/namespace.c,v 1.44 2003/01/10 22:03:27 petere Exp $
16+
* $Header: /cvsroot/pgsql/src/backend/catalog/namespace.c,v 1.45 2003/01/12 18:19:37 petere Exp $
1717
*
1818
*-------------------------------------------------------------------------
1919
*/
@@ -278,29 +278,6 @@ RelnameGetRelid(const char *relname)
278278
return InvalidOid;
279279
}
280280

281-
/*
282-
* RelidGetNamespaceId
283-
* Given a relation OID, return the namespace OID.
284-
*/
285-
Oid
286-
RelidGetNamespaceId(Oid relid)
287-
{
288-
HeapTuple tuple;
289-
Form_pg_class pg_class_form;
290-
Oid result;
291-
292-
tuple = SearchSysCache(RELOID,
293-
ObjectIdGetDatum(relid),
294-
0, 0, 0);
295-
if (!HeapTupleIsValid(tuple))
296-
elog(ERROR, "cache lookup failed for relation %u", relid);
297-
pg_class_form = (Form_pg_class) GETSTRUCT(tuple);
298-
299-
result = pg_class_form->relnamespace;
300-
ReleaseSysCache(tuple);
301-
return result;
302-
}
303-
304281

305282
/*
306283
* RelationIsVisible

src/backend/executor/execMain.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
*
2727
*
2828
* IDENTIFICATION
29-
* $Header: /cvsroot/pgsql/src/backend/executor/execMain.c,v 1.197 2003/01/10 22:03:27 petere Exp $
29+
* $Header: /cvsroot/pgsql/src/backend/executor/execMain.c,v 1.198 2003/01/12 18:19:37 petere Exp $
3030
*
3131
*-------------------------------------------------------------------------
3232
*/
@@ -419,7 +419,7 @@ ExecCheckXactReadOnly(Query *parsetree, CmdType operation)
419419
if (!rte->checkForWrite)
420420
continue;
421421

422-
if (isTempNamespace(RelidGetNamespaceId(rte->relid)))
422+
if (isTempNamespace(get_rel_namespace(rte->relid)))
423423
continue;
424424

425425
goto fail;

src/include/catalog/namespace.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group
88
* Portions Copyright (c) 1994, Regents of the University of California
99
*
10-
* $Id: namespace.h,v 1.25 2003/01/10 22:03:30 petere Exp $
10+
* $Id: namespace.h,v 1.26 2003/01/12 18:19:37 petere Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -51,7 +51,6 @@ typedef struct _OpclassCandidateList
5151
extern Oid RangeVarGetRelid(const RangeVar *relation, bool failOK);
5252
extern Oid RangeVarGetCreationNamespace(const RangeVar *newRelation);
5353
extern Oid RelnameGetRelid(const char *relname);
54-
extern Oid RelidGetNamespaceId(Oid relid);
5554
extern bool RelationIsVisible(Oid relid);
5655

5756
extern Oid TypenameGetTypid(const char *typname);

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy