From ebc8533f05d026e668d0099d8d05111c95c741d9 Mon Sep 17 00:00:00 2001 From: Morgan Date: Sat, 12 Oct 2019 14:13:25 +0200 Subject: [PATCH] Creating a copy of a database in PostgreSQL. --- cheat/postgresql.md | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/cheat/postgresql.md b/cheat/postgresql.md index 9894935..d86e727 100644 --- a/cheat/postgresql.md +++ b/cheat/postgresql.md @@ -57,6 +57,9 @@ If you're using CLI and you're a postgres user, then you can do this: ### Creating a copy of a database in PostgreSQL. ``` -pg_dumpall > db.out # backup -psql -f db.out postgres # restore (might requires some DROP DATABASE xxx if you do want to replace existing data with same db and table names. +# backup +pg_dumpall > db.out +# restore +# (might requires some DROP DATABASE xxx if you do want to replace existing data with same db and table names. +psql -f db.out postgres ```