From c8507fc9fadf725e078883523034e11b78574713 Mon Sep 17 00:00:00 2001
From: Dilip Kumar <dilip.kumar@enterprisedb.com>
Date: Tue, 27 Sep 2022 09:04:22 +0530
Subject: [PATCH v19 1/3] Refactoring - move RelFileNumber to relpath.h

Patch by Robert Haas
---
 src/bin/pg_dump/pg_dump.c            | 1 +
 src/bin/pg_upgrade/pg_upgrade.h      | 1 +
 src/include/catalog/binary_upgrade.h | 2 ++
 src/include/common/relpath.h         | 7 +++++++
 src/include/nodes/parsenodes.h       | 1 +
 src/include/nodes/plannodes.h        | 1 +
 src/include/postgres_ext.h           | 8 --------
 src/include/utils/relcache.h         | 1 +
 8 files changed, 14 insertions(+), 8 deletions(-)

diff --git a/src/bin/pg_dump/pg_dump.c b/src/bin/pg_dump/pg_dump.c
index f8c4cb8..bd9b066 100644
--- a/src/bin/pg_dump/pg_dump.c
+++ b/src/bin/pg_dump/pg_dump.c
@@ -55,6 +55,7 @@
 #include "catalog/pg_trigger_d.h"
 #include "catalog/pg_type_d.h"
 #include "common/connect.h"
+#include "common/relpath.h"
 #include "dumputils.h"
 #include "fe_utils/option_utils.h"
 #include "fe_utils/string_utils.h"
diff --git a/src/bin/pg_upgrade/pg_upgrade.h b/src/bin/pg_upgrade/pg_upgrade.h
index e379aa4..31589b0 100644
--- a/src/bin/pg_upgrade/pg_upgrade.h
+++ b/src/bin/pg_upgrade/pg_upgrade.h
@@ -10,6 +10,7 @@
 #include <sys/stat.h>
 #include <sys/time.h>
 
+#include "common/relpath.h"
 #include "libpq-fe.h"
 
 /* For now, pg_upgrade does not use common/logging.c; use our own pg_fatal */
diff --git a/src/include/catalog/binary_upgrade.h b/src/include/catalog/binary_upgrade.h
index fd93442..b7b7d3b 100644
--- a/src/include/catalog/binary_upgrade.h
+++ b/src/include/catalog/binary_upgrade.h
@@ -14,6 +14,8 @@
 #ifndef BINARY_UPGRADE_H
 #define BINARY_UPGRADE_H
 
+#include "common/relpath.h"
+
 extern PGDLLIMPORT Oid binary_upgrade_next_pg_tablespace_oid;
 
 extern PGDLLIMPORT Oid binary_upgrade_next_pg_type_oid;
diff --git a/src/include/common/relpath.h b/src/include/common/relpath.h
index 3ab7132..4bbd943 100644
--- a/src/include/common/relpath.h
+++ b/src/include/common/relpath.h
@@ -19,6 +19,13 @@
  */
 #include "catalog/catversion.h" /* pgrminclude ignore */
 
+/*
+ * RelFileNumber data type identifies the specific relation file name.
+ */
+typedef Oid RelFileNumber;
+#define InvalidRelFileNumber		((RelFileNumber) InvalidOid)
+#define RelFileNumberIsValid(relnumber) \
+				((bool) ((relnumber) != InvalidRelFileNumber))
 
 /*
  * Name of major-version-specific tablespace subdirectories
diff --git a/src/include/nodes/parsenodes.h b/src/include/nodes/parsenodes.h
index aead2af..633e767 100644
--- a/src/include/nodes/parsenodes.h
+++ b/src/include/nodes/parsenodes.h
@@ -22,6 +22,7 @@
 #ifndef PARSENODES_H
 #define PARSENODES_H
 
+#include "common/relpath.h"
 #include "nodes/bitmapset.h"
 #include "nodes/lockoptions.h"
 #include "nodes/primnodes.h"
diff --git a/src/include/nodes/plannodes.h b/src/include/nodes/plannodes.h
index dca2a21..21e642a 100644
--- a/src/include/nodes/plannodes.h
+++ b/src/include/nodes/plannodes.h
@@ -16,6 +16,7 @@
 
 #include "access/sdir.h"
 #include "access/stratnum.h"
+#include "common/relpath.h"
 #include "lib/stringinfo.h"
 #include "nodes/bitmapset.h"
 #include "nodes/lockoptions.h"
diff --git a/src/include/postgres_ext.h b/src/include/postgres_ext.h
index c9774fa..240ad4e 100644
--- a/src/include/postgres_ext.h
+++ b/src/include/postgres_ext.h
@@ -47,14 +47,6 @@ typedef unsigned int Oid;
 typedef PG_INT64_TYPE pg_int64;
 
 /*
- * RelFileNumber data type identifies the specific relation file name.
- */
-typedef Oid RelFileNumber;
-#define InvalidRelFileNumber		((RelFileNumber) InvalidOid)
-#define RelFileNumberIsValid(relnumber) \
-				((bool) ((relnumber) != InvalidRelFileNumber))
-
-/*
  * Identifiers of error message fields.  Kept here to keep common
  * between frontend and backend, and also to export them to libpq
  * applications.
diff --git a/src/include/utils/relcache.h b/src/include/utils/relcache.h
index 73106b6..ce57e7c 100644
--- a/src/include/utils/relcache.h
+++ b/src/include/utils/relcache.h
@@ -15,6 +15,7 @@
 #define RELCACHE_H
 
 #include "access/tupdesc.h"
+#include "common/relpath.h"
 #include "nodes/bitmapset.h"
 
 
-- 
1.8.3.1

