mirror of
https://git.postgresql.org/git/postgresql.git
synced 2024-09-28 07:31:51 +02:00
Further cleanup of client dependencies on src/include/catalog headers.
In commit 9c0a0de4c
, I'd failed to notice that catalog/catalog.h
should also be considered a frontend-unsafe header, because it includes
(and needs) the full form of pg_class.h, not to mention relcache.h.
However, various frontend code was depending on it to get
TABLESPACE_VERSION_DIRECTORY, so refactoring of some sort is called for.
The cleanest answer seems to be to move TABLESPACE_VERSION_DIRECTORY,
as well as the OIDCHARS symbol, to common/relpath.h. Do that, and mop up
inclusions as necessary. (I found that quite a few current users of
catalog/catalog.h don't seem to need it at all anymore, apparently as a
result of the refactorings that created common/relpath.[hc]. And
initdb.c needed it only as a route to pg_class_d.h.)
Discussion: https://postgr.es/m/6629.1523294509@sss.pgh.pa.us
This commit is contained in:
parent
f5543d47bc
commit
af1a949109
@ -18,7 +18,6 @@
|
|||||||
#include "pageinspect.h"
|
#include "pageinspect.h"
|
||||||
|
|
||||||
#include "access/htup_details.h"
|
#include "access/htup_details.h"
|
||||||
#include "catalog/catalog.h"
|
|
||||||
#include "catalog/namespace.h"
|
#include "catalog/namespace.h"
|
||||||
#include "catalog/pg_type.h"
|
#include "catalog/pg_type.h"
|
||||||
#include "funcapi.h"
|
#include "funcapi.h"
|
||||||
|
@ -16,7 +16,6 @@
|
|||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
|
||||||
#include "access/heapam.h"
|
#include "access/heapam.h"
|
||||||
#include "catalog/catalog.h"
|
|
||||||
#include "fmgr.h"
|
#include "fmgr.h"
|
||||||
#include "miscadmin.h"
|
#include "miscadmin.h"
|
||||||
#include "storage/bufmgr.h"
|
#include "storage/bufmgr.h"
|
||||||
|
@ -73,7 +73,6 @@
|
|||||||
#include "access/relscan.h"
|
#include "access/relscan.h"
|
||||||
#include "access/transam.h"
|
#include "access/transam.h"
|
||||||
#include "access/xlog.h"
|
#include "access/xlog.h"
|
||||||
#include "catalog/catalog.h"
|
|
||||||
#include "catalog/index.h"
|
#include "catalog/index.h"
|
||||||
#include "pgstat.h"
|
#include "pgstat.h"
|
||||||
#include "storage/bufmgr.h"
|
#include "storage/bufmgr.h"
|
||||||
|
@ -14,7 +14,6 @@
|
|||||||
*/
|
*/
|
||||||
#include "postgres.h"
|
#include "postgres.h"
|
||||||
|
|
||||||
#include "catalog/catalog.h"
|
|
||||||
#include "catalog/storage_xlog.h"
|
#include "catalog/storage_xlog.h"
|
||||||
|
|
||||||
|
|
||||||
|
@ -16,7 +16,6 @@
|
|||||||
|
|
||||||
#include "access/transam.h"
|
#include "access/transam.h"
|
||||||
#include "access/xact.h"
|
#include "access/xact.h"
|
||||||
#include "catalog/catalog.h"
|
|
||||||
#include "storage/sinval.h"
|
#include "storage/sinval.h"
|
||||||
#include "storage/standbydefs.h"
|
#include "storage/standbydefs.h"
|
||||||
#include "utils/timestamp.h"
|
#include "utils/timestamp.h"
|
||||||
|
@ -30,7 +30,6 @@
|
|||||||
#include "access/xlog.h"
|
#include "access/xlog.h"
|
||||||
#include "access/xloginsert.h"
|
#include "access/xloginsert.h"
|
||||||
#include "access/xlogutils.h"
|
#include "access/xlogutils.h"
|
||||||
#include "catalog/catalog.h"
|
|
||||||
#include "catalog/namespace.h"
|
#include "catalog/namespace.h"
|
||||||
#include "catalog/storage.h"
|
#include "catalog/storage.h"
|
||||||
#include "commands/async.h"
|
#include "commands/async.h"
|
||||||
|
@ -20,7 +20,6 @@
|
|||||||
#include "access/xlog.h"
|
#include "access/xlog.h"
|
||||||
#include "access/xlog_internal.h"
|
#include "access/xlog_internal.h"
|
||||||
#include "access/xlogutils.h"
|
#include "access/xlogutils.h"
|
||||||
#include "catalog/catalog.h"
|
|
||||||
#include "catalog/pg_type.h"
|
#include "catalog/pg_type.h"
|
||||||
#include "funcapi.h"
|
#include "funcapi.h"
|
||||||
#include "miscadmin.h"
|
#include "miscadmin.h"
|
||||||
|
@ -23,7 +23,6 @@
|
|||||||
#include "access/xlog.h"
|
#include "access/xlog.h"
|
||||||
#include "access/xlog_internal.h"
|
#include "access/xlog_internal.h"
|
||||||
#include "access/xlogutils.h"
|
#include "access/xlogutils.h"
|
||||||
#include "catalog/catalog.h"
|
|
||||||
#include "miscadmin.h"
|
#include "miscadmin.h"
|
||||||
#include "pgstat.h"
|
#include "pgstat.h"
|
||||||
#include "storage/smgr.h"
|
#include "storage/smgr.h"
|
||||||
|
@ -24,7 +24,6 @@
|
|||||||
#include "access/xlog.h"
|
#include "access/xlog.h"
|
||||||
#include "access/xloginsert.h"
|
#include "access/xloginsert.h"
|
||||||
#include "access/xlogutils.h"
|
#include "access/xlogutils.h"
|
||||||
#include "catalog/catalog.h"
|
|
||||||
#include "catalog/storage.h"
|
#include "catalog/storage.h"
|
||||||
#include "catalog/storage_xlog.h"
|
#include "catalog/storage_xlog.h"
|
||||||
#include "storage/freespace.h"
|
#include "storage/freespace.h"
|
||||||
|
@ -44,7 +44,6 @@
|
|||||||
#include "access/transam.h"
|
#include "access/transam.h"
|
||||||
#include "access/visibilitymap.h"
|
#include "access/visibilitymap.h"
|
||||||
#include "access/xlog.h"
|
#include "access/xlog.h"
|
||||||
#include "catalog/catalog.h"
|
|
||||||
#include "catalog/storage.h"
|
#include "catalog/storage.h"
|
||||||
#include "commands/dbcommands.h"
|
#include "commands/dbcommands.h"
|
||||||
#include "commands/progress.h"
|
#include "commands/progress.h"
|
||||||
|
@ -17,7 +17,6 @@
|
|||||||
#include <time.h>
|
#include <time.h>
|
||||||
|
|
||||||
#include "access/xlog_internal.h" /* for pg_start/stop_backup */
|
#include "access/xlog_internal.h" /* for pg_start/stop_backup */
|
||||||
#include "catalog/catalog.h"
|
|
||||||
#include "catalog/pg_type.h"
|
#include "catalog/pg_type.h"
|
||||||
#include "common/file_perm.h"
|
#include "common/file_perm.h"
|
||||||
#include "lib/stringinfo.h"
|
#include "lib/stringinfo.h"
|
||||||
|
@ -82,7 +82,6 @@
|
|||||||
#include "miscadmin.h"
|
#include "miscadmin.h"
|
||||||
#include "access/xact.h"
|
#include "access/xact.h"
|
||||||
#include "access/xlog.h"
|
#include "access/xlog.h"
|
||||||
#include "catalog/catalog.h"
|
|
||||||
#include "catalog/pg_tablespace.h"
|
#include "catalog/pg_tablespace.h"
|
||||||
#include "common/file_perm.h"
|
#include "common/file_perm.h"
|
||||||
#include "pgstat.h"
|
#include "pgstat.h"
|
||||||
|
@ -16,7 +16,6 @@
|
|||||||
|
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
|
||||||
#include "catalog/catalog.h"
|
|
||||||
#include "common/relpath.h"
|
#include "common/relpath.h"
|
||||||
#include "storage/copydir.h"
|
#include "storage/copydir.h"
|
||||||
#include "storage/fd.h"
|
#include "storage/fd.h"
|
||||||
|
@ -27,7 +27,6 @@
|
|||||||
|
|
||||||
#include "miscadmin.h"
|
#include "miscadmin.h"
|
||||||
#include "access/xlog.h"
|
#include "access/xlog.h"
|
||||||
#include "catalog/catalog.h"
|
|
||||||
#include "pgstat.h"
|
#include "pgstat.h"
|
||||||
#include "portability/instr_time.h"
|
#include "portability/instr_time.h"
|
||||||
#include "postmaster/bgwriter.h"
|
#include "postmaster/bgwriter.h"
|
||||||
|
@ -60,8 +60,8 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "access/xlog_internal.h"
|
#include "access/xlog_internal.h"
|
||||||
#include "catalog/catalog.h"
|
|
||||||
#include "catalog/pg_authid_d.h"
|
#include "catalog/pg_authid_d.h"
|
||||||
|
#include "catalog/pg_class_d.h" /* pgrminclude ignore */
|
||||||
#include "catalog/pg_collation_d.h"
|
#include "catalog/pg_collation_d.h"
|
||||||
#include "common/file_perm.h"
|
#include "common/file_perm.h"
|
||||||
#include "common/file_utils.h"
|
#include "common/file_utils.h"
|
||||||
|
@ -21,8 +21,6 @@
|
|||||||
#include "logging.h"
|
#include "logging.h"
|
||||||
#include "pg_rewind.h"
|
#include "pg_rewind.h"
|
||||||
|
|
||||||
#include "catalog/catalog.h"
|
|
||||||
|
|
||||||
static void recurse_dir(const char *datadir, const char *path,
|
static void recurse_dir(const char *datadir, const char *path,
|
||||||
process_file_callback_t callback);
|
process_file_callback_t callback);
|
||||||
|
|
||||||
|
@ -19,7 +19,6 @@
|
|||||||
#include "pg_rewind.h"
|
#include "pg_rewind.h"
|
||||||
|
|
||||||
#include "common/string.h"
|
#include "common/string.h"
|
||||||
#include "catalog/catalog.h"
|
|
||||||
#include "catalog/pg_tablespace_d.h"
|
#include "catalog/pg_tablespace_d.h"
|
||||||
#include "storage/fd.h"
|
#include "storage/fd.h"
|
||||||
|
|
||||||
|
@ -22,7 +22,6 @@
|
|||||||
#include "logging.h"
|
#include "logging.h"
|
||||||
|
|
||||||
#include "libpq-fe.h"
|
#include "libpq-fe.h"
|
||||||
#include "catalog/catalog.h"
|
|
||||||
#include "catalog/pg_type_d.h"
|
#include "catalog/pg_type_d.h"
|
||||||
#include "fe_utils/connect.h"
|
#include "fe_utils/connect.h"
|
||||||
#include "port/pg_bswap.h"
|
#include "port/pg_bswap.h"
|
||||||
|
@ -18,7 +18,6 @@
|
|||||||
#include "postgres_fe.h"
|
#include "postgres_fe.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "catalog/catalog.h"
|
|
||||||
#include "catalog/pg_tablespace_d.h"
|
#include "catalog/pg_tablespace_d.h"
|
||||||
#include "common/relpath.h"
|
#include "common/relpath.h"
|
||||||
#include "storage/backendid.h"
|
#include "storage/backendid.h"
|
||||||
|
@ -14,18 +14,9 @@
|
|||||||
#ifndef CATALOG_H
|
#ifndef CATALOG_H
|
||||||
#define CATALOG_H
|
#define CATALOG_H
|
||||||
|
|
||||||
/*
|
|
||||||
* 'pgrminclude ignore' needed here because CppAsString2() does not throw
|
|
||||||
* an error if the symbol is not defined.
|
|
||||||
*/
|
|
||||||
#include "catalog/catversion.h" /* pgrminclude ignore */
|
|
||||||
#include "catalog/pg_class.h"
|
#include "catalog/pg_class.h"
|
||||||
#include "utils/relcache.h"
|
#include "utils/relcache.h"
|
||||||
|
|
||||||
#define OIDCHARS 10 /* max chars printed by %u */
|
|
||||||
#define TABLESPACE_VERSION_DIRECTORY "PG_" PG_MAJORVERSION "_" \
|
|
||||||
CppAsString2(CATALOG_VERSION_NO)
|
|
||||||
|
|
||||||
|
|
||||||
extern bool IsSystemRelation(Relation relation);
|
extern bool IsSystemRelation(Relation relation);
|
||||||
extern bool IsToastRelation(Relation relation);
|
extern bool IsToastRelation(Relation relation);
|
||||||
|
@ -13,6 +13,22 @@
|
|||||||
#ifndef RELPATH_H
|
#ifndef RELPATH_H
|
||||||
#define RELPATH_H
|
#define RELPATH_H
|
||||||
|
|
||||||
|
/*
|
||||||
|
* 'pgrminclude ignore' needed here because CppAsString2() does not throw
|
||||||
|
* an error if the symbol is not defined.
|
||||||
|
*/
|
||||||
|
#include "catalog/catversion.h" /* pgrminclude ignore */
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Name of major-version-specific tablespace subdirectories
|
||||||
|
*/
|
||||||
|
#define TABLESPACE_VERSION_DIRECTORY "PG_" PG_MAJORVERSION "_" \
|
||||||
|
CppAsString2(CATALOG_VERSION_NO)
|
||||||
|
|
||||||
|
/* Characters to allow for an OID in a relation path */
|
||||||
|
#define OIDCHARS 10 /* max chars printed by %u */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Stuff for fork names.
|
* Stuff for fork names.
|
||||||
*
|
*
|
||||||
|
Loading…
Reference in New Issue
Block a user