CodeBlanks Logo Icon CodeBlanks

Backup

Take full and incremental backups.

Backup

A backup copies data to a safe place. A full backup copies everything; an incremental backup copies only changes since the last backup.

COPY orders TO '/tmp/orders.csv';
-- full: tüm tablo
-- incremental: son yedekten sonraki satırlar

Full takes all, incremental takes changes.

Backup — details

Incremental saves space but the restore needs a chain: first the full, then each incremental in order. A weekly full with daily incrementals is a common schedule.

Practice Backup

Back up the orders table to /tmp/orders.csv: COPY orders TO '/tmp/orders.csv'.

Starter code

query.sql
-- backup
COPY orders

Sample solution

query.sql
COPY orders TO '/tmp/orders.csv';

Expected output

COPY 5

Questions and answers

Review the lesson questions together with their answers. To test yourself, solve the lesson interactively.

1 What does a full backup copy?

  • Everything Correct answer
  • Only the changes
  • Only the views
  • Only the indexes

Explanation: A full backup copies everything.

2 Export

Question
COPY orders TO '____';
Answer
COPY orders TO '/tmp/orders.csv';

Explanation: /tmp/orders.csv is the right answer.

3 Backup: match the terms

Term Meaning
full full
incremental incremental
COPY TO export
schedule schedule

All lessons in Expert