|
24 | 24 | #include <fcntl.h>
|
25 | 25 |
|
26 | 26 | #include "access/xlog.h"
|
| 27 | +#include "access/xlog_internal.h" |
27 | 28 | #include "catalog/pg_control.h"
|
28 | 29 |
|
29 | 30 |
|
@@ -95,6 +96,8 @@ main(int argc, char *argv[])
|
95 | 96 | char sysident_str[32];
|
96 | 97 | const char *strftime_fmt = "%c";
|
97 | 98 | const char *progname;
|
| 99 | + XLogSegNo segno; |
| 100 | + char xlogfilename[MAXFNAMELEN]; |
98 | 101 |
|
99 | 102 | set_pglocale_pgservice(argv[0], PG_TEXTDOMAIN("pg_controldata"));
|
100 | 103 |
|
@@ -170,6 +173,13 @@ main(int argc, char *argv[])
|
170 | 173 | strftime(ckpttime_str, sizeof(ckpttime_str), strftime_fmt,
|
171 | 174 | localtime(&time_tmp));
|
172 | 175 |
|
| 176 | + /* |
| 177 | + * Calculate name of the WAL file containing the latest checkpoint's REDO |
| 178 | + * start point. |
| 179 | + */ |
| 180 | + XLByteToSeg(ControlFile.checkPointCopy.redo, segno); |
| 181 | + XLogFileName(xlogfilename, ControlFile.checkPointCopy.ThisTimeLineID, segno); |
| 182 | + |
173 | 183 | /*
|
174 | 184 | * Format system_identifier separately to keep platform-dependent format
|
175 | 185 | * code out of the translatable message string.
|
@@ -201,6 +211,8 @@ main(int argc, char *argv[])
|
201 | 211 | printf(_("Latest checkpoint's REDO location: %X/%X\n"),
|
202 | 212 | (uint32) (ControlFile.checkPointCopy.redo >> 32),
|
203 | 213 | (uint32) ControlFile.checkPointCopy.redo);
|
| 214 | + printf(_("Latest checkpoint's REDO WAL file: %s\n"), |
| 215 | + xlogfilename); |
204 | 216 | printf(_("Latest checkpoint's TimeLineID: %u\n"),
|
205 | 217 | ControlFile.checkPointCopy.ThisTimeLineID);
|
206 | 218 | printf(_("Latest checkpoint's full_page_writes: %s\n"),
|
|
0 commit comments