mirror of
https://github.com/postgres/postgres.git
synced 2025-10-13 18:28:01 +03:00
Avoid including tableam.h and xlogreader.h in nbtree.h
Doing that seems rather random and unnecessary. This commit removes those and fixes fallout, which is pretty minimal. We do need to add a forward declaration of struct TM_IndexDeleteOp (whose full definition appears in tableam.h) so that _bt_delitems_delete_check()'s declaration can use it. Author: Álvaro Herrera <alvherre@kurilemu.de> Reviewed-by: Bertrand Drouvot <bertranddrouvot.pg@gmail.com> Discussion: https://postgr.es/m/202508051109.lzk3lcuzsaxo@alvherre.pgsql
This commit is contained in:
@@ -5,6 +5,7 @@
|
|||||||
|
|
||||||
#include "btree_gist.h"
|
#include "btree_gist.h"
|
||||||
#include "btree_utils_num.h"
|
#include "btree_utils_num.h"
|
||||||
|
#include "utils/rel.h"
|
||||||
#include "utils/sortsupport.h"
|
#include "utils/sortsupport.h"
|
||||||
|
|
||||||
typedef struct boolkey
|
typedef struct boolkey
|
||||||
|
@@ -7,6 +7,7 @@
|
|||||||
#include "btree_utils_num.h"
|
#include "btree_utils_num.h"
|
||||||
#include "common/int.h"
|
#include "common/int.h"
|
||||||
#include "utils/cash.h"
|
#include "utils/cash.h"
|
||||||
|
#include "utils/rel.h"
|
||||||
#include "utils/sortsupport.h"
|
#include "utils/sortsupport.h"
|
||||||
|
|
||||||
typedef struct
|
typedef struct
|
||||||
|
@@ -7,6 +7,7 @@
|
|||||||
#include "btree_utils_num.h"
|
#include "btree_utils_num.h"
|
||||||
#include "utils/fmgrprotos.h"
|
#include "utils/fmgrprotos.h"
|
||||||
#include "utils/date.h"
|
#include "utils/date.h"
|
||||||
|
#include "utils/rel.h"
|
||||||
#include "utils/sortsupport.h"
|
#include "utils/sortsupport.h"
|
||||||
|
|
||||||
typedef struct
|
typedef struct
|
||||||
|
@@ -8,6 +8,7 @@
|
|||||||
#include "fmgr.h"
|
#include "fmgr.h"
|
||||||
#include "utils/fmgrprotos.h"
|
#include "utils/fmgrprotos.h"
|
||||||
#include "utils/fmgroids.h"
|
#include "utils/fmgroids.h"
|
||||||
|
#include "utils/rel.h"
|
||||||
#include "utils/sortsupport.h"
|
#include "utils/sortsupport.h"
|
||||||
|
|
||||||
/* enums are really Oids, so we just use the same structure */
|
/* enums are really Oids, so we just use the same structure */
|
||||||
|
@@ -6,6 +6,7 @@
|
|||||||
#include "btree_gist.h"
|
#include "btree_gist.h"
|
||||||
#include "btree_utils_num.h"
|
#include "btree_utils_num.h"
|
||||||
#include "utils/float.h"
|
#include "utils/float.h"
|
||||||
|
#include "utils/rel.h"
|
||||||
#include "utils/sortsupport.h"
|
#include "utils/sortsupport.h"
|
||||||
|
|
||||||
typedef struct float4key
|
typedef struct float4key
|
||||||
|
@@ -6,6 +6,7 @@
|
|||||||
#include "btree_gist.h"
|
#include "btree_gist.h"
|
||||||
#include "btree_utils_num.h"
|
#include "btree_utils_num.h"
|
||||||
#include "utils/float.h"
|
#include "utils/float.h"
|
||||||
|
#include "utils/rel.h"
|
||||||
#include "utils/sortsupport.h"
|
#include "utils/sortsupport.h"
|
||||||
|
|
||||||
typedef struct float8key
|
typedef struct float8key
|
||||||
|
@@ -7,6 +7,7 @@
|
|||||||
#include "btree_utils_num.h"
|
#include "btree_utils_num.h"
|
||||||
#include "catalog/pg_type.h"
|
#include "catalog/pg_type.h"
|
||||||
#include "utils/builtins.h"
|
#include "utils/builtins.h"
|
||||||
|
#include "utils/rel.h"
|
||||||
#include "utils/sortsupport.h"
|
#include "utils/sortsupport.h"
|
||||||
|
|
||||||
typedef struct inetkey
|
typedef struct inetkey
|
||||||
|
@@ -6,6 +6,7 @@
|
|||||||
#include "btree_gist.h"
|
#include "btree_gist.h"
|
||||||
#include "btree_utils_num.h"
|
#include "btree_utils_num.h"
|
||||||
#include "common/int.h"
|
#include "common/int.h"
|
||||||
|
#include "utils/rel.h"
|
||||||
#include "utils/sortsupport.h"
|
#include "utils/sortsupport.h"
|
||||||
|
|
||||||
typedef struct int16key
|
typedef struct int16key
|
||||||
|
@@ -5,6 +5,7 @@
|
|||||||
#include "btree_gist.h"
|
#include "btree_gist.h"
|
||||||
#include "btree_utils_num.h"
|
#include "btree_utils_num.h"
|
||||||
#include "common/int.h"
|
#include "common/int.h"
|
||||||
|
#include "utils/rel.h"
|
||||||
#include "utils/sortsupport.h"
|
#include "utils/sortsupport.h"
|
||||||
|
|
||||||
typedef struct int32key
|
typedef struct int32key
|
||||||
|
@@ -6,6 +6,7 @@
|
|||||||
#include "btree_gist.h"
|
#include "btree_gist.h"
|
||||||
#include "btree_utils_num.h"
|
#include "btree_utils_num.h"
|
||||||
#include "common/int.h"
|
#include "common/int.h"
|
||||||
|
#include "utils/rel.h"
|
||||||
#include "utils/sortsupport.h"
|
#include "utils/sortsupport.h"
|
||||||
|
|
||||||
typedef struct int64key
|
typedef struct int64key
|
||||||
|
@@ -6,6 +6,7 @@
|
|||||||
#include "btree_gist.h"
|
#include "btree_gist.h"
|
||||||
#include "btree_utils_num.h"
|
#include "btree_utils_num.h"
|
||||||
#include "utils/fmgrprotos.h"
|
#include "utils/fmgrprotos.h"
|
||||||
|
#include "utils/rel.h"
|
||||||
#include "utils/sortsupport.h"
|
#include "utils/sortsupport.h"
|
||||||
#include "utils/timestamp.h"
|
#include "utils/timestamp.h"
|
||||||
|
|
||||||
|
@@ -7,6 +7,7 @@
|
|||||||
#include "btree_utils_num.h"
|
#include "btree_utils_num.h"
|
||||||
#include "utils/fmgrprotos.h"
|
#include "utils/fmgrprotos.h"
|
||||||
#include "utils/inet.h"
|
#include "utils/inet.h"
|
||||||
|
#include "utils/rel.h"
|
||||||
#include "utils/sortsupport.h"
|
#include "utils/sortsupport.h"
|
||||||
|
|
||||||
typedef struct
|
typedef struct
|
||||||
|
@@ -7,6 +7,7 @@
|
|||||||
#include "btree_utils_num.h"
|
#include "btree_utils_num.h"
|
||||||
#include "utils/fmgrprotos.h"
|
#include "utils/fmgrprotos.h"
|
||||||
#include "utils/inet.h"
|
#include "utils/inet.h"
|
||||||
|
#include "utils/rel.h"
|
||||||
#include "utils/sortsupport.h"
|
#include "utils/sortsupport.h"
|
||||||
|
|
||||||
typedef struct
|
typedef struct
|
||||||
|
@@ -5,6 +5,7 @@
|
|||||||
|
|
||||||
#include "btree_gist.h"
|
#include "btree_gist.h"
|
||||||
#include "btree_utils_num.h"
|
#include "btree_utils_num.h"
|
||||||
|
#include "utils/rel.h"
|
||||||
#include "utils/sortsupport.h"
|
#include "utils/sortsupport.h"
|
||||||
|
|
||||||
typedef struct
|
typedef struct
|
||||||
|
@@ -7,6 +7,7 @@
|
|||||||
#include "btree_utils_num.h"
|
#include "btree_utils_num.h"
|
||||||
#include "utils/fmgrprotos.h"
|
#include "utils/fmgrprotos.h"
|
||||||
#include "utils/date.h"
|
#include "utils/date.h"
|
||||||
|
#include "utils/rel.h"
|
||||||
#include "utils/sortsupport.h"
|
#include "utils/sortsupport.h"
|
||||||
#include "utils/timestamp.h"
|
#include "utils/timestamp.h"
|
||||||
|
|
||||||
|
@@ -10,6 +10,7 @@
|
|||||||
#include "utils/fmgrprotos.h"
|
#include "utils/fmgrprotos.h"
|
||||||
#include "utils/timestamp.h"
|
#include "utils/timestamp.h"
|
||||||
#include "utils/float.h"
|
#include "utils/float.h"
|
||||||
|
#include "utils/rel.h"
|
||||||
#include "utils/sortsupport.h"
|
#include "utils/sortsupport.h"
|
||||||
|
|
||||||
typedef struct
|
typedef struct
|
||||||
|
@@ -11,6 +11,7 @@
|
|||||||
#include "btree_utils_var.h"
|
#include "btree_utils_var.h"
|
||||||
#include "mb/pg_wchar.h"
|
#include "mb/pg_wchar.h"
|
||||||
#include "utils/rel.h"
|
#include "utils/rel.h"
|
||||||
|
#include "varatt.h"
|
||||||
|
|
||||||
/* used for key sorting */
|
/* used for key sorting */
|
||||||
typedef struct
|
typedef struct
|
||||||
|
@@ -6,6 +6,7 @@
|
|||||||
#include "btree_gist.h"
|
#include "btree_gist.h"
|
||||||
#include "btree_utils_num.h"
|
#include "btree_utils_num.h"
|
||||||
#include "port/pg_bswap.h"
|
#include "port/pg_bswap.h"
|
||||||
|
#include "utils/rel.h"
|
||||||
#include "utils/sortsupport.h"
|
#include "utils/sortsupport.h"
|
||||||
#include "utils/uuid.h"
|
#include "utils/uuid.h"
|
||||||
|
|
||||||
|
@@ -16,6 +16,7 @@
|
|||||||
|
|
||||||
#include "access/nbtree.h"
|
#include "access/nbtree.h"
|
||||||
#include "access/nbtxlog.h"
|
#include "access/nbtxlog.h"
|
||||||
|
#include "access/tableam.h"
|
||||||
#include "access/xloginsert.h"
|
#include "access/xloginsert.h"
|
||||||
#include "miscadmin.h"
|
#include "miscadmin.h"
|
||||||
#include "utils/rel.h"
|
#include "utils/rel.h"
|
||||||
|
@@ -17,6 +17,7 @@
|
|||||||
|
|
||||||
#include "access/nbtree.h"
|
#include "access/nbtree.h"
|
||||||
#include "access/nbtxlog.h"
|
#include "access/nbtxlog.h"
|
||||||
|
#include "access/tableam.h"
|
||||||
#include "access/transam.h"
|
#include "access/transam.h"
|
||||||
#include "access/xloginsert.h"
|
#include "access/xloginsert.h"
|
||||||
#include "common/int.h"
|
#include "common/int.h"
|
||||||
|
@@ -16,11 +16,13 @@
|
|||||||
#include "postgres.h"
|
#include "postgres.h"
|
||||||
|
|
||||||
#include "access/nbtree.h"
|
#include "access/nbtree.h"
|
||||||
|
#include "access/relscan.h"
|
||||||
#include "common/int.h"
|
#include "common/int.h"
|
||||||
#include "lib/qunique.h"
|
#include "lib/qunique.h"
|
||||||
#include "utils/array.h"
|
#include "utils/array.h"
|
||||||
#include "utils/lsyscache.h"
|
#include "utils/lsyscache.h"
|
||||||
#include "utils/memutils.h"
|
#include "utils/memutils.h"
|
||||||
|
#include "utils/rel.h"
|
||||||
|
|
||||||
typedef struct BTScanKeyPreproc
|
typedef struct BTScanKeyPreproc
|
||||||
{
|
{
|
||||||
|
@@ -44,6 +44,7 @@
|
|||||||
#include "access/parallel.h"
|
#include "access/parallel.h"
|
||||||
#include "access/relscan.h"
|
#include "access/relscan.h"
|
||||||
#include "access/table.h"
|
#include "access/table.h"
|
||||||
|
#include "access/tableam.h"
|
||||||
#include "access/xact.h"
|
#include "access/xact.h"
|
||||||
#include "catalog/index.h"
|
#include "catalog/index.h"
|
||||||
#include "commands/progress.h"
|
#include "commands/progress.h"
|
||||||
|
@@ -15,6 +15,7 @@
|
|||||||
#include "postgres.h"
|
#include "postgres.h"
|
||||||
|
|
||||||
#include "access/nbtree.h"
|
#include "access/nbtree.h"
|
||||||
|
#include "access/tableam.h"
|
||||||
#include "common/int.h"
|
#include "common/int.h"
|
||||||
|
|
||||||
typedef enum
|
typedef enum
|
||||||
|
@@ -19,10 +19,13 @@
|
|||||||
|
|
||||||
#include "access/nbtree.h"
|
#include "access/nbtree.h"
|
||||||
#include "access/reloptions.h"
|
#include "access/reloptions.h"
|
||||||
|
#include "access/relscan.h"
|
||||||
#include "commands/progress.h"
|
#include "commands/progress.h"
|
||||||
#include "miscadmin.h"
|
#include "miscadmin.h"
|
||||||
#include "utils/datum.h"
|
#include "utils/datum.h"
|
||||||
#include "utils/lsyscache.h"
|
#include "utils/lsyscache.h"
|
||||||
|
#include "utils/rel.h"
|
||||||
|
|
||||||
|
|
||||||
#define LOOK_AHEAD_REQUIRED_RECHECKS 3
|
#define LOOK_AHEAD_REQUIRED_RECHECKS 3
|
||||||
#define LOOK_AHEAD_DEFAULT_DISTANCE 5
|
#define LOOK_AHEAD_DEFAULT_DISTANCE 5
|
||||||
|
@@ -31,6 +31,7 @@
|
|||||||
#include "utils/datum.h"
|
#include "utils/datum.h"
|
||||||
#include "utils/guc.h"
|
#include "utils/guc.h"
|
||||||
#include "utils/lsyscache.h"
|
#include "utils/lsyscache.h"
|
||||||
|
#include "utils/rel.h"
|
||||||
#include "utils/tuplesort.h"
|
#include "utils/tuplesort.h"
|
||||||
|
|
||||||
|
|
||||||
|
@@ -17,9 +17,8 @@
|
|||||||
#include "access/amapi.h"
|
#include "access/amapi.h"
|
||||||
#include "access/itup.h"
|
#include "access/itup.h"
|
||||||
#include "access/sdir.h"
|
#include "access/sdir.h"
|
||||||
#include "access/tableam.h"
|
|
||||||
#include "access/xlogreader.h"
|
|
||||||
#include "catalog/pg_am_d.h"
|
#include "catalog/pg_am_d.h"
|
||||||
|
#include "catalog/pg_class.h"
|
||||||
#include "catalog/pg_index.h"
|
#include "catalog/pg_index.h"
|
||||||
#include "lib/stringinfo.h"
|
#include "lib/stringinfo.h"
|
||||||
#include "storage/bufmgr.h"
|
#include "storage/bufmgr.h"
|
||||||
@@ -1285,9 +1284,10 @@ extern void _bt_pageinit(Page page, Size size);
|
|||||||
extern void _bt_delitems_vacuum(Relation rel, Buffer buf,
|
extern void _bt_delitems_vacuum(Relation rel, Buffer buf,
|
||||||
OffsetNumber *deletable, int ndeletable,
|
OffsetNumber *deletable, int ndeletable,
|
||||||
BTVacuumPosting *updatable, int nupdatable);
|
BTVacuumPosting *updatable, int nupdatable);
|
||||||
|
struct TM_IndexDeleteOp; /* avoid including tableam.h here */
|
||||||
extern void _bt_delitems_delete_check(Relation rel, Buffer buf,
|
extern void _bt_delitems_delete_check(Relation rel, Buffer buf,
|
||||||
Relation heapRel,
|
Relation heapRel,
|
||||||
TM_IndexDeleteOp *delstate);
|
struct TM_IndexDeleteOp *delstate);
|
||||||
extern void _bt_pagedel(Relation rel, Buffer leafbuf, BTVacState *vstate);
|
extern void _bt_pagedel(Relation rel, Buffer leafbuf, BTVacState *vstate);
|
||||||
extern void _bt_pendingfsm_init(Relation rel, BTVacState *vstate,
|
extern void _bt_pendingfsm_init(Relation rel, BTVacState *vstate,
|
||||||
bool cleanuponly);
|
bool cleanuponly);
|
||||||
|
Reference in New Issue
Block a user