Header And Logo

PostgreSQL
| The world's most advanced open source database.

Functions

basebackup.h File Reference

#include "nodes/replnodes.h"
Include dependency graph for basebackup.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

void SendBaseBackup (BaseBackupCmd *cmd)

Function Documentation

void SendBaseBackup ( BaseBackupCmd cmd  ) 

Definition at line 527 of file basebackup.c.

References AllocateDir(), ereport, errmsg(), ERROR, FreeDir(), basebackup_options::label, BaseBackupCmd::options, parse_basebackup_options(), perform_base_backup(), set_ps_display(), snprintf(), update_process_title, WalSndSetState(), and WALSNDSTATE_BACKUP.

Referenced by exec_replication_command().

{
    DIR        *dir;
    basebackup_options opt;

    parse_basebackup_options(cmd->options, &opt);

    WalSndSetState(WALSNDSTATE_BACKUP);

    if (update_process_title)
    {
        char        activitymsg[50];

        snprintf(activitymsg, sizeof(activitymsg), "sending backup \"%s\"",
                 opt.label);
        set_ps_display(activitymsg, false);
    }

    /* Make sure we can open the directory with tablespaces in it */
    dir = AllocateDir("pg_tblspc");
    if (!dir)
        ereport(ERROR,
                (errmsg("could not open directory \"%s\": %m", "pg_tblspc")));

    perform_base_backup(&opt, dir);

    FreeDir(dir);
}