* SendBaseBackup() - send a complete base backup. * * The function will put the system into backup mode like pg_start_backup() * does, so that the backup is consistent even though we read directly from * the filesystem, bypassing the buffer cache. */
| 1070 | * the filesystem, bypassing the buffer cache. |
| 1071 | */ |
| 1072 | void |
| 1073 | SendBaseBackup(BaseBackupCmd *cmd) |
| 1074 | { |
| 1075 | basebackup_options opt; |
| 1076 | SessionBackupState status = get_backup_status(); |
| 1077 | |
| 1078 | if (status == SESSION_BACKUP_NON_EXCLUSIVE) |
| 1079 | ereport(ERROR, |
| 1080 | (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), |
| 1081 | errmsg("a backup is already in progress in this session"))); |
| 1082 | |
| 1083 | parse_basebackup_options(cmd->options, &opt); |
| 1084 | |
| 1085 | WalSndSetState(WALSNDSTATE_BACKUP); |
| 1086 | |
| 1087 | if (update_process_title) |
| 1088 | { |
| 1089 | char activitymsg[50]; |
| 1090 | |
| 1091 | snprintf(activitymsg, sizeof(activitymsg), "sending backup \"%s\"", |
| 1092 | opt.label); |
| 1093 | set_ps_display(activitymsg); |
| 1094 | } |
| 1095 | |
| 1096 | perform_base_backup(&opt); |
| 1097 | } |
| 1098 | |
| 1099 | static void |
| 1100 | send_int8_string(StringInfoData *buf, int64 intval) |
no test coverage detected