#include "postgres.h"
#include <dirent.h>
#include <limits.h>
#include <signal.h>
#include <sys/stat.h>
#include <unistd.h>
#include "access/transam.h"
#include "access/xlog_internal.h"
#include "access/xlogreader.h"
#include "access/xlogrecord.h"
#include "access/xlogstats.h"
#include "common/fe_memutils.h"
#include "common/file_perm.h"
#include "common/file_utils.h"
#include "common/logging.h"
#include "common/relpath.h"
#include "getopt_long.h"
#include "rmgrdesc.h"
#include "storage/bufpage.h"
Go to the source code of this file.
Definition at line 12 of file pg_waldump.c.
Definition at line 128 of file pg_waldump.c.
References pg_check_dir(), pg_dir_create_mode, pg_fatal, and pg_mkdir_p().
Referenced by main().
Definition at line 292 of file pg_waldump.c.
References datadir, directory, MAXPGPATH, pg_fatal, pg_strdup(), search_directory(), snprintf, and XLOGDIR.
Referenced by main().
Definition at line 792 of file pg_waldump.c.
References XLogDumpConfig::already_displayed_records, XLogDumpConfig::bkp_details, BlockNumberIsValid(), close, create_fullpage_directory(), RelFileLocator::dbOid, directory, emptyRelFileLocator, XLogReaderState::EndRecPtr, EXIT_FAILURE, EXIT_SUCCESS, fd(), XLogDumpConfig::filter_by_extended, XLogDumpConfig::filter_by_fpw, XLogDumpConfig::filter_by_relation, XLogDumpConfig::filter_by_relation_block, XLogDumpConfig::filter_by_relation_block_enabled, XLogDumpConfig::filter_by_relation_enabled, XLogDumpConfig::filter_by_relation_forknum, XLogDumpConfig::filter_by_rmgr, XLogDumpConfig::filter_by_rmgr_enabled, XLogDumpConfig::filter_by_xid, XLogDumpConfig::filter_by_xid_enabled, XLogDumpConfig::follow, forkname_to_number(), get_progname(), getopt_long(), GetRmgrDesc(), identify_target_directory(), InvalidBlockNumber, InvalidForkNumber, InvalidTransactionId, InvalidXLogRecPtr, LSN_FORMAT_ARGS, ngettext, no_argument, OidIsValid, open_file_in_directory(), optarg, optind, optional_argument, pg_fatal, pg_log_error, pg_log_error_detail, pg_log_error_hint, pg_log_info, pg_logging_init(), pg_strcasecmp(), pg_strdup(), PG_TEXTDOMAIN, pg_usleep(), pqsignal, print_rmgr_list(), progname, XLogDumpConfig::quiet, XLogReaderState::ReadRecPtr, RelFileNumberIsValid, RelFileLocator::relNumber, required_argument, RM_MAX_BUILTIN_ID, RmgrIdIsCustom(), XLogDumpConfig::save_fullpage_path, set_pglocale_pgservice(), sigint_handler(), RelFileLocator::spcOid, split_path(), XLogDumpConfig::stats, XLogDumpConfig::stats_per_record, XLogDumpConfig::stop_after_records, time_to_stop, usage(), val, verify_directory(), WALDumpCloseSegment(), WALDumpOpenSegment(), WALDumpReadPage(), WalSegSz, XLogRecord::xl_rmid, XL_ROUTINE, XLogRecord::xl_xid, XLByteInSeg, XLogDumpDisplayRecord(), XLogDumpDisplayStats(), XLogFindNextRecord(), XLogFromFileName(), XLogReaderAllocate(), XLogReaderFree(), XLogReadRecord(), XLogRecordHasFPW(), XLogRecordMatchesRelationBlock(), XLogRecordSaveFPWs(), XLogRecPtrIsInvalid, XLogRecStoreStats(), XLogSegmentOffset, and XLogSegNoOffsetToRecPtr.
Definition at line 188 of file pg_waldump.c.
References Assert(), directory, fd(), MAXPGPATH, PG_BINARY, pg_fatal, and snprintf.
Referenced by main(), search_directory(), and WALDumpOpenSegment().
Definition at line 98 of file pg_waldump.c.
References GetRmgrDesc(), i, printf, and RM_MAX_BUILTIN_ID.
Referenced by main().
Definition at line 210 of file pg_waldump.c.
References buf, close, closedir(), dirent::d_name, directory, fd(), if(), IsValidWalSegSize, IsXLogFileName(), ngettext, open_file_in_directory(), opendir(), pg_fatal, pg_log_error, pg_log_error_detail, pg_strdup(), read, readdir(), WalSegSz, and XLogLongPageHeaderData::xlp_seg_size.
Referenced by identify_target_directory().
Definition at line 161 of file pg_waldump.c.
References pg_strdup(), and pnstrdup().
Referenced by main().
Definition at line 756 of file pg_waldump.c.
References _, printf, and progname.
Referenced by main().
Definition at line 113 of file pg_waldump.c.
References closedir(), directory, and opendir().
Referenced by main().
Definition at line 380 of file pg_waldump.c.
References close.
Referenced by main().
Definition at line 338 of file pg_waldump.c.
References MAXPGPATH, open_file_in_directory(), pg_fatal, pg_usleep(), and XLogFileName().
Referenced by main().
Definition at line 389 of file pg_waldump.c.
References InvalidXLogRecPtr, MAXPGPATH, pg_fatal, WALRead(), WALReadError::wre_errno, WALReadError::wre_off, WALReadError::wre_read, WALReadError::wre_req, WALReadError::wre_seg, WALOpenSegment::ws_segno, WALOpenSegment::ws_tli, and XLogFileName().
Referenced by main().
Definition at line 546 of file pg_waldump.c.
References XLogDumpConfig::bkp_details, StringInfoData::data, GetRmgrDesc(), initStringInfo(), LSN_FORMAT_ARGS, pfree(), printf, XLogReaderState::ReadRecPtr, resetStringInfo(), RmgrDescData::rm_desc, RmgrDescData::rm_identify, RmgrDescData::rm_name, XLogRecGetBlockRefInfo(), XLogRecGetInfo, XLogRecGetLen(), XLogRecGetPrev, XLogRecGetRmid, XLogRecGetTotalLen, XLogRecGetXid, and XLR_INFO_MASK.
Referenced by main().
Definition at line 626 of file pg_waldump.c.
References XLogRecStats::count, XLogStats::count, XLogRecStats::fpi_len, GetRmgrDesc(), LSN_FORMAT_ARGS, MAX_XLINFO_TYPES, printf, psprintf(), XLogRecStats::rec_len, XLogStats::record_stats, RmgrDescData::rm_identify, RM_MAX_ID, RmgrDescData::rm_name, XLogStats::rmgr_stats, RmgrIdIsCustom(), RmgrIdIsValid, XLogDumpConfig::stats_per_record, XLogDumpStatsRow(), and XLogRecPtrIsInvalid.
Referenced by main().
Definition at line 585 of file pg_waldump.c.
Referenced by XLogDumpDisplayStats().
Definition at line 469 of file pg_waldump.c.
References XLogRecHasBlockImage, XLogRecHasBlockRef, and XLogRecMaxBlockId.
Referenced by main().
Definition at line 438 of file pg_waldump.c.
References emptyRelFileLocator, InvalidBlockNumber, InvalidForkNumber, RelFileLocatorEquals, XLogRecGetBlockTagExtended(), and XLogRecMaxBlockId.
Referenced by main().
Definition at line 490 of file pg_waldump.c.
References buf, RelFileLocator::dbOid, XLogReaderState::errormsg_buf, filename, FORKNAMECHARS, forkNames, if(), LSN_FORMAT_ARGS, MAX_FORKNUM, MAXPGPATH, PG_BINARY_W, pg_fatal, XLogReaderState::ReadRecPtr, RelFileLocator::relNumber, RestoreBlockImage(), XLogReaderState::seg, snprintf, RelFileLocator::spcOid, sprintf, WALOpenSegment::ws_tli, XLogRecGetBlockTagExtended(), XLogRecHasBlockImage, XLogRecHasBlockRef, and XLogRecMaxBlockId.
Referenced by main().
Definition at line 45 of file pg_waldump.c.
Referenced by main(), and XLogRecordMatchesRelationBlock().
Definition at line 40 of file pg_waldump.c.
Definition at line 43 of file pg_waldump.c.
Referenced by main(), and sigint_handler().
Definition at line 42 of file pg_waldump.c.
Referenced by main(), and search_directory().