100 errmsg(
"a backup is already in progress in this session")));
112 "on-line backup context",
156#define PG_BACKUP_STOP_V2_COLS 3
166 elog(
ERROR,
"return type must be a row type");
171 errmsg(
"backup is not in progress"),
172 errhint(
"Did you call pg_backup_start()?")));
214 errmsg(
"recovery is in progress"),
215 errhint(
"WAL control functions cannot be executed during recovery.")));
239 errmsg(
"recovery is in progress"),
240 errhint(
"%s cannot be executed during recovery.",
241 "pg_log_standby_snapshot()")));
246 errmsg(
"pg_log_standby_snapshot() can only be used if \"wal_level\" >= \"replica\"")));
272 errmsg(
"recovery is in progress"),
273 errhint(
"WAL control functions cannot be executed during recovery.")));
278 errmsg(
"WAL level not sufficient for creating a restore point"),
279 errhint(
"\"wal_level\" must be set to \"replica\" or \"logical\" at server start.")));
286 errmsg(
"value too long for restore point (maximum %d characters)",
MAXFNAMELEN - 1)));
311 errmsg(
"recovery is in progress"),
312 errhint(
"WAL control functions cannot be executed during recovery.")));
332 errmsg(
"recovery is in progress"),
333 errhint(
"WAL control functions cannot be executed during recovery.")));
353 errmsg(
"recovery is in progress"),
354 errhint(
"WAL control functions cannot be executed during recovery.")));
419 errmsg(
"recovery is in progress"),
420 errhint(
"%s cannot be executed during recovery.",
421 "pg_walfile_name_offset()")));
478 errmsg(
"recovery is in progress"),
479 errhint(
"%s cannot be executed during recovery.",
480 "pg_walfile_name()")));
496#define PG_SPLIT_WALFILE_NAME_COLS 2
518 errmsg(
"invalid WAL file name \"%s\"", fname)));
523 elog(
ERROR,
"return type must be a row type");
539#undef PG_SPLIT_WALFILE_NAME_COLS
554 errmsg(
"recovery is not in progress"),
555 errhint(
"Recovery control functions can only be executed during recovery.")));
560 errmsg(
"standby promotion is ongoing"),
561 errhint(
"%s cannot be executed after promotion is triggered.",
562 "pg_wal_replay_pause()")));
584 errmsg(
"recovery is not in progress"),
585 errhint(
"Recovery control functions can only be executed during recovery.")));
590 errmsg(
"standby promotion is ongoing"),
591 errhint(
"%s cannot be executed after promotion is triggered.",
592 "pg_wal_replay_resume()")));
608 errmsg(
"recovery is not in progress"),
609 errhint(
"Recovery control functions can only be executed during recovery.")));
631 errmsg(
"recovery is not in progress"),
632 errhint(
"Recovery control functions can only be executed during recovery.")));
699 errmsg(
"recovery is not in progress"),
700 errhint(
"Recovery control functions can only be executed during recovery.")));
705 errmsg(
"\"wait_seconds\" must not be negative or zero")));
712 errmsg(
"could not create file \"%s\": %m",
718 errmsg(
"could not write file \"%s\": %m",
727 errmsg(
"failed to send signal to postmaster: %m")));
735#define WAITS_PER_SECOND 10
759 errmsg(
"terminating connection due to unexpected postmaster exit"),
765 "server did not promote within %d seconds",
815 elog(
ERROR,
"return type must be a row type");
bool has_privs_of_role(Oid member, Oid role)
Datum numeric_in(PG_FUNCTION_ARGS)
static Datum values[MAXATTR]
#define CStringGetTextDatum(s)
#define Assert(condition)
int errcode_for_file_access(void)
int errcode(int sqlerrcode)
int errhint(const char *fmt,...) pg_attribute_printf(1
int int int errmsg_plural(const char *fmt_singular, const char *fmt_plural, unsigned long n,...) pg_attribute_printf(1
#define ereport(elevel,...)
TupleDesc BlessTupleDesc(TupleDesc tupdesc)
FILE * AllocateFile(const char *name, const char *mode)
#define palloc0_array(type, count)
#define palloc0_object(type)
#define PG_GETARG_TEXT_PP(n)
#define DirectFunctionCall2(func, arg1, arg2)
#define PG_GETARG_DATUM(n)
#define PG_RETURN_TEXT_P(x)
#define PG_GETARG_INT32(n)
#define PG_GETARG_BOOL(n)
#define PG_RETURN_DATUM(x)
#define DirectFunctionCall3(func, arg1, arg2, arg3)
#define PG_RETURN_BOOL(x)
TypeFuncClass get_call_result_type(FunctionCallInfo fcinfo, Oid *resultTypeId, TupleDesc *resultTupleDesc)
static Datum HeapTupleGetDatum(const HeapTupleData *tuple)
HeapTuple heap_form_tuple(TupleDesc tupleDescriptor, const Datum *values, const bool *isnull)
void ResetLatch(Latch *latch)
int WaitLatch(Latch *latch, int wakeEvents, long timeout, uint32 wait_event_info)
void MemoryContextReset(MemoryContext context)
char * pstrdup(const char *in)
void pfree(void *pointer)
MemoryContext TopMemoryContext
void MemoryContextDelete(MemoryContext context)
#define AllocSetContextCreate
#define ALLOCSET_START_SMALL_SIZES
#define CHECK_FOR_INTERRUPTS()
static MemoryContext MemoryContextSwitchTo(MemoryContext context)
static char promote_file[MAXPGPATH]
Datum pg_lsn_mi(PG_FUNCTION_ARGS)
static Datum LSNGetDatum(XLogRecPtr X)
static char buf[DEFAULT_XLOG_SEG_SIZE]
static unsigned char pg_ascii_toupper(unsigned char ch)
static Datum Int64GetDatum(int64 X)
static Datum BoolGetDatum(bool X)
static Datum ObjectIdGetDatum(Oid X)
static Datum CStringGetDatum(const char *X)
static Datum Int32GetDatum(int32 X)
static Datum UInt32GetDatum(uint32 X)
static void SpinLockRelease(volatile slock_t *lock)
static void SpinLockAcquire(volatile slock_t *lock)
XLogRecPtr LogStandbySnapshot(void)
StringInfo makeStringInfo(void)
XLogRecPtr lastReplayedEndRecPtr
TimeLineID lastReplayedTLI
bool SharedPromoteIsTriggered
TimestampTz currentChunkStartTime
XLogRecPtr replayEndRecPtr
TimestampTz recoveryLastXTime
RecoveryPauseState recoveryPauseState
XLogRecPtr lastReplayedReadRecPtr
TupleDesc CreateTemplateTupleDesc(int natts)
void TupleDescFinalize(TupleDesc tupdesc)
void TupleDescInitEntry(TupleDesc desc, AttrNumber attributeNumber, const char *attributeName, Oid oidtypeid, int32 typmod, int attdim)
static Datum TimestampTzGetDatum(TimestampTz X)
#define PG_RETURN_TIMESTAMPTZ(x)
text * cstring_to_text(const char *s)
char * text_to_cstring(const text *t)
#define WL_POSTMASTER_DEATH
XLogRecPtr GetWalRcvFlushRecPtr(XLogRecPtr *latestChunkStart, TimeLineID *receiveTLI)
bool RecoveryInProgress(void)
TimeLineID GetWALInsertionTimeLine(void)
XLogRecPtr RequestXLogSwitch(bool mark_unimportant)
SessionBackupState get_backup_status(void)
XLogRecPtr GetXLogInsertRecPtr(void)
XLogRecPtr GetFlushRecPtr(TimeLineID *insertTLI)
void register_persistent_abort_backup_handler(void)
XLogRecPtr GetXLogWriteRecPtr(void)
void do_pg_backup_start(const char *backupidstr, bool fast, List **tablespaces, BackupState *state, StringInfo tblspcmapfile)
XLogRecPtr XLogRestorePoint(const char *rpName)
void do_pg_backup_stop(BackupState *state, bool waitforarchive)
#define PROMOTE_SIGNAL_FILE
#define XLogStandbyInfoActive()
#define XLogSegmentOffset(xlogptr, wal_segsz_bytes)
static bool IsXLogFileName(const char *fname)
static void XLogFromFileName(const char *fname, TimeLineID *tli, XLogSegNo *logSegNo, int wal_segsz_bytes)
#define XLByteToSeg(xlrp, logSegNo, wal_segsz_bytes)
static void XLogFileName(char *fname, TimeLineID tli, XLogSegNo logSegNo, int wal_segsz_bytes)
char * build_backup_content(BackupState *state, bool ishistoryfile)
#define XLogRecPtrIsValid(r)
Datum pg_is_wal_replay_paused(PG_FUNCTION_ARGS)
Datum pg_wal_lsn_diff(PG_FUNCTION_ARGS)
Datum pg_stat_get_recovery(PG_FUNCTION_ARGS)
Datum pg_backup_start(PG_FUNCTION_ARGS)
Datum pg_create_restore_point(PG_FUNCTION_ARGS)
Datum pg_current_wal_insert_lsn(PG_FUNCTION_ARGS)
Datum pg_switch_wal(PG_FUNCTION_ARGS)
Datum pg_is_in_recovery(PG_FUNCTION_ARGS)
#define PG_SPLIT_WALFILE_NAME_COLS
Datum pg_split_walfile_name(PG_FUNCTION_ARGS)
Datum pg_backup_stop(PG_FUNCTION_ARGS)
Datum pg_last_xact_replay_timestamp(PG_FUNCTION_ARGS)
Datum pg_log_standby_snapshot(PG_FUNCTION_ARGS)
static const char * GetRecoveryPauseStateString(RecoveryPauseState pause_state)
static BackupState * backup_state
Datum pg_current_wal_lsn(PG_FUNCTION_ARGS)
Datum pg_last_wal_receive_lsn(PG_FUNCTION_ARGS)
#define PG_BACKUP_STOP_V2_COLS
Datum pg_walfile_name(PG_FUNCTION_ARGS)
Datum pg_current_wal_flush_lsn(PG_FUNCTION_ARGS)
Datum pg_walfile_name_offset(PG_FUNCTION_ARGS)
static MemoryContext backupcontext
static StringInfo tablespace_map
Datum pg_promote(PG_FUNCTION_ARGS)
Datum pg_get_wal_replay_pause_state(PG_FUNCTION_ARGS)
Datum pg_last_wal_replay_lsn(PG_FUNCTION_ARGS)
Datum pg_wal_replay_pause(PG_FUNCTION_ARGS)
Datum pg_wal_replay_resume(PG_FUNCTION_ARGS)
void SetRecoveryPause(bool recoveryPause)
void WakeupRecovery(void)
bool PromoteIsTriggered(void)
XLogRecoveryCtlData * XLogRecoveryCtl
XLogRecPtr GetXLogReplayRecPtr(TimeLineID *replayTLI)
RecoveryPauseState GetRecoveryPauseState(void)
TimestampTz GetLatestXTime(void)
@ RECOVERY_PAUSE_REQUESTED