Friday, June 10, 2016

Backup and Restore with PostgreSQL


Enter psql
DOS> psql -U user database_name
DOS> psql database_name (if no password defined)

Drop DB
DOS> dropdb database_name
PSQL# drop database database_name

Create DB
DOS> createdb database_name
PSQL# create database database_name

Dump DB
DOS> pg_dump database_name > file_name

Restore from Dump
DOS> psql -U user -d database_name -f file_name


No comments:

Post a Comment

Upgrade nodejs in conda (from v18 to v26)

If your conda env is nodejs v18, doing a conda install nodejs=26 is likely to create a lot of conflict. Consider remove those conflicting p...