summaryrefslogtreecommitdiff
path: root/src/backend/access/heap/heapam.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/backend/access/heap/heapam.c')
-rw-r--r--src/backend/access/heap/heapam.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/backend/access/heap/heapam.c b/src/backend/access/heap/heapam.c
index c3a45b98db5..f081d2fe8f4 100644
--- a/src/backend/access/heap/heapam.c
+++ b/src/backend/access/heap/heapam.c
@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/access/heap/heapam.c,v 1.249 2008/01/30 18:35:55 tgl Exp $
+ * $PostgreSQL: pgsql/src/backend/access/heap/heapam.c,v 1.249.2.1 2008/03/04 19:54:13 tgl Exp $
*
*
* INTERFACE ROUTINES
@@ -868,6 +868,10 @@ relation_open(Oid relationId, LOCKMODE lockmode)
if (!RelationIsValid(r))
elog(ERROR, "could not open relation with OID %u", relationId);
+ /* Make note that we've accessed a temporary relation */
+ if (r->rd_istemp)
+ MyXactAccessedTempRel = true;
+
pgstat_initstats(r);
return r;
@@ -912,6 +916,10 @@ try_relation_open(Oid relationId, LOCKMODE lockmode)
if (!RelationIsValid(r))
elog(ERROR, "could not open relation with OID %u", relationId);
+ /* Make note that we've accessed a temporary relation */
+ if (r->rd_istemp)
+ MyXactAccessedTempRel = true;
+
pgstat_initstats(r);
return r;
@@ -958,6 +966,10 @@ relation_open_nowait(Oid relationId, LOCKMODE lockmode)
if (!RelationIsValid(r))
elog(ERROR, "could not open relation with OID %u", relationId);
+ /* Make note that we've accessed a temporary relation */
+ if (r->rd_istemp)
+ MyXactAccessedTempRel = true;
+
pgstat_initstats(r);
return r;