From 8de2ba6b4b419280ccc6a6b4ea17e34d09458fbc Mon Sep 17 00:00:00 2001
From: Justin Pryzby <pryzbyj@telsasoft.com>
Date: Tue, 16 Aug 2022 21:02:16 -0500
Subject: [PATCH 12/26] avoid shadow vars: heap.c: rel, tuple

commit 0d692a0dc9f0e532c67c577187fe5d7d323cb95b
Author: Robert Haas <rhaas@postgresql.org>
Date:   Sat Jan 1 23:48:11 2011 -0500

    Basic foreign table support.

commit 258cef12540fa1cb244881a0f019cefd698c809e
Author: Robert Haas <rhaas@postgresql.org>
Date:   Tue Apr 11 09:08:36 2017 -0400

    Fix possibile deadlock when dropping partitions.
---
 src/backend/catalog/heap.c | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/src/backend/catalog/heap.c b/src/backend/catalog/heap.c
index 9b03579e6e0..9a83ebf3231 100644
--- a/src/backend/catalog/heap.c
+++ b/src/backend/catalog/heap.c
@@ -1818,19 +1818,19 @@ heap_drop_with_catalog(Oid relid)
 	 */
 	if (rel->rd_rel->relkind == RELKIND_FOREIGN_TABLE)
 	{
-		Relation	rel;
-		HeapTuple	tuple;
+		Relation	pg_foreign_table;
+		HeapTuple	foreigntuple;
 
-		rel = table_open(ForeignTableRelationId, RowExclusiveLock);
+		pg_foreign_table = table_open(ForeignTableRelationId, RowExclusiveLock);
 
-		tuple = SearchSysCache1(FOREIGNTABLEREL, ObjectIdGetDatum(relid));
-		if (!HeapTupleIsValid(tuple))
+		foreigntuple = SearchSysCache1(FOREIGNTABLEREL, ObjectIdGetDatum(relid));
+		if (!HeapTupleIsValid(foreigntuple))
 			elog(ERROR, "cache lookup failed for foreign table %u", relid);
 
-		CatalogTupleDelete(rel, &tuple->t_self);
+		CatalogTupleDelete(pg_foreign_table, &foreigntuple->t_self);
 
-		ReleaseSysCache(tuple);
-		table_close(rel, RowExclusiveLock);
+		ReleaseSysCache(foreigntuple);
+		table_close(pg_foreign_table, RowExclusiveLock);
 	}
 
 	/*
-- 
2.17.1

