Ivan Alikin
Ivan Alikin

Reputation: 69

Is a PostgreSQL database accessible during restore?

Is it possible to access, particularly insert into, a database while it's being restored by pg_restore from a custom format. If yes, then should I care about preventing clients from accessing the database while pg_restore is running, or the restore operation is "transactional" so that after it ends all changes made by clients since its start will be lost?

Upvotes: 1

Views: 469

Answers (1)

Laurenz Albe
Laurenz Albe

Reputation: 247043

If you want to keep concurrent sessions out of your database during pg_restore, you'll have to block them with a pg_hba.conf entry.

There is no protection from concurrent sessions inserting or otherwise modifying data while pg_restore is running.

Upvotes: 1

Related Questions