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

Commit4c850ec

Browse files
committed
Don't include heapam.h from others headers.
heapam.h previously was included in a number of widely usedheaders (e.g. execnodes.h, indirectly in executor.h, ...). That'sproblematic on its own, as heapam.h contains a lot of low-leveldetails that don't need to be exposed that widely, but becomes moreproblematic with the upcoming introduction of pluggable table storage- it seems inappropriate for heapam.h to be included that widelyafterwards.heapam.h was largely only included in other headers to get theHeapScanDesc typedef (which was defined in heapam.h, even thoughHeapScanDescData is defined in relscan.h). The better solution hereseems to be to just use the underlying struct (forward declared wherenecessary). Similar for BulkInsertState.Another problem was that LockTupleMode was used in executor.h - partsof the file tried to cope without heapam.h, but due to the fact thatit indirectly included it, several subsequent violations of that goalwere not not noticed. We could just reuse the approach of declaringparameters as int, but it seems nicer to move LockTupleMode tolockoptions.h - that's not a perfect location, but also doesn't seembad.As a number of files relied on implicitly included heapam.h, asignificant number of files grew an explicit include. It's quiteprobably that a few external projects will need to do the same.Author: Andres FreundReviewed-By: Alvaro HerreraDiscussion:https://postgr.es/m/20190114000701.y4ttcb74jpskkcfb@alap3.anarazel.de
1 parent42e2a58 commit4c850ec

File tree

71 files changed

+91
-36
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

71 files changed

+91
-36
lines changed

‎contrib/amcheck/verify_nbtree.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
*/
2424
#include"postgres.h"
2525

26+
#include"access/heapam.h"
2627
#include"access/htup_details.h"
2728
#include"access/nbtree.h"
2829
#include"access/transam.h"

‎contrib/dblink/dblink.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838

3939
#include"access/htup_details.h"
4040
#include"access/reloptions.h"
41+
#include"access/heapam.h"
4142
#include"catalog/indexing.h"
4243
#include"catalog/namespace.h"
4344
#include"catalog/pg_foreign_data_wrapper.h"

‎contrib/file_fdw/file_fdw.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
#include"access/htup_details.h"
1919
#include"access/reloptions.h"
2020
#include"access/sysattr.h"
21+
#include"access/heapam.h"
2122
#include"catalog/pg_authid.h"
2223
#include"catalog/pg_foreign_table.h"
2324
#include"commands/copy.h"

‎contrib/pageinspect/btreefuncs.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
#include"pageinspect.h"
3131

3232
#include"access/nbtree.h"
33+
#include"access/heapam.h"
3334
#include"catalog/namespace.h"
3435
#include"catalog/pg_am.h"
3536
#include"funcapi.h"

‎contrib/pageinspect/heapfuncs.c

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

2828
#include"pageinspect.h"
2929

30+
#include"access/heapam.h"
3031
#include"access/htup_details.h"
3132
#include"funcapi.h"
3233
#include"catalog/pg_type.h"

‎contrib/pageinspect/rawpage.c

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

2020
#include"access/htup_details.h"
21+
#include"access/heapam.h"
2122
#include"catalog/namespace.h"
2223
#include"catalog/pg_type.h"
2324
#include"funcapi.h"

‎contrib/pg_freespacemap/pg_freespacemap.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
*/
99
#include"postgres.h"
1010

11+
#include"access/heapam.h"
1112
#include"funcapi.h"
1213
#include"storage/freespace.h"
1314

‎contrib/pg_visibility/pg_visibility.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
*/
1111
#include"postgres.h"
1212

13+
#include"access/heapam.h"
1314
#include"access/htup_details.h"
1415
#include"access/visibilitymap.h"
1516
#include"catalog/pg_type.h"

‎contrib/pgrowlocks/pgrowlocks.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424

2525
#include"postgres.h"
2626

27+
#include"access/heapam.h"
2728
#include"access/multixact.h"
2829
#include"access/relscan.h"
2930
#include"access/xact.h"

‎contrib/pgstattuple/pgstatapprox.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
#include"postgres.h"
1414

1515
#include"access/visibilitymap.h"
16+
#include"access/heapam.h"
1617
#include"access/transam.h"
1718
#include"access/xact.h"
1819
#include"access/multixact.h"

‎contrib/pgstattuple/pgstattuple.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626

2727
#include"access/gist_private.h"
2828
#include"access/hash.h"
29+
#include"access/heapam.h"
2930
#include"access/nbtree.h"
3031
#include"access/relscan.h"
3132
#include"catalog/namespace.h"

‎contrib/postgres_fdw/postgres_fdw.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414

1515
#include"postgres_fdw.h"
1616

17+
#include"access/heapam.h"
1718
#include"access/htup_details.h"
1819
#include"access/sysattr.h"
1920
#include"catalog/pg_class.h"

‎contrib/tsm_system_rows/tsm_system_rows.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828

2929
#include"postgres.h"
3030

31+
#include"access/heapam.h"
3132
#include"access/relscan.h"
3233
#include"access/tsmapi.h"
3334
#include"catalog/pg_type.h"

‎contrib/tsm_system_time/tsm_system_time.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626

2727
#include<math.h>
2828

29+
#include"access/heapam.h"
2930
#include"access/relscan.h"
3031
#include"access/tsmapi.h"
3132
#include"catalog/pg_type.h"

‎src/backend/access/brin/brin.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
#include"access/brin_page.h"
2020
#include"access/brin_pageops.h"
2121
#include"access/brin_xlog.h"
22+
#include"access/heapam.h"
2223
#include"access/reloptions.h"
2324
#include"access/relscan.h"
2425
#include"access/xloginsert.h"

‎src/backend/access/common/indextuple.c

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

1717
#include"postgres.h"
1818

19-
#include"access/heapam.h"
19+
#include"access/htup_details.h"
2020
#include"access/itup.h"
2121
#include"access/tuptoaster.h"
2222

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919

2020
#include"postgres.h"
2121

22+
#include"access/heapam.h"
2223
#include"access/relscan.h"
2324
#include"access/transam.h"
2425
#include"catalog/index.h"

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@
7070
#include"postgres.h"
7171

7272
#include"access/amapi.h"
73+
#include"access/heapam.h"
7374
#include"access/relscan.h"
7475
#include"access/transam.h"
7576
#include"access/xlog.h"

‎src/backend/access/nbtree/nbtsort.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@
5757

5858
#include"postgres.h"
5959

60+
#include"access/heapam.h"
6061
#include"access/nbtree.h"
6162
#include"access/parallel.h"
6263
#include"access/relscan.h"

‎src/backend/access/tablesample/system.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
#include<math.h>
2828

2929
#include"access/hash.h"
30+
#include"access/heapam.h"
3031
#include"access/relscan.h"
3132
#include"access/tsmapi.h"
3233
#include"catalog/pg_type.h"

‎src/backend/bootstrap/bootstrap.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
#include<unistd.h>
1818
#include<signal.h>
1919

20+
#include"access/heapam.h"
2021
#include"access/htup_details.h"
2122
#include"access/xact.h"
2223
#include"access/xlog_internal.h"

‎src/backend/catalog/dependency.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
#include"postgres.h"
1616

1717
#include"access/htup_details.h"
18+
#include"access/heapam.h"
1819
#include"access/xact.h"
1920
#include"catalog/dependency.h"
2021
#include"catalog/heap.h"

‎src/backend/catalog/heap.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
*/
3030
#include"postgres.h"
3131

32+
#include"access/heapam.h"
3233
#include"access/htup_details.h"
3334
#include"access/multixact.h"
3435
#include"access/sysattr.h"

‎src/backend/catalog/index.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
#include<unistd.h>
2525

2626
#include"access/amapi.h"
27+
#include"access/heapam.h"
2728
#include"access/multixact.h"
2829
#include"access/relscan.h"
2930
#include"access/reloptions.h"

‎src/backend/catalog/indexing.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
*/
1616
#include"postgres.h"
1717

18+
#include"access/heapam.h"
1819
#include"access/htup_details.h"
1920
#include"catalog/index.h"
2021
#include"catalog/indexing.h"

‎src/backend/catalog/objectaddress.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515

1616
#include"postgres.h"
1717

18+
#include"access/heapam.h"
1819
#include"access/htup_details.h"
1920
#include"access/sysattr.h"
2021
#include"catalog/catalog.h"

‎src/backend/catalog/pg_proc.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
#include"postgres.h"
1616

1717
#include"access/htup_details.h"
18+
#include"access/heapam.h"
1819
#include"access/xact.h"
1920
#include"catalog/catalog.h"
2021
#include"catalog/dependency.h"

‎src/backend/catalog/toasting.c

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

17+
#include"access/heapam.h"
1718
#include"access/tuptoaster.h"
1819
#include"access/xact.h"
1920
#include"catalog/binary_upgrade.h"

‎src/backend/commands/alter.c

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

17+
#include"access/heapam.h"
1718
#include"access/htup_details.h"
1819
#include"access/sysattr.h"
1920
#include"catalog/dependency.h"

‎src/backend/commands/analyze.c

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

1717
#include<math.h>
1818

19+
#include"access/heapam.h"
1920
#include"access/multixact.h"
2021
#include"access/sysattr.h"
2122
#include"access/transam.h"

‎src/backend/commands/cluster.c

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

2020
#include"access/amapi.h"
21+
#include"access/heapam.h"
2122
#include"access/multixact.h"
2223
#include"access/relscan.h"
2324
#include"access/rewriteheap.h"

‎src/backend/commands/constraint.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
*/
1414
#include"postgres.h"
1515

16+
#include"access/heapam.h"
1617
#include"catalog/index.h"
1718
#include"commands/trigger.h"
1819
#include"executor/executor.h"

‎src/backend/commands/createas.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
*/
2525
#include"postgres.h"
2626

27+
#include"access/heapam.h"
2728
#include"access/reloptions.h"
2829
#include"access/htup_details.h"
2930
#include"access/sysattr.h"

‎src/backend/commands/event_trigger.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
*/
1414
#include"postgres.h"
1515

16+
#include"access/heapam.h"
1617
#include"access/htup_details.h"
1718
#include"access/xact.h"
1819
#include"catalog/catalog.h"

‎src/backend/commands/extension.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
#include<sys/stat.h>
3030
#include<unistd.h>
3131

32+
#include"access/heapam.h"
3233
#include"access/htup_details.h"
3334
#include"access/sysattr.h"
3435
#include"access/xact.h"

‎src/backend/commands/indexcmds.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
#include"postgres.h"
1717

1818
#include"access/amapi.h"
19+
#include"access/heapam.h"
1920
#include"access/htup_details.h"
2021
#include"access/reloptions.h"
2122
#include"access/sysattr.h"

‎src/backend/commands/matview.c

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

17+
#include"access/heapam.h"
1718
#include"access/htup_details.h"
1819
#include"access/multixact.h"
1920
#include"access/xact.h"

‎src/backend/commands/sequence.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
#include"postgres.h"
1616

1717
#include"access/bufmask.h"
18+
#include"access/heapam.h"
1819
#include"access/htup_details.h"
1920
#include"access/multixact.h"
2021
#include"access/transam.h"

‎src/backend/commands/statscmds.c

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

17+
#include"access/heapam.h"
1718
#include"access/relscan.h"
1819
#include"catalog/catalog.h"
1920
#include"catalog/dependency.h"

‎src/backend/commands/typecmds.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
*/
3232
#include"postgres.h"
3333

34+
#include"access/heapam.h"
3435
#include"access/htup_details.h"
3536
#include"access/xact.h"
3637
#include"catalog/binary_upgrade.h"

‎src/backend/executor/execMain.c

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
*/
3838
#include"postgres.h"
3939

40+
#include"access/heapam.h"
4041
#include"access/htup_details.h"
4142
#include"access/sysattr.h"
4243
#include"access/transam.h"
@@ -2435,13 +2436,10 @@ ExecBuildAuxRowMark(ExecRowMark *erm, List *targetlist)
24352436
*
24362437
* Returns a slot containing the new candidate update/delete tuple, or
24372438
* NULL if we determine we shouldn't process the row.
2438-
*
2439-
* Note: properly, lockmode should be declared as enum LockTupleMode,
2440-
* but we use "int" to avoid having to include heapam.h in executor.h.
24412439
*/
24422440
TupleTableSlot*
24432441
EvalPlanQual(EState*estate,EPQState*epqstate,
2444-
Relationrelation,Indexrti,intlockmode,
2442+
Relationrelation,Indexrti,LockTupleModelockmode,
24452443
ItemPointertid,TransactionIdpriorXmax)
24462444
{
24472445
TupleTableSlot*slot;
@@ -2522,12 +2520,9 @@ EvalPlanQual(EState *estate, EPQState *epqstate,
25222520
*
25232521
* If successful, we have locked the newest tuple version, so caller does not
25242522
* need to worry about it changing anymore.
2525-
*
2526-
* Note: properly, lockmode should be declared as enum LockTupleMode,
2527-
* but we use "int" to avoid having to include heapam.h in executor.h.
25282523
*/
25292524
HeapTuple
2530-
EvalPlanQualFetch(EState*estate,Relationrelation,intlockmode,
2525+
EvalPlanQualFetch(EState*estate,Relationrelation,LockTupleModelockmode,
25312526
LockWaitPolicywait_policy,
25322527
ItemPointertid,TransactionIdpriorXmax)
25332528
{

‎src/backend/executor/execPartition.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
*/
1414
#include"postgres.h"
1515

16+
#include"access/heapam.h"
1617
#include"catalog/partition.h"
1718
#include"catalog/pg_inherits.h"
1819
#include"catalog/pg_type.h"

‎src/backend/executor/execReplication.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414

1515
#include"postgres.h"
1616

17+
#include"access/heapam.h"
1718
#include"access/relscan.h"
1819
#include"access/transam.h"
1920
#include"access/xact.h"

‎src/backend/executor/execUtils.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@
4545

4646
#include"postgres.h"
4747

48+
#include"access/heapam.h"
4849
#include"access/parallel.h"
4950
#include"access/relscan.h"
5051
#include"access/transam.h"

‎src/backend/executor/nodeBitmapHeapscan.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737

3838
#include<math.h>
3939

40+
#include"access/heapam.h"
4041
#include"access/relscan.h"
4142
#include"access/transam.h"
4243
#include"access/visibilitymap.h"

‎src/backend/executor/nodeLockRows.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121

2222
#include"postgres.h"
2323

24+
#include"access/heapam.h"
2425
#include"access/htup_details.h"
2526
#include"access/xact.h"
2627
#include"executor/executor.h"

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp