|
7 | 7 | * Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group |
8 | 8 | * Portions Copyright (c) 1994, Regents of the University of California |
9 | 9 | * |
10 | | - * $Id: rel.h,v 1.48 2001/06/19 12:03:41 momjian Exp $ |
| 10 | + * $Id: rel.h,v 1.49 2001/06/19 21:28:41 tgl Exp $ |
11 | 11 | * |
12 | 12 | *------------------------------------------------------------------------- |
13 | 13 | */ |
@@ -221,9 +221,10 @@ extern void RelationSetIndexSupport(Relation relation, |
221 | 221 | * Handle temp relations |
222 | 222 | */ |
223 | 223 | #define PG_TEMP_REL_PREFIX "pg_temp" |
| 224 | +#define PG_TEMP_REL_PREFIX_LEN 7 |
224 | 225 |
|
225 | 226 | #define is_temp_relname(relname) \ |
226 | | - (strncmp(relname, PG_TEMP_REL_PREFIX, strlen(PG_TEMP_REL_PREFIX)) == 0) |
| 227 | + (strncmp(relname, PG_TEMP_REL_PREFIX, PG_TEMP_REL_PREFIX_LEN) == 0) |
227 | 228 |
|
228 | 229 | /* |
229 | 230 | * RelationGetPhysicalRelationName |
@@ -252,12 +253,12 @@ extern void RelationSetIndexSupport(Relation relation, |
252 | 253 | */ |
253 | 254 | #define RelationGetRelationName(relation) \ |
254 | 255 | (\ |
255 | | - !is_temp_relname(relation) \ |
| 256 | + is_temp_relname(RelationGetPhysicalRelationName(relation)) \ |
256 | 257 | ? \ |
257 | | - RelationGetPhysicalRelationName(relation) \ |
258 | | - : \ |
259 | 258 | get_temp_rel_by_physicalname( \ |
260 | 259 | RelationGetPhysicalRelationName(relation)) \ |
| 260 | + : \ |
| 261 | + RelationGetPhysicalRelationName(relation) \ |
261 | 262 | ) |
262 | 263 |
|
263 | 264 |
|
|
0 commit comments