diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2001-06-19 21:28:41 +0000 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2001-06-19 21:28:41 +0000 |
commit | 8c30aca2ba1a48d38b1206f8559d1dc6b65c5ca7 (patch) | |
tree | 152a0badcf10e299ee7a6ba11ec078f08ace9e57 | |
parent | bbbc00af8829ea442ea9b8a43bdf751f0568bc92 (diff) | |
download | postgresql-8c30aca2ba1a48d38b1206f8559d1dc6b65c5ca7.tar.gz postgresql-8c30aca2ba1a48d38b1206f8559d1dc6b65c5ca7.zip |
Fix badly broken RelationGetRelationName().
-rw-r--r-- | src/include/utils/rel.h | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/include/utils/rel.h b/src/include/utils/rel.h index 51832c6f3ee..5eae99578ee 100644 --- a/src/include/utils/rel.h +++ b/src/include/utils/rel.h @@ -7,7 +7,7 @@ * Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * - * $Id: rel.h,v 1.48 2001/06/19 12:03:41 momjian Exp $ + * $Id: rel.h,v 1.49 2001/06/19 21:28:41 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -221,9 +221,10 @@ extern void RelationSetIndexSupport(Relation relation, * Handle temp relations */ #define PG_TEMP_REL_PREFIX "pg_temp" +#define PG_TEMP_REL_PREFIX_LEN 7 #define is_temp_relname(relname) \ - (strncmp(relname, PG_TEMP_REL_PREFIX, strlen(PG_TEMP_REL_PREFIX)) == 0) + (strncmp(relname, PG_TEMP_REL_PREFIX, PG_TEMP_REL_PREFIX_LEN) == 0) /* * RelationGetPhysicalRelationName @@ -252,12 +253,12 @@ extern void RelationSetIndexSupport(Relation relation, */ #define RelationGetRelationName(relation) \ (\ - !is_temp_relname(relation) \ + is_temp_relname(RelationGetPhysicalRelationName(relation)) \ ? \ - RelationGetPhysicalRelationName(relation) \ - : \ get_temp_rel_by_physicalname( \ RelationGetPhysicalRelationName(relation)) \ + : \ + RelationGetPhysicalRelationName(relation) \ ) |