Created
August 28, 2023 07:36
-
-
Save mikhail-angelov/4a60271764bc1a4aab06a2856a6e403f to your computer and use it in GitHub Desktop.
dump postgres db from docker
This file contains 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
#on host | |
docker exec -i <docker postgres id> pg_dump -d postgresql://<db user>:<db password>@127.0.0.1:5432/<db name> > test.dump | |
#to run any sql script on postgres in docker | |
docker exec -i <docker postgres id> psql postgresql://<db user>:<db password>@127.0.0.1:5432/<db name> < test.sql |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment