Read pg_control file only when --check option is enabled in restore #126
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is correction for #114, the second version patch based on discussion in #119 .
The target is PostgreSQL 11 and later.
In restore processing, pg_rman always had read the pg_control file from target database cluster.
However, if the database cluster had been deleted completely, pg_rman restore was failed because of calling get_controlfile().
The information of pg_control file in old database cluster is used only by --check option.
It is not necessarily required for database restore.
This patch modify to read pg_control file only when --check option is enabled in restore process.
Also, this introduce file existence check.
If --check option is specified and pg_control file is not found in restore process, pg_rman reports ERROR and interrupts processing.