Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitaf1a949

Browse files
committed
Further cleanup of client dependencies on src/include/catalog headers.
In commit9c0a0de, I'd failed to notice that catalog/catalog.hshould 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 getTABLESPACE_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 upinclusions as necessary. (I found that quite a few current users ofcatalog/catalog.h don't seem to need it at all anymore, apparently as aresult of the refactorings that created common/relpath.[hc]. Andinitdb.c needed it only as a route to pg_class_d.h.)Discussion:https://postgr.es/m/6629.1523294509@sss.pgh.pa.us
1 parentf5543d4 commitaf1a949

File tree

21 files changed

+17
-29
lines changed

21 files changed

+17
-29
lines changed

‎contrib/pageinspect/rawpage.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
#include"pageinspect.h"
1919

2020
#include"access/htup_details.h"
21-
#include"catalog/catalog.h"
2221
#include"catalog/namespace.h"
2322
#include"catalog/pg_type.h"
2423
#include"funcapi.h"

‎contrib/pg_prewarm/pg_prewarm.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
#include<unistd.h>
1717

1818
#include"access/heapam.h"
19-
#include"catalog/catalog.h"
2019
#include"fmgr.h"
2120
#include"miscadmin.h"
2221
#include"storage/bufmgr.h"

‎src/backend/access/index/indexam.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,6 @@
7373
#include"access/relscan.h"
7474
#include"access/transam.h"
7575
#include"access/xlog.h"
76-
#include"catalog/catalog.h"
7776
#include"catalog/index.h"
7877
#include"pgstat.h"
7978
#include"storage/bufmgr.h"

‎src/backend/access/rmgrdesc/smgrdesc.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
*/
1515
#include"postgres.h"
1616

17-
#include"catalog/catalog.h"
1817
#include"catalog/storage_xlog.h"
1918

2019

‎src/backend/access/rmgrdesc/xactdesc.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616

1717
#include"access/transam.h"
1818
#include"access/xact.h"
19-
#include"catalog/catalog.h"
2019
#include"storage/sinval.h"
2120
#include"storage/standbydefs.h"
2221
#include"utils/timestamp.h"

‎src/backend/access/transam/xact.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@
3030
#include"access/xlog.h"
3131
#include"access/xloginsert.h"
3232
#include"access/xlogutils.h"
33-
#include"catalog/catalog.h"
3433
#include"catalog/namespace.h"
3534
#include"catalog/storage.h"
3635
#include"commands/async.h"

‎src/backend/access/transam/xlogfuncs.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
#include"access/xlog.h"
2121
#include"access/xlog_internal.h"
2222
#include"access/xlogutils.h"
23-
#include"catalog/catalog.h"
2423
#include"catalog/pg_type.h"
2524
#include"funcapi.h"
2625
#include"miscadmin.h"

‎src/backend/access/transam/xlogutils.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323
#include"access/xlog.h"
2424
#include"access/xlog_internal.h"
2525
#include"access/xlogutils.h"
26-
#include"catalog/catalog.h"
2726
#include"miscadmin.h"
2827
#include"pgstat.h"
2928
#include"storage/smgr.h"

‎src/backend/catalog/storage.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@
2424
#include"access/xlog.h"
2525
#include"access/xloginsert.h"
2626
#include"access/xlogutils.h"
27-
#include"catalog/catalog.h"
2827
#include"catalog/storage.h"
2928
#include"catalog/storage_xlog.h"
3029
#include"storage/freespace.h"

‎src/backend/commands/vacuumlazy.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@
4444
#include"access/transam.h"
4545
#include"access/visibilitymap.h"
4646
#include"access/xlog.h"
47-
#include"catalog/catalog.h"
4847
#include"catalog/storage.h"
4948
#include"commands/dbcommands.h"
5049
#include"commands/progress.h"

‎src/backend/replication/basebackup.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
#include<time.h>
1818

1919
#include"access/xlog_internal.h"/* for pg_start/stop_backup */
20-
#include"catalog/catalog.h"
2120
#include"catalog/pg_type.h"
2221
#include"common/file_perm.h"
2322
#include"lib/stringinfo.h"

‎src/backend/storage/file/fd.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,6 @@
8282
#include"miscadmin.h"
8383
#include"access/xact.h"
8484
#include"access/xlog.h"
85-
#include"catalog/catalog.h"
8685
#include"catalog/pg_tablespace.h"
8786
#include"common/file_perm.h"
8887
#include"pgstat.h"

‎src/backend/storage/file/reinit.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616

1717
#include<unistd.h>
1818

19-
#include"catalog/catalog.h"
2019
#include"common/relpath.h"
2120
#include"storage/copydir.h"
2221
#include"storage/fd.h"

‎src/backend/storage/smgr/md.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@
2727

2828
#include"miscadmin.h"
2929
#include"access/xlog.h"
30-
#include"catalog/catalog.h"
3130
#include"pgstat.h"
3231
#include"portability/instr_time.h"
3332
#include"postmaster/bgwriter.h"

‎src/bin/initdb/initdb.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,8 @@
6060
#endif
6161

6262
#include"access/xlog_internal.h"
63-
#include"catalog/catalog.h"
6463
#include"catalog/pg_authid_d.h"
64+
#include"catalog/pg_class_d.h"/* pgrminclude ignore */
6565
#include"catalog/pg_collation_d.h"
6666
#include"common/file_perm.h"
6767
#include"common/file_utils.h"

‎src/bin/pg_rewind/copy_fetch.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,6 @@
2121
#include"logging.h"
2222
#include"pg_rewind.h"
2323

24-
#include"catalog/catalog.h"
25-
2624
staticvoidrecurse_dir(constchar*datadir,constchar*path,
2725
process_file_callback_tcallback);
2826

‎src/bin/pg_rewind/filemap.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
#include"pg_rewind.h"
2020

2121
#include"common/string.h"
22-
#include"catalog/catalog.h"
2322
#include"catalog/pg_tablespace_d.h"
2423
#include"storage/fd.h"
2524

‎src/bin/pg_rewind/libpq_fetch.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222
#include"logging.h"
2323

2424
#include"libpq-fe.h"
25-
#include"catalog/catalog.h"
2625
#include"catalog/pg_type_d.h"
2726
#include"fe_utils/connect.h"
2827
#include"port/pg_bswap.h"

‎src/common/relpath.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
#include"postgres_fe.h"
1919
#endif
2020

21-
#include"catalog/catalog.h"
2221
#include"catalog/pg_tablespace_d.h"
2322
#include"common/relpath.h"
2423
#include"storage/backendid.h"

‎src/include/catalog/catalog.h

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,18 +14,9 @@
1414
#ifndefCATALOG_H
1515
#defineCATALOG_H
1616

17-
/*
18-
*'pgrminclude ignore' needed here because CppAsString2() does not throw
19-
*an error if the symbol is not defined.
20-
*/
21-
#include"catalog/catversion.h"/* pgrminclude ignore */
2217
#include"catalog/pg_class.h"
2318
#include"utils/relcache.h"
2419

25-
#defineOIDCHARS10/* max chars printed by %u */
26-
#defineTABLESPACE_VERSION_DIRECTORY"PG_" PG_MAJORVERSION "_" \
27-
CppAsString2(CATALOG_VERSION_NO)
28-
2920

3021
externboolIsSystemRelation(Relationrelation);
3122
externboolIsToastRelation(Relationrelation);

‎src/include/common/relpath.h

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,22 @@
1313
#ifndefRELPATH_H
1414
#defineRELPATH_H
1515

16+
/*
17+
*'pgrminclude ignore' needed here because CppAsString2() does not throw
18+
*an error if the symbol is not defined.
19+
*/
20+
#include"catalog/catversion.h"/* pgrminclude ignore */
21+
22+
23+
/*
24+
* Name of major-version-specific tablespace subdirectories
25+
*/
26+
#defineTABLESPACE_VERSION_DIRECTORY"PG_" PG_MAJORVERSION "_" \
27+
CppAsString2(CATALOG_VERSION_NO)
28+
29+
/* Characters to allow for an OID in a relation path */
30+
#defineOIDCHARS10/* max chars printed by %u */
31+
1632
/*
1733
* Stuff for fork names.
1834
*

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp