Skip to content

Commit 3d30888

Browse files
aleksvagachevav.vagachev
andauthored
Added info on custom format (#398)
* Added info on custom format * Added examples for different formats * Fix error for pipeline Co-authored-by: av.vagachev <av.vagachev@tensor.ru>
1 parent 714a4c6 commit 3d30888

File tree

1 file changed

+16
-2
lines changed

1 file changed

+16
-2
lines changed

plugins/modules/postgresql_db.py

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,9 @@
7373
pg_dump returns rc 1 in this case.
7474
- C(restore) also requires a target definition from which the database will be restored. (Added in Ansible 2.4).
7575
- 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.
7879
- "Restore program is selected by target file format: C(.tar), C(.pgc), and C(.dir) are handled by pg_restore, other with pgsql."
7980
- "."
8081
- C(rename) is used to rename the database C(name) to C(target).
@@ -222,6 +223,19 @@
222223
state: dump
223224
target: /tmp/acme.dir
224225
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+
225239
# Note: In the example below, if database foo exists and has another tablespace
226240
# the tablespace will be changed to foo. Access to the database will be locked
227241
# until the copying of database files is finished.

0 commit comments

Comments
 (0)