Created
June 17, 2022 14:46
-
-
Save tatarurzvn/99926b29746f04f2efba6119cc8496e6 to your computer and use it in GitHub Desktop.
pg_dump / pg_restore faster
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pg_dump -j 4 --section=pre-data -Fc -d DB -h 127.0.0.1 -p 5432 -U postgres --schema public > pre_date | |
pg_dump -j 4 --section=data -Fc -Z 9 -d DB -h 127.0.0.1 -p 5432 -U postgres --schema public > data_date | |
pg_dump -j 4 --section=post-data -Fc -Z 9 -d DB -h 127.0.0.1 -p 5432 -U postgres --schema public > post_date | |
# -j4 -> because 4 tables | |
# Split per sections | |
# -Fc -> pg_restore format | |
# -Z 9 -> copression (cool if i need to scp it) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment