basebackup_to_shell
adds a custom basebackup target called shell
basebackup_to_shell : adds a custom basebackup target called shell
Overview
| ID | Extension | Package | Version | Category | License | Language |
|---|---|---|---|---|---|---|
| 5950 | basebackup_to_shell | basebackup_to_shell | - |
ADMIN | PostgreSQL | C |
| Attribute | Has Binary | Has Library | Need Load | Has DDL | Relocatable | Trusted |
|---|---|---|---|---|---|---|
| --s---- | No | Yes | No | No | no | no |
| Relationships | |
|---|---|
| See Also | basic_archive aws_s3 external_file file_fdw repmgr pg_parquet pg_bulkload |
Packages
| PG18 | PG17 | PG16 | PG15 | PG14 |
|---|---|---|---|---|
| - | - | - | - | N/A |
This is a built-in contrib extension ship with the PostgreSQL kernel
Install
This extension does not need CREATE EXTENSION DDL command
Usage
basebackup_to_shell: adds a custom basebackup target called shell
The basebackup_to_shell module adds a custom shell backup target to pg_basebackup, allowing administrators to pipe backup archives through arbitrary shell commands.
Configuration
Add to postgresql.conf:
Parameters
| Parameter | Type | Description |
|---|---|---|
basebackup_to_shell.command |
string | Shell command to execute; receives archive on stdin |
basebackup_to_shell.required_role |
string | Role required to use the shell target (empty = any replication user) |
Command Placeholders
| Placeholder | Replaced With |
|---|---|
%f |
Archive filename (e.g., base.tar) |
%d |
User-provided target detail string |
%% |
Literal % |
Examples
The %d placeholder requires a target detail to be provided via --target=shell:DETAIL. If %d is not in the command, providing a detail is prohibited. Detail strings may only contain alphanumeric characters.