PostgreSQL Source Code
git master
|
#include "postgres.h"
#include <unistd.h>
#include "access/htup_details.h"
#include "access/xlog.h"
#include "access/xlog_internal.h"
#include "access/xlogutils.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/ipc.h"
#include "storage/smgr.h"
#include "utils/builtins.h"
#include "utils/guc.h"
#include "utils/memutils.h"
#include "utils/numeric.h"
#include "utils/pg_lsn.h"
#include "utils/timestamp.h"
#include "utils/tuplestore.h"
Go to the source code of this file.
Macros | |
#define | WAITS_PER_SECOND 10 |
Variables | |
static StringInfo | label_file |
static StringInfo | tblspc_map_file |
#define WAITS_PER_SECOND 10 |
Referenced by pg_promote().
Datum pg_backup_start_time | ( | PG_FUNCTION_ARGS | ) |
Definition at line 646 of file xlogfuncs.c.
References AllocateFile(), BACKUP_LABEL_FILE, CStringGetDatum, DirectFunctionCall3, ereport, errcode(), errcode_for_file_access(), errmsg(), ERROR, FreeFile(), Int32GetDatum, InvalidOid, MAXPGPATH, ObjectIdGetDatum, PG_RETURN_DATUM, PG_RETURN_NULL, and timestamptz_in().
Datum pg_create_restore_point | ( | PG_FUNCTION_ARGS | ) |
Definition at line 292 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 375 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 354 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 333 of file xlogfuncs.c.
References ereport, errcode(), errhint(), errmsg(), ERROR, GetXLogWriteRecPtr(), PG_RETURN_LSN, and RecoveryInProgress().
Datum pg_is_in_backup | ( | PG_FUNCTION_ARGS | ) |
Datum pg_is_in_recovery | ( | PG_FUNCTION_ARGS | ) |
Datum pg_is_wal_replay_paused | ( | PG_FUNCTION_ARGS | ) |
Definition at line 577 of file xlogfuncs.c.
References ereport, errcode(), errhint(), errmsg(), ERROR, PG_RETURN_BOOL, RecoveryInProgress(), and RecoveryIsPaused().
Datum pg_last_wal_receive_lsn | ( | PG_FUNCTION_ARGS | ) |
Definition at line 397 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 416 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 595 of file xlogfuncs.c.
References GetLatestXTime(), PG_RETURN_NULL, and PG_RETURN_TIMESTAMPTZ.
Datum pg_promote | ( | PG_FUNCTION_ARGS | ) |
Definition at line 712 of file xlogfuncs.c.
References AllocateFile(), CHECK_FOR_INTERRUPTS, ereport, errcode(), errcode_for_file_access(), errhint(), errmsg(), ERROR, FreeFile(), i, kill, MyLatch, PG_GETARG_BOOL, PG_GETARG_INT32, PG_RETURN_BOOL, PostmasterPid, promote_file, PROMOTE_SIGNAL_FILE, RecoveryInProgress(), ResetLatch(), SIGUSR1, WAIT_EVENT_PROMOTE, wait_seconds, WaitLatch(), WAITS_PER_SECOND, WARNING, WL_LATCH_SET, WL_POSTMASTER_DEATH, and WL_TIMEOUT.
Datum pg_start_backup | ( | PG_FUNCTION_ARGS | ) |
Definition at line 60 of file xlogfuncs.c.
References do_pg_start_backup(), ereport, errcode(), errmsg(), ERROR, get_backup_status(), makeStringInfo(), MemoryContextSwitchTo(), PG_GETARG_BOOL, PG_GETARG_TEXT_PP, PG_RETURN_LSN, register_persistent_abort_backup_handler(), SESSION_BACKUP_NON_EXCLUSIVE, status(), text_to_cstring(), and TopMemoryContext.
Datum pg_stop_backup | ( | PG_FUNCTION_ARGS | ) |
Definition at line 124 of file xlogfuncs.c.
References do_pg_stop_backup(), ereport, errcode(), errhint(), errmsg(), ERROR, get_backup_status(), PG_RETURN_LSN, SESSION_BACKUP_NON_EXCLUSIVE, and status().
Datum pg_stop_backup_v2 | ( | PG_FUNCTION_ARGS | ) |
Definition at line 166 of file xlogfuncs.c.
References ReturnSetInfo::allowedModes, CStringGetTextDatum, StringInfoData::data, do_pg_stop_backup(), ReturnSetInfo::econtext, ExprContext::ecxt_per_query_memory, elog, ereport, errcode(), errhint(), errmsg(), ERROR, get_backup_status(), get_call_result_type(), IsA, LSNGetDatum, MemoryContextSwitchTo(), MemSet, pfree(), PG_GETARG_BOOL, ReturnSetInfo::returnMode, SESSION_BACKUP_NON_EXCLUSIVE, ReturnSetInfo::setDesc, ReturnSetInfo::setResult, SFRM_Materialize, status(), tuplestore_begin_heap(), tuplestore_donestoring, tuplestore_putvalues(), TYPEFUNC_COMPOSITE, values, and work_mem.
Datum pg_switch_wal | ( | PG_FUNCTION_ARGS | ) |
Definition at line 267 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 619 of file xlogfuncs.c.
References DirectFunctionCall2, PG_GETARG_DATUM, pg_lsn_mi(), and PG_RETURN_NUMERIC.
Datum pg_wal_replay_pause | ( | PG_FUNCTION_ARGS | ) |
Definition at line 526 of file xlogfuncs.c.
References ereport, errcode(), errhint(), errmsg(), ERROR, PG_RETURN_VOID, PromoteIsTriggered(), RecoveryInProgress(), and SetRecoveryPause().
Datum pg_wal_replay_resume | ( | PG_FUNCTION_ARGS | ) |
Definition at line 553 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 500 of file xlogfuncs.c.
References cstring_to_text(), ereport, errcode(), errhint(), errmsg(), ERROR, MAXFNAMELEN, PG_GETARG_LSN, PG_RETURN_TEXT_P, RecoveryInProgress(), ThisTimeLineID, wal_segment_size, XLByteToPrevSeg, and XLogFileName.
Datum pg_walfile_name_offset | ( | PG_FUNCTION_ARGS | ) |
Definition at line 437 of file xlogfuncs.c.
References BlessTupleDesc(), CreateTemplateTupleDesc(), CStringGetTextDatum, ereport, errcode(), errhint(), errmsg(), ERROR, heap_form_tuple(), HeapTupleGetDatum, MAXFNAMELEN, PG_GETARG_LSN, PG_RETURN_DATUM, RecoveryInProgress(), ThisTimeLineID, TupleDescInitEntry(), UInt32GetDatum, values, wal_segment_size, XLByteToPrevSeg, XLogFileName, and XLogSegmentOffset.
|
static |
Definition at line 44 of file xlogfuncs.c.
|
static |
Definition at line 45 of file xlogfuncs.c.
Referenced by perform_base_backup().