79 errmsg(
"could not open file \"%s\" for reading: %m",
82 if ((
fd = open(ControlFilePath, O_RDONLY |
PG_BINARY, 0)) == -1)
83 pg_fatal(
"could not open file \"%s\" for reading: %m",
94 errmsg(
"could not read file \"%s\": %m", ControlFilePath)));
96 pg_fatal(
"could not read file \"%s\": %m", ControlFilePath);
102 errmsg(
"could not read file \"%s\": read %d of %zu",
105 pg_fatal(
"could not read file \"%s\": read %d of %zu",
114 errmsg(
"could not close file \"%s\": %m",
118 pg_fatal(
"could not close file \"%s\": %m", ControlFilePath);
157 "The byte ordering used to store the pg_control file might not match the one\n"
158 "used by this program. In that case the results below would be incorrect, and\n"
159 "the PostgreSQL installation would be incompatible with this data directory.");
211 errmsg(
"could not open file \"%s\": %m",
214 if ((
fd = open(ControlFilePath, O_WRONLY |
PG_BINARY,
216 pg_fatal(
"could not open file \"%s\": %m", ControlFilePath);
232 errmsg(
"could not write file \"%s\": %m",
235 pg_fatal(
"could not write file \"%s\": %m", ControlFilePath);
249 errmsg(
"could not fsync file \"%s\": %m",
254 pg_fatal(
"could not fsync file \"%s\": %m", ControlFilePath);
263 errmsg(
"could not close file \"%s\": %m",
266 pg_fatal(
"could not close file \"%s\": %m", ControlFilePath);
void update_controlfile(const char *DataDir, ControlFileData *ControlFile, bool do_sync)
ControlFileData * get_controlfile(const char *DataDir, bool *crc_ok_p)
elog(ERROR, "%s: %s", p2, msg)
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)
Assert(fmt[strlen(fmt) - 1] !='\n')
#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