Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 77cb08b

Browse files
committed
Avoid including explain.h in explain_format.h and explain_dr.h
As per a suggestion from Tom Lane, we do this by declaring "struct ExplainState" here and refer to that rather than "ExplainState". Also per Tom, CreateExplainSerializeDestReceiver was still defined in explain.h in addition to explain_dr.h. Remove leftover prototype. Reviewed-by: Tom Lane <tgl@sss.pgh.pa.us> Discussion: http://postgr.es/m/CA+TgmoYtaad3i21V0jqua-fbr+CR0ix6uBvEX8_s6BG96abd=g@mail.gmail.com
1 parent 51d3e27 commit 77cb08b

File tree

5 files changed

+30
-23
lines changed

5 files changed

+30
-23
lines changed

src/backend/commands/explain_dr.c

+1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
*/
1414
#include "postgres.h"
1515

16+
#include "commands/explain.h"
1617
#include "commands/explain_dr.h"
1718
#include "libpq/pqformat.h"
1819
#include "libpq/protocol.h"

src/backend/tcop/dest.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
#include "access/xact.h"
3434
#include "commands/copy.h"
3535
#include "commands/createas.h"
36-
#include "commands/explain.h"
36+
#include "commands/explain_dr.h"
3737
#include "commands/matview.h"
3838
#include "executor/functions.h"
3939
#include "executor/tqueue.h"

src/include/commands/explain.h

-2
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,4 @@ extern void ExplainPrintJITSummary(ExplainState *es, QueryDesc *queryDesc);
120120
extern void ExplainQueryText(ExplainState *es, QueryDesc *queryDesc);
121121
extern void ExplainQueryParameters(ExplainState *es, ParamListInfo params, int maxlen);
122122

123-
extern DestReceiver *CreateExplainSerializeDestReceiver(ExplainState *es);
124-
125123
#endif /* EXPLAIN_H */

src/include/commands/explain_dr.h

+4-2
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,10 @@
1313
#ifndef EXPLAIN_DR_H
1414
#define EXPLAIN_DR_H
1515

16-
#include "commands/explain.h"
1716
#include "executor/instrument.h"
17+
#include "tcop/dest.h"
18+
19+
struct ExplainState; /* avoid including explain.h here */
1820

1921
/* Instrumentation data for EXPLAIN's SERIALIZE option */
2022
typedef struct SerializeMetrics
@@ -24,7 +26,7 @@ typedef struct SerializeMetrics
2426
BufferUsage bufferUsage; /* buffers accessed during serialization */
2527
} SerializeMetrics;
2628

27-
extern DestReceiver *CreateExplainSerializeDestReceiver(ExplainState *es);
29+
extern DestReceiver *CreateExplainSerializeDestReceiver(struct ExplainState *es);
2830
extern SerializeMetrics GetSerializationMetrics(DestReceiver *dest);
2931

3032
#endif

src/include/commands/explain_format.h

+24-18
Original file line numberDiff line numberDiff line change
@@ -13,40 +13,46 @@
1313
#ifndef EXPLAIN_FORMAT_H
1414
#define EXPLAIN_FORMAT_H
1515

16-
#include "commands/explain.h"
16+
#include "nodes/pg_list.h"
17+
18+
struct ExplainState; /* avoid including explain.h here */
1719

1820
extern void ExplainPropertyList(const char *qlabel, List *data,
19-
ExplainState *es);
21+
struct ExplainState *es);
2022
extern void ExplainPropertyListNested(const char *qlabel, List *data,
21-
ExplainState *es);
23+
struct ExplainState *es);
2224
extern void ExplainPropertyText(const char *qlabel, const char *value,
23-
ExplainState *es);
25+
struct ExplainState *es);
2426
extern void ExplainPropertyInteger(const char *qlabel, const char *unit,
25-
int64 value, ExplainState *es);
27+
int64 value, struct ExplainState *es);
2628
extern void ExplainPropertyUInteger(const char *qlabel, const char *unit,
27-
uint64 value, ExplainState *es);
29+
uint64 value, struct ExplainState *es);
2830
extern void ExplainPropertyFloat(const char *qlabel, const char *unit,
29-
double value, int ndigits, ExplainState *es);
31+
double value, int ndigits,
32+
struct ExplainState *es);
3033
extern void ExplainPropertyBool(const char *qlabel, bool value,
31-
ExplainState *es);
34+
struct ExplainState *es);
3235

3336
extern void ExplainOpenGroup(const char *objtype, const char *labelname,
34-
bool labeled, ExplainState *es);
37+
bool labeled, struct ExplainState *es);
3538
extern void ExplainCloseGroup(const char *objtype, const char *labelname,
36-
bool labeled, ExplainState *es);
39+
bool labeled, struct ExplainState *es);
3740

3841
extern void ExplainOpenSetAsideGroup(const char *objtype, const char *labelname,
39-
bool labeled, int depth, ExplainState *es);
40-
extern void ExplainSaveGroup(ExplainState *es, int depth, int *state_save);
41-
extern void ExplainRestoreGroup(ExplainState *es, int depth, int *state_save);
42+
bool labeled, int depth,
43+
struct ExplainState *es);
44+
extern void ExplainSaveGroup(struct ExplainState *es, int depth,
45+
int *state_save);
46+
extern void ExplainRestoreGroup(struct ExplainState *es, int depth,
47+
int *state_save);
4248

4349
extern void ExplainDummyGroup(const char *objtype, const char *labelname,
44-
ExplainState *es);
50+
struct ExplainState *es);
4551

46-
extern void ExplainBeginOutput(ExplainState *es);
47-
extern void ExplainEndOutput(ExplainState *es);
48-
extern void ExplainSeparatePlans(ExplainState *es);
52+
extern void ExplainBeginOutput(struct ExplainState *es);
53+
extern void ExplainEndOutput(struct ExplainState *es);
54+
extern void ExplainSeparatePlans(struct ExplainState *es);
4955

50-
extern void ExplainIndentText(ExplainState *es);
56+
extern void ExplainIndentText(struct ExplainState *es);
5157

5258
#endif

0 commit comments

Comments
 (0)