Skip to content

Instantly share code, notes, and snippets.

@SurendraTamang
Last active March 17, 2024 08:53
Show Gist options
  • Save SurendraTamang/dad352814412f2f169a865c10970efa6 to your computer and use it in GitHub Desktop.
Save SurendraTamang/dad352814412f2f169a865c10970efa6 to your computer and use it in GitHub Desktop.
Cheetsheet for PostGresql learning
# For Restoring the the backup in the given database
# While running on docker I first copied the local file to docker container and docker cp and did below
psql -U {db_user} -d database_name -f {db}.sql
@SurendraTamang
Copy link
Author

sudo docker exec -e PGPASSWORD="" -t {docker_name} pg_dump -U postgres {db} > backuptody.sql

@SurendraTamang
Copy link
Author

Changing the Password

ALTER USER your_user WITH PASSWORD 'new_password';

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment