|
73 | 73 | pg_dump returns rc 1 in this case. |
74 | 74 | - C(restore) also requires a target definition from which the database will be restored. (Added in Ansible 2.4). |
75 | 75 | - The format of the backup will be detected based on the target name. |
76 | | - - Supported compression formats for dump and restore include C(.pgc), C(.bz2), C(.gz) and C(.xz). |
77 | | - - Supported formats for dump and restore include C(.sql), C(.tar), and C(.dir) (for the directory format which is supported since collection version 1.4.0). |
| 76 | + - Supported compression formats for dump and restore determined by target file format C(.pgc) (custom), C(.bz2) (bzip2), C(.gz) (gzip/pigz) and C(.xz) (xz). |
| 77 | + - Supported formats for dump and restore determined by target file format C(.sql) (plain), C(.tar) (tar), C(.pgc) (custom) and C(.dir) (directory) |
| 78 | + For the directory format which is supported since collection version 1.4.0. |
78 | 79 | - "Restore program is selected by target file format: C(.tar), C(.pgc), and C(.dir) are handled by pg_restore, other with pgsql." |
79 | 80 | - "." |
80 | 81 | - C(rename) is used to rename the database C(name) to C(target). |
|
222 | 223 | state: dump |
223 | 224 | target: /tmp/acme.dir |
224 | 225 |
|
| 226 | +- name: Dump an existing database using the custom format |
| 227 | + community.postgresql.postgresql_db: |
| 228 | + name: acme |
| 229 | + state: dump |
| 230 | + target: /tmp/acme.pgc |
| 231 | +
|
| 232 | +# name: acme - the name of the database to connect through which the recovery will take place |
| 233 | +- name: Restore database using the tar format |
| 234 | + community.postgresql.postgresql_db: |
| 235 | + name: acme |
| 236 | + state: restore |
| 237 | + target: /tmp/acme.tar |
| 238 | +
|
225 | 239 | # Note: In the example below, if database foo exists and has another tablespace |
226 | 240 | # the tablespace will be changed to foo. Access to the database will be locked |
227 | 241 | # until the copying of database files is finished. |
|
0 commit comments