77 * Portions Copyright (c) 1996-2000, PostgreSQL, Inc
88 * Portions Copyright (c) 1994, Regents of the University of California
99 *
10- * $Id: rel.h,v 1.42 2000/11/08 22:10:02 tgl Exp $
10+ * $Id: rel.h,v 1.43 2000/12/23 19:55:16 tgl Exp $
1111 *
1212 *-------------------------------------------------------------------------
1313 */
@@ -185,12 +185,16 @@ typedef Relation *RelationPtr;
185185/*
186186 * RelationGetRelationName
187187 *
188- * Returns a Relation Name
188+ * Returns the relation's logical name (as seen by the user).
189+ *
190+ * If the rel is a temp rel, the temp name will be returned. Therefore,
191+ * this name is not unique. But it is the name to use in heap_openr(),
192+ * for example.
189193 */
190194#define RelationGetRelationName (relation ) \
191195(\
192196(strncmp(RelationGetPhysicalRelationName(relation), \
193- "pg_temp.",strlen("pg_temp.") ) != 0) \
197+ "pg_temp.",8 ) != 0) \
194198? \
195199RelationGetPhysicalRelationName(relation) \
196200: \
@@ -202,7 +206,15 @@ typedef Relation *RelationPtr;
202206/*
203207 * RelationGetPhysicalRelationName
204208 *
205- * Returns a Relation Name
209+ * Returns the rel's physical name, ie, the name appearing in pg_class.
210+ *
211+ * While this name is unique across all rels in the database, it is not
212+ * necessarily useful for accessing the rel, since a temp table of the
213+ * same name might mask the rel. It is useful mainly for determining if
214+ * the rel is a shared system rel or not.
215+ *
216+ * The macro is rather unfortunately named, since the pg_class name no longer
217+ * has anything to do with the file name used for physical storage of the rel.
206218 */
207219#define RelationGetPhysicalRelationName (relation ) \
208220(NameStr((relation)->rd_rel->relname))