0

I have PostgreSQL instance with n databases on it. Is it possible to restore just a single database using PITR ?

# restore
tar xvfz /var/lib/postgresql/db_file_backup.tar.gz -C /var/lib/postgresql/10/main/

# add recovery.conf
nano /var/lib/postgresql/10/main/recovery.conf

  restore_command = 'cp /var/lib/postgresql/pg_log_archive/%f %p'
  recovery_target_time = '2018-02-22 15:20:00 EST'

# start DB
sudo systemctl start postgresql@10-main

I see that pg_restore contains dbname parameter. But it's logical. I need to restore to specific Point-In-Time.

pg_restore --help pg_restore restores a PostgreSQL database from an archive created by pg_dump. Usage:  pg_restore [OPTION]... [FILE] General options:  -d, --dbname=NAME        connect to database name
2

You cannot have that.

PITR requires a file system level backup and recovery, and both encompass the whole cluster. I am not saying it is theoretically impossible, but no such functionality exists.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.