93 errmsg(
"could not open file \"%s\" for reading: %m",
96 if ((
fd = open(ControlFilePath, O_RDONLY |
PG_BINARY, 0)) == -1)
97 pg_fatal(
"could not open file \"%s\" for reading: %m",
108 errmsg(
"could not read file \"%s\": %m", ControlFilePath)));
110 pg_fatal(
"could not read file \"%s\": %m", ControlFilePath);
116 errmsg(
"could not read file \"%s\": read %d of %zu",
119 pg_fatal(
"could not read file \"%s\": read %d of %zu",
128 errmsg(
"could not close file \"%s\": %m",
132 pg_fatal(
"could not close file \"%s\": %m", ControlFilePath);
171 "The byte ordering used to store the pg_control file might not match the one\n"
172 "used by this program. In that case the results below would be incorrect, and\n"
173 "the PostgreSQL installation would be incompatible with this data directory.");
225 errmsg(
"could not open file \"%s\": %m",
228 if ((
fd = open(ControlFilePath, O_WRONLY |
PG_BINARY,
230 pg_fatal(
"could not open file \"%s\": %m", ControlFilePath);
246 errmsg(
"could not write file \"%s\": %m",
249 pg_fatal(
"could not write file \"%s\": %m", ControlFilePath);
263 errmsg(
"could not fsync file \"%s\": %m",
268 pg_fatal(
"could not fsync file \"%s\": %m", ControlFilePath);
277 errmsg(
"could not close file \"%s\": %m",
280 pg_fatal(
"could not close file \"%s\": %m", ControlFilePath);
#define Assert(condition)
void update_controlfile(const char *DataDir, ControlFileData *ControlFile, bool do_sync)
ControlFileData * get_controlfile(const char *DataDir, bool *crc_ok_p)
ControlFileData * get_controlfile_by_exact_path(const char *ControlFilePath, bool *crc_ok_p)
int errcode_for_file_access(void)
int errcode(int sqlerrcode)
int errmsg(const char *fmt,...)
#define ereport(elevel,...)
int CloseTransientFile(int fd)
int BasicOpenFile(const char *fileName, int fileFlags)
int OpenTransientFile(const char *fileName, int fileFlags)
#define palloc_object(type)
#define ERRCODE_DATA_CORRUPTED
#define PG_CONTROL_FILE_SIZE
#define COMP_CRC32C(crc, data, len)
#define EQ_CRC32C(c1, c2)
#define pg_log_warning(...)
static int fd(const char *x, int i)
void pg_usleep(long microsec)
uint32 pg_control_version
static void pgstat_report_wait_start(uint32 wait_event_info)
static void pgstat_report_wait_end(void)
static ControlFileData * ControlFile
#define XLOG_CONTROL_FILE