PostgreSQL Source Code git master
|
#include "postgres.h"
#include "access/xact.h"
#include "backup/basebackup_target.h"
#include "common/percentrepl.h"
#include "miscadmin.h"
#include "storage/fd.h"
#include "utils/acl.h"
#include "utils/guc.h"
Go to the source code of this file.
Data Structures | |
struct | bbsink_shell |
Typedefs | |
typedef struct bbsink_shell | bbsink_shell |
Functions | |
static void * | shell_check_detail (char *target, char *target_detail) |
static bbsink * | shell_get_sink (bbsink *next_sink, void *detail_arg) |
static void | bbsink_shell_begin_archive (bbsink *sink, const char *archive_name) |
static void | bbsink_shell_archive_contents (bbsink *sink, size_t len) |
static void | bbsink_shell_end_archive (bbsink *sink) |
static void | bbsink_shell_begin_manifest (bbsink *sink) |
static void | bbsink_shell_manifest_contents (bbsink *sink, size_t len) |
static void | bbsink_shell_end_manifest (bbsink *sink) |
void | _PG_init (void) |
static char * | shell_construct_command (const char *base_command, const char *filename, const char *target_detail) |
static void | shell_finish_command (bbsink_shell *sink) |
static void | shell_run_command (bbsink_shell *sink, const char *filename) |
static void | shell_send_data (bbsink_shell *sink, size_t len) |
Variables | |
PG_MODULE_MAGIC | |
static const bbsink_ops | bbsink_shell_ops |
static char * | shell_command = "" |
static char * | shell_required_role = "" |
typedef struct bbsink_shell bbsink_shell |
void _PG_init | ( | void | ) |
Definition at line 68 of file basebackup_to_shell.c.
References BaseBackupAddTarget(), DefineCustomStringVariable(), MarkGUCPrefixReserved(), PGC_SIGHUP, shell_check_detail(), shell_command, shell_get_sink(), and shell_required_role.
|
static |
Definition at line 319 of file basebackup_to_shell.c.
References bbsink_forward_archive_contents(), len, and shell_send_data().
|
static |
Definition at line 307 of file basebackup_to_shell.c.
References bbsink_forward_begin_archive(), and shell_run_command().
|
static |
Definition at line 343 of file basebackup_to_shell.c.
References bbsink_forward_begin_manifest(), and shell_run_command().
|
static |
Definition at line 331 of file basebackup_to_shell.c.
References bbsink_forward_end_archive(), and shell_finish_command().
|
static |
Definition at line 367 of file basebackup_to_shell.c.
References bbsink_forward_end_manifest(), and shell_finish_command().
|
static |
Definition at line 355 of file basebackup_to_shell.c.
References bbsink_forward_manifest_contents(), len, and shell_send_data().
|
static |
Definition at line 99 of file basebackup_to_shell.c.
References CommitTransactionCommand(), ereport, errcode(), errmsg(), ERROR, get_role_oid(), GetUserId(), has_privs_of_role(), shell_required_role, and StartTransactionCommand().
Referenced by _PG_init().
|
static |
Definition at line 209 of file basebackup_to_shell.c.
References filename, and replace_percent_placeholders().
Referenced by shell_run_command().
|
static |
Definition at line 220 of file basebackup_to_shell.c.
References Assert, ClosePipeStream(), bbsink_shell::current_command, ereport, errcode(), errcode_for_file_access(), errdetail_internal(), errmsg(), ERROR, pfree(), bbsink_shell::pipe, and wait_result_to_str().
Referenced by bbsink_shell_end_archive(), bbsink_shell_end_manifest(), and shell_send_data().
Definition at line 124 of file basebackup_to_shell.c.
References bbsink_shell::base, bbsink::bbs_next, bbsink::bbs_ops, bbsink_shell_ops, ereport, errcode(), errhint(), errmsg(), ERROR, palloc0(), pstrdup(), bbsink_shell::shell_command, shell_command, and bbsink_shell::target_detail.
Referenced by _PG_init().
|
static |
Definition at line 253 of file basebackup_to_shell.c.
References Assert, bbsink_shell::current_command, ereport, errcode_for_file_access(), errmsg(), ERROR, filename, OpenPipeStream(), PG_BINARY_W, bbsink_shell::pipe, bbsink_shell::shell_command, shell_construct_command(), and bbsink_shell::target_detail.
Referenced by bbsink_shell_begin_archive(), and bbsink_shell_begin_manifest().
|
static |
Definition at line 277 of file basebackup_to_shell.c.
References Assert, bbsink_shell::base, bbsink::bbs_buffer, bbsink_shell::current_command, ereport, errcode_for_file_access(), errmsg(), ERROR, len, bbsink_shell::pipe, and shell_finish_command().
Referenced by bbsink_shell_archive_contents(), and bbsink_shell_manifest_contents().
|
static |
Definition at line 52 of file basebackup_to_shell.c.
Referenced by shell_get_sink().
PG_MODULE_MAGIC |
Definition at line 21 of file basebackup_to_shell.c.
|
static |
Definition at line 64 of file basebackup_to_shell.c.
Referenced by _PG_init(), and shell_get_sink().
|
static |
Definition at line 65 of file basebackup_to_shell.c.
Referenced by _PG_init(), and shell_check_detail().