Postgres DBA · Lesson 11

Restore in postgresql

-> To restore the custom dump then we should always use pg_restore Syntax:instllation_location -Fc -d db_name port location_of_dump_file cmd: /usr/local/pgsql/bin/pg_restore -Fc -d sandbox_db -p 5435 /DB/sandbox_db_21_nov_17_custom -> To restore the plain dump then we should use psql cmd. cmd:/usr/local/pgsql/bin/pg_restore -Fc -d sandbox_db…

connected · blinksql_demo


-> To restore the custom dump then we should always use pg_restore

Syntax:instllation_location -Fc -d db_name port location_of_dump_file
cmd:
/usr/local/pgsql/bin/pg_restore -Fc -d sandbox_db -p 5435 /DB/sandbox_db_21_nov_17_custom

pg_restore

-> To restore the plain dump then we should use psql cmd.
cmd:/usr/local/pgsql/bin/pg_restore -Fc -d sandbox_db -p 5435
-f /DB/DB_BACKUP/sandbox_db_21_nov_17

psql

To restore the single table

cmd:/usr/local/pgsql/bin/pg_restore -Fc -d sandbox_db -p 5435
-f /DB/DB_BACKUP/uixml_backup_table

Practice — AI-generated for this lesson

Write a query that shows each order status and how many orders have it — but only statuses with more than 1 order.