aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2000-12-23 19:55:16 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2000-12-23 19:55:16 +0000
commite58badfbe7e2e0beb62d6b01dcf38e1658815256 (patch)
tree67083a01814683aceaafccdc2a8b23fd64b0300c /src
parent7df721af0ee61fa94eb973c52b9b1bff9bc45300 (diff)
downloadpostgresql-e58badfbe7e2e0beb62d6b01dcf38e1658815256.tar.gz
postgresql-e58badfbe7e2e0beb62d6b01dcf38e1658815256.zip
Improve comments.
Diffstat (limited to 'src')
-rw-r--r--src/include/utils/rel.h20
1 files changed, 16 insertions, 4 deletions
diff --git a/src/include/utils/rel.h b/src/include/utils/rel.h
index fd4012b0ddf..adde4a28e31 100644
--- a/src/include/utils/rel.h
+++ b/src/include/utils/rel.h
@@ -7,7 +7,7 @@
* Portions Copyright (c) 1996-2000, PostgreSQL, Inc
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $Id: rel.h,v 1.42 2000/11/08 22:10:02 tgl Exp $
+ * $Id: rel.h,v 1.43 2000/12/23 19:55:16 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -185,12 +185,16 @@ typedef Relation *RelationPtr;
/*
* RelationGetRelationName
*
- * Returns a Relation Name
+ * Returns the relation's logical name (as seen by the user).
+ *
+ * If the rel is a temp rel, the temp name will be returned. Therefore,
+ * this name is not unique. But it is the name to use in heap_openr(),
+ * for example.
*/
#define RelationGetRelationName(relation) \
(\
(strncmp(RelationGetPhysicalRelationName(relation), \
- "pg_temp.", strlen("pg_temp.")) != 0) \
+ "pg_temp.", 8) != 0) \
? \
RelationGetPhysicalRelationName(relation) \
: \
@@ -202,7 +206,15 @@ typedef Relation *RelationPtr;
/*
* RelationGetPhysicalRelationName
*
- * Returns a Relation Name
+ * Returns the rel's physical name, ie, the name appearing in pg_class.
+ *
+ * While this name is unique across all rels in the database, it is not
+ * necessarily useful for accessing the rel, since a temp table of the
+ * same name might mask the rel. It is useful mainly for determining if
+ * the rel is a shared system rel or not.
+ *
+ * The macro is rather unfortunately named, since the pg_class name no longer
+ * has anything to do with the file name used for physical storage of the rel.
*/
#define RelationGetPhysicalRelationName(relation) \
(NameStr((relation)->rd_rel->relname))