mirror of
https://github.com/postgres/postgres.git
synced 2025-10-27 00:12:01 +03:00
Don't include execnodes.h in replication/conflict.h
... which silently propagates a lot of headers into many places via pgstat.h, as evidenced by the variety of headers that this patch needs to add to seemingly random places. Add a minimum of typedefs to conflict.h to be able to remove execnodes.h, and fix the fallout. Backpatch to 18, where conflict.h first appeared. Discussion: https://postgr.es/m/202509191927.uj2ijwmho7nv@alvherre.pgsql
This commit is contained in:
@@ -84,6 +84,7 @@
|
|||||||
#include "pg_trace.h"
|
#include "pg_trace.h"
|
||||||
#include "pgstat.h"
|
#include "pgstat.h"
|
||||||
#include "postmaster/autovacuum.h"
|
#include "postmaster/autovacuum.h"
|
||||||
|
#include "storage/condition_variable.h"
|
||||||
#include "storage/pmsignal.h"
|
#include "storage/pmsignal.h"
|
||||||
#include "storage/proc.h"
|
#include "storage/proc.h"
|
||||||
#include "storage/procarray.h"
|
#include "storage/procarray.h"
|
||||||
|
|||||||
@@ -45,6 +45,7 @@
|
|||||||
#include "commands/tablespace.h"
|
#include "commands/tablespace.h"
|
||||||
#include "common/file_utils.h"
|
#include "common/file_utils.h"
|
||||||
#include "miscadmin.h"
|
#include "miscadmin.h"
|
||||||
|
#include "nodes/miscnodes.h"
|
||||||
#include "pgstat.h"
|
#include "pgstat.h"
|
||||||
#include "postmaster/bgwriter.h"
|
#include "postmaster/bgwriter.h"
|
||||||
#include "postmaster/startup.h"
|
#include "postmaster/startup.h"
|
||||||
|
|||||||
@@ -67,6 +67,7 @@
|
|||||||
#include "libpq/pqsignal.h"
|
#include "libpq/pqsignal.h"
|
||||||
#include "miscadmin.h"
|
#include "miscadmin.h"
|
||||||
#include "pgstat.h"
|
#include "pgstat.h"
|
||||||
|
#include "port/atomics.h"
|
||||||
#include "portability/instr_time.h"
|
#include "portability/instr_time.h"
|
||||||
#include "postmaster/postmaster.h"
|
#include "postmaster/postmaster.h"
|
||||||
#include "storage/fd.h"
|
#include "storage/fd.h"
|
||||||
|
|||||||
@@ -25,6 +25,7 @@
|
|||||||
#include "postgres.h"
|
#include "postgres.h"
|
||||||
|
|
||||||
#include "access/xlog.h"
|
#include "access/xlog.h"
|
||||||
|
#include "executor/instrument.h"
|
||||||
#include "storage/bufmgr.h"
|
#include "storage/bufmgr.h"
|
||||||
#include "storage/proc.h"
|
#include "storage/proc.h"
|
||||||
#include "storage/procarray.h"
|
#include "storage/procarray.h"
|
||||||
|
|||||||
@@ -11,6 +11,7 @@
|
|||||||
#ifndef PGSTAT_H
|
#ifndef PGSTAT_H
|
||||||
#define PGSTAT_H
|
#define PGSTAT_H
|
||||||
|
|
||||||
|
#include "access/transam.h" /* for FullTransactionId */
|
||||||
#include "datatype/timestamp.h"
|
#include "datatype/timestamp.h"
|
||||||
#include "portability/instr_time.h"
|
#include "portability/instr_time.h"
|
||||||
#include "postmaster/pgarch.h" /* for MAX_XFN_CHARS */
|
#include "postmaster/pgarch.h" /* for MAX_XFN_CHARS */
|
||||||
|
|||||||
@@ -9,9 +9,16 @@
|
|||||||
#ifndef CONFLICT_H
|
#ifndef CONFLICT_H
|
||||||
#define CONFLICT_H
|
#define CONFLICT_H
|
||||||
|
|
||||||
#include "nodes/execnodes.h"
|
#include "access/xlogdefs.h"
|
||||||
|
#include "nodes/pg_list.h"
|
||||||
#include "utils/timestamp.h"
|
#include "utils/timestamp.h"
|
||||||
|
|
||||||
|
/* Avoid including execnodes.h here */
|
||||||
|
struct EState;
|
||||||
|
struct ResultRelInfo;
|
||||||
|
struct TupleTableSlot;
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Conflict types that could occur while applying remote changes.
|
* Conflict types that could occur while applying remote changes.
|
||||||
*
|
*
|
||||||
@@ -58,8 +65,8 @@ typedef enum
|
|||||||
*/
|
*/
|
||||||
typedef struct ConflictTupleInfo
|
typedef struct ConflictTupleInfo
|
||||||
{
|
{
|
||||||
TupleTableSlot *slot; /* tuple slot holding the conflicting local
|
struct TupleTableSlot *slot; /* tuple slot holding the conflicting
|
||||||
* tuple */
|
* local tuple */
|
||||||
Oid indexoid; /* OID of the index where the conflict
|
Oid indexoid; /* OID of the index where the conflict
|
||||||
* occurred */
|
* occurred */
|
||||||
TransactionId xmin; /* transaction ID of the modification causing
|
TransactionId xmin; /* transaction ID of the modification causing
|
||||||
@@ -69,14 +76,15 @@ typedef struct ConflictTupleInfo
|
|||||||
* conflicting local row occurred */
|
* conflicting local row occurred */
|
||||||
} ConflictTupleInfo;
|
} ConflictTupleInfo;
|
||||||
|
|
||||||
extern bool GetTupleTransactionInfo(TupleTableSlot *localslot,
|
extern bool GetTupleTransactionInfo(struct TupleTableSlot *localslot,
|
||||||
TransactionId *xmin,
|
TransactionId *xmin,
|
||||||
RepOriginId *localorigin,
|
RepOriginId *localorigin,
|
||||||
TimestampTz *localts);
|
TimestampTz *localts);
|
||||||
extern void ReportApplyConflict(EState *estate, ResultRelInfo *relinfo,
|
extern void ReportApplyConflict(struct EState *estate, struct ResultRelInfo *relinfo,
|
||||||
int elevel, ConflictType type,
|
int elevel, ConflictType type,
|
||||||
TupleTableSlot *searchslot,
|
struct TupleTableSlot *searchslot,
|
||||||
TupleTableSlot *remoteslot,
|
struct TupleTableSlot *remoteslot,
|
||||||
List *conflicttuples);
|
List *conflicttuples);
|
||||||
extern void InitConflictIndexes(ResultRelInfo *relInfo);
|
extern void InitConflictIndexes(struct ResultRelInfo *relInfo);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
Reference in New Issue
Block a user