Skip to content

Commit 5276687

Browse files
committed
Make xlog_internal.h includable in frontend context.
This makes unnecessary the ugly hack used to #include postgres.h in pg_basebackup. Based on Alvaro Herrera's patch
1 parent 6264cd3 commit 5276687

File tree

12 files changed

+58
-56
lines changed

12 files changed

+58
-56
lines changed

src/backend/access/rmgrdesc/xlogdesc.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/xlog.h"
1718
#include "access/xlog_internal.h"
1819
#include "catalog/pg_control.h"
1920
#include "utils/guc.h"

src/backend/access/transam/xlogarchive.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
#include <signal.h>
2121
#include <unistd.h>
2222

23+
#include "access/xlog.h"
2324
#include "access/xlog_internal.h"
2425
#include "miscadmin.h"
2526
#include "postmaster/startup.h"

src/backend/access/transam/xlogfuncs.c

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

1919
#include "access/htup_details.h"
2020
#include "access/xlog.h"
21+
#include "access/xlog_fn.h"
2122
#include "access/xlog_internal.h"
2223
#include "access/xlogutils.h"
2324
#include "catalog/catalog.h"

src/backend/postmaster/bgwriter.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@
3939
#include <time.h>
4040
#include <unistd.h>
4141

42+
#include "access/xlog.h"
4243
#include "access/xlog_internal.h"
4344
#include "libpq/pqsignal.h"
4445
#include "miscadmin.h"

src/backend/postmaster/checkpointer.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@
4141
#include <time.h>
4242
#include <unistd.h>
4343

44+
#include "access/xlog.h"
4445
#include "access/xlog_internal.h"
4546
#include "libpq/pqsignal.h"
4647
#include "miscadmin.h"

src/backend/postmaster/pgarch.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
#include <sys/wait.h>
3333
#include <unistd.h>
3434

35+
#include "access/xlog.h"
3536
#include "access/xlog_internal.h"
3637
#include "libpq/pqsignal.h"
3738
#include "miscadmin.h"

src/bin/pg_basebackup/pg_basebackup.c

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,7 @@
1111
*-------------------------------------------------------------------------
1212
*/
1313

14-
/*
15-
* We have to use postgres.h not postgres_fe.h here, because there's so much
16-
* backend-only stuff in the XLOG include files we need. But we need a
17-
* frontend-ish environment otherwise. Hence this ugly hack.
18-
*/
19-
#define FRONTEND 1
20-
#include "postgres.h"
14+
#include "postgres_fe.h"
2115
#include "libpq-fe.h"
2216

2317
#include <unistd.h>

src/bin/pg_basebackup/pg_receivexlog.c

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,7 @@
1212
*-------------------------------------------------------------------------
1313
*/
1414

15-
/*
16-
* We have to use postgres.h not postgres_fe.h here, because there's so much
17-
* backend-only stuff in the XLOG include files we need. But we need a
18-
* frontend-ish environment otherwise. Hence this ugly hack.
19-
*/
20-
#define FRONTEND 1
21-
#include "postgres.h"
15+
#include "postgres_fe.h"
2216
#include "libpq-fe.h"
2317
#include "libpq/pqsignal.h"
2418
#include "access/xlog_internal.h"

src/bin/pg_basebackup/receivelog.c

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,7 @@
1111
* src/bin/pg_basebackup/receivelog.c
1212
*-------------------------------------------------------------------------
1313
*/
14-
15-
/*
16-
* We have to use postgres.h not postgres_fe.h here, because there's so much
17-
* backend-only stuff in the XLOG include files we need. But we need a
18-
* frontend-ish environment otherwise. Hence this ugly hack.
19-
*/
20-
#define FRONTEND 1
21-
#include "postgres.h"
14+
#include "postgres_fe.h"
2215

2316
#include <sys/stat.h>
2417
#include <sys/time.h>
@@ -30,8 +23,6 @@
3023

3124
#include "libpq-fe.h"
3225
#include "access/xlog_internal.h"
33-
#include "utils/datetime.h"
34-
#include "utils/timestamp.h"
3526

3627
#include "receivelog.h"
3728
#include "streamutil.h"

src/bin/pg_basebackup/streamutil.c

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,7 @@
1111
*-------------------------------------------------------------------------
1212
*/
1313

14-
/*
15-
* We have to use postgres.h not postgres_fe.h here, because there's so much
16-
* backend-only stuff in the XLOG include files we need. But we need a
17-
* frontend-ish environment otherwise. Hence this ugly hack.
18-
*/
19-
#define FRONTEND 1
20-
#include "postgres.h"
14+
#include "postgres_fe.h"
2115
#include "streamutil.h"
2216

2317
#include <stdio.h>

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy