Move RelFileNumber declarations to common/relpath.h.
authorRobert Haas <rhaas@postgresql.org>
Tue, 27 Sep 2022 16:01:57 +0000 (12:01 -0400)
committerRobert Haas <rhaas@postgresql.org>
Tue, 27 Sep 2022 16:01:57 +0000 (12:01 -0400)
Previously, these were declared in postgres_ext.h, but they are not
needed nearly so widely as the OID declarations, so that doesn't
necessarily make sense. Also, because postgres_ext.h is included
before most of c.h has been processed, the previous location creates
some problems for a pending patch.

Patch by me, reviewed by Dilip Kumar.

Discussion: http://postgr.es/m/CA+TgmoYc8oevMqRokZQ4y_6aRn-7XQny1JBr5DyWR_jiFtONHw@mail.gmail.com

src/bin/pg_dump/pg_dump.c
src/bin/pg_upgrade/pg_upgrade.h
src/include/catalog/binary_upgrade.h
src/include/common/relpath.h
src/include/nodes/parsenodes.h
src/include/nodes/plannodes.h
src/include/postgres_ext.h
src/include/utils/relcache.h

index f8c4cb8d183d142f737f92ccd9e5d3f4e36e64ab..bd9b066e4eb8863fd7d55f6b6e83a6a3fec55026 100644 (file)
@@ -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"
index e379aa466980c2c2015bfbb28022af990e26cb46..31589b0fdc4af0828e103ce60df8a395618460a3 100644 (file)
@@ -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 */
index fd934427ad22582dc6eb26894b5005fc114830de..b7b7d3be00b7186765b66a8cdd4fe6ae51487286 100644 (file)
@@ -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;
index 3ab713247f390afb1e45bf2c1277ec70446ea02c..4bbd94393c861eed3d87f16bc084c72c3f919545 100644 (file)
  */
 #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
index aead2afd6ef70c30181dcdafd99ff2802ca697e0..633e7671b3ea8244e044d714b00aff5de4b25531 100644 (file)
@@ -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"
index dca2a21e7abbd7b2410e683265b4588f45d9eb55..21e642a64c4ced77d048a56ff7499f0b0a324bfb 100644 (file)
@@ -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"
index c9774fa010eeea6d0a98dd8f203a412c8c237e20..240ad4e93bf1e63dba6e4445df4df67f29126509 100644 (file)
@@ -46,14 +46,6 @@ typedef unsigned int Oid;
 /* Define a signed 64-bit integer type for use in client API declarations. */
 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
index 73106b6fc05adf901f35a5b399e635d404175ef1..ce57e7ce4ecafd5463773b8a8db44bf04fab3a1f 100644 (file)
@@ -15,6 +15,7 @@
 #define RELCACHE_H
 
 #include "access/tupdesc.h"
+#include "common/relpath.h"
 #include "nodes/bitmapset.h"