PostgreSQL Source Code
git master
|
#include "postgres.h"
#include <unistd.h>
#include "access/htup_details.h"
#include "access/xlog_internal.h"
#include "access/xlogbackup.h"
#include "access/xlogrecovery.h"
#include "catalog/pg_type.h"
#include "funcapi.h"
#include "miscadmin.h"
#include "pgstat.h"
#include "replication/walreceiver.h"
#include "storage/fd.h"
#include "storage/latch.h"
#include "storage/standby.h"
#include "utils/builtins.h"
#include "utils/memutils.h"
#include "utils/pg_lsn.h"
#include "utils/timestamp.h"
Go to the source code of this file.
Macros | |
#define | PG_BACKUP_STOP_V2_COLS 3 |
#define | PG_SPLIT_WALFILE_NAME_COLS 2 |
#define | WAITS_PER_SECOND 10 |
Variables | |
static BackupState * | backup_state = NULL |
static StringInfo | tablespace_map = NULL |
static MemoryContext | backupcontext = NULL |
#define PG_BACKUP_STOP_V2_COLS 3 |
#define PG_SPLIT_WALFILE_NAME_COLS 2 |
#define WAITS_PER_SECOND 10 |
Datum pg_backup_start | ( | PG_FUNCTION_ARGS | ) |
Definition at line 57 of file xlogfuncs.c.
References ALLOCSET_START_SMALL_SIZES, AllocSetContextCreate, backup_state, backupcontext, do_pg_backup_start(), ereport, errcode(), errmsg(), ERROR, get_backup_status(), makeStringInfo(), MemoryContextReset(), MemoryContextSwitchTo(), palloc0(), PG_GETARG_BOOL, PG_GETARG_TEXT_PP, PG_RETURN_LSN, register_persistent_abort_backup_handler(), SESSION_BACKUP_RUNNING, BackupState::startpoint, tablespace_map, text_to_cstring(), and TopMemoryContext.
Datum pg_backup_stop | ( | PG_FUNCTION_ARGS | ) |
Definition at line 124 of file xlogfuncs.c.
References Assert, backup_state, backupcontext, build_backup_content(), CStringGetTextDatum, StringInfoData::data, do_pg_backup_stop(), elog, ereport, errcode(), errhint(), errmsg(), ERROR, get_backup_status(), get_call_result_type(), heap_form_tuple(), HeapTupleGetDatum(), LSNGetDatum(), MemoryContextDelete(), pfree(), PG_BACKUP_STOP_V2_COLS, PG_GETARG_BOOL, PG_RETURN_DATUM, SESSION_BACKUP_RUNNING, BackupState::stoppoint, tablespace_map, TYPEFUNC_COMPOSITE, and values.
Datum pg_create_restore_point | ( | PG_FUNCTION_ARGS | ) |
Definition at line 233 of file xlogfuncs.c.
References ereport, errcode(), errhint(), errmsg(), ERROR, MAXFNAMELEN, PG_GETARG_TEXT_PP, PG_RETURN_LSN, RecoveryInProgress(), text_to_cstring(), XLogIsNeeded, and XLogRestorePoint().
Datum pg_current_wal_flush_lsn | ( | PG_FUNCTION_ARGS | ) |
Definition at line 316 of file xlogfuncs.c.
References ereport, errcode(), errhint(), errmsg(), ERROR, GetFlushRecPtr(), PG_RETURN_LSN, and RecoveryInProgress().
Datum pg_current_wal_insert_lsn | ( | PG_FUNCTION_ARGS | ) |
Definition at line 295 of file xlogfuncs.c.
References ereport, errcode(), errhint(), errmsg(), ERROR, GetXLogInsertRecPtr(), PG_RETURN_LSN, and RecoveryInProgress().
Datum pg_current_wal_lsn | ( | PG_FUNCTION_ARGS | ) |
Definition at line 274 of file xlogfuncs.c.
References ereport, errcode(), errhint(), errmsg(), ERROR, GetXLogWriteRecPtr(), PG_RETURN_LSN, and RecoveryInProgress().
Datum pg_get_wal_replay_pause_state | ( | PG_FUNCTION_ARGS | ) |
Definition at line 593 of file xlogfuncs.c.
References Assert, cstring_to_text(), ereport, errcode(), errhint(), errmsg(), ERROR, GetRecoveryPauseState(), PG_RETURN_TEXT_P, RECOVERY_NOT_PAUSED, RECOVERY_PAUSE_REQUESTED, RECOVERY_PAUSED, and RecoveryInProgress().
Datum pg_is_in_recovery | ( | PG_FUNCTION_ARGS | ) |
Datum pg_is_wal_replay_paused | ( | PG_FUNCTION_ARGS | ) |
Definition at line 572 of file xlogfuncs.c.
References ereport, errcode(), errhint(), errmsg(), ERROR, GetRecoveryPauseState(), PG_RETURN_BOOL, RECOVERY_NOT_PAUSED, and RecoveryInProgress().
Datum pg_last_wal_receive_lsn | ( | PG_FUNCTION_ARGS | ) |
Definition at line 338 of file xlogfuncs.c.
References GetWalRcvFlushRecPtr(), PG_RETURN_LSN, and PG_RETURN_NULL.
Datum pg_last_wal_replay_lsn | ( | PG_FUNCTION_ARGS | ) |
Definition at line 357 of file xlogfuncs.c.
References GetXLogReplayRecPtr(), PG_RETURN_LSN, and PG_RETURN_NULL.
Datum pg_last_xact_replay_timestamp | ( | PG_FUNCTION_ARGS | ) |
Definition at line 628 of file xlogfuncs.c.
References GetLatestXTime(), PG_RETURN_NULL, and PG_RETURN_TIMESTAMPTZ.
Datum pg_log_standby_snapshot | ( | PG_FUNCTION_ARGS | ) |
Definition at line 202 of file xlogfuncs.c.
References ereport, errcode(), errhint(), errmsg(), ERROR, LogStandbySnapshot(), PG_RETURN_LSN, RecoveryInProgress(), and XLogStandbyInfoActive.
Datum pg_promote | ( | PG_FUNCTION_ARGS | ) |
Definition at line 670 of file xlogfuncs.c.
References AllocateFile(), CHECK_FOR_INTERRUPTS, ereport, errcode(), errcode_for_file_access(), errcontext, errhint(), errmsg(), errmsg_plural(), ERROR, FATAL, FreeFile(), i, kill, MyLatch, PG_GETARG_BOOL, PG_GETARG_INT32, PG_RETURN_BOOL, PostmasterPid, promote_file, PROMOTE_SIGNAL_FILE, RecoveryInProgress(), ResetLatch(), SIGUSR1, wait_seconds, WaitLatch(), WAITS_PER_SECOND, WARNING, WL_LATCH_SET, WL_POSTMASTER_DEATH, and WL_TIMEOUT.
Datum pg_split_walfile_name | ( | PG_FUNCTION_ARGS | ) |
Definition at line 463 of file xlogfuncs.c.
References buf, CStringGetDatum(), DirectFunctionCall3, elog, ereport, errcode(), errmsg(), ERROR, get_call_result_type(), heap_form_tuple(), HeapTupleGetDatum(), Int32GetDatum(), Int64GetDatum(), IsXLogFileName(), numeric_in(), ObjectIdGetDatum(), PG_GETARG_TEXT_PP, PG_RETURN_DATUM, PG_SPLIT_WALFILE_NAME_COLS, pg_toupper(), pstrdup(), snprintf, text_to_cstring(), TYPEFUNC_COMPOSITE, UINT64_FORMAT, values, wal_segment_size, and XLogFromFileName().
Datum pg_switch_wal | ( | PG_FUNCTION_ARGS | ) |
Definition at line 177 of file xlogfuncs.c.
References ereport, errcode(), errhint(), errmsg(), ERROR, PG_RETURN_LSN, RecoveryInProgress(), and RequestXLogSwitch().
Datum pg_wal_lsn_diff | ( | PG_FUNCTION_ARGS | ) |
Definition at line 652 of file xlogfuncs.c.
References DirectFunctionCall2, PG_GETARG_DATUM, pg_lsn_mi(), and PG_RETURN_DATUM.
Datum pg_wal_replay_pause | ( | PG_FUNCTION_ARGS | ) |
Definition at line 518 of file xlogfuncs.c.
References ereport, errcode(), errhint(), errmsg(), ERROR, PG_RETURN_VOID, PromoteIsTriggered(), RecoveryInProgress(), SetRecoveryPause(), and WakeupRecovery().
Datum pg_wal_replay_resume | ( | PG_FUNCTION_ARGS | ) |
Definition at line 548 of file xlogfuncs.c.
References ereport, errcode(), errhint(), errmsg(), ERROR, PG_RETURN_VOID, PromoteIsTriggered(), RecoveryInProgress(), and SetRecoveryPause().
Datum pg_walfile_name | ( | PG_FUNCTION_ARGS | ) |
Definition at line 438 of file xlogfuncs.c.
References cstring_to_text(), ereport, errcode(), errhint(), errmsg(), ERROR, GetWALInsertionTimeLine(), MAXFNAMELEN, PG_GETARG_LSN, PG_RETURN_TEXT_P, RecoveryInProgress(), wal_segment_size, XLByteToSeg, and XLogFileName().
Datum pg_walfile_name_offset | ( | PG_FUNCTION_ARGS | ) |
Definition at line 374 of file xlogfuncs.c.
References BlessTupleDesc(), CreateTemplateTupleDesc(), CStringGetTextDatum, ereport, errcode(), errhint(), errmsg(), ERROR, GetWALInsertionTimeLine(), heap_form_tuple(), HeapTupleGetDatum(), MAXFNAMELEN, PG_GETARG_LSN, PG_RETURN_DATUM, RecoveryInProgress(), TupleDescInitEntry(), UInt32GetDatum(), values, wal_segment_size, XLByteToSeg, XLogFileName(), and XLogSegmentOffset.
|
static |
Definition at line 41 of file xlogfuncs.c.
Referenced by perform_base_backup(), pg_backup_start(), pg_backup_stop(), and PrepareForIncrementalBackup().
|
static |
Definition at line 45 of file xlogfuncs.c.
Referenced by pg_backup_start(), and pg_backup_stop().
|
static |
Definition at line 42 of file xlogfuncs.c.
Referenced by perform_base_backup(), pg_backup_start(), and pg_backup_stop().