Created
October 21, 2024 04:30
-
-
Save aravinthanpnk/b03e144173c7216177277d7761810b25 to your computer and use it in GitHub Desktop.
Python - Commands
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
| Connect to the database via CLI: | |
| psql "user=username host=hostname dbname=databasename" | |
| --> it will ask passsword | |
| To backup by schema: | |
| pg_dump -U user -d databasse -h host -n schema -F c -f file_name.tar.gz | |
| To restore: | |
| pg_restore -c -U username -d database -h host -v "full_path_backup_file_location" -W |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment