When an external recovery command such as restore_command or archive_cleanup_command fails, it just reports "return code 34567" or something, but we have facilities to do decode this properly, so use them.
pgsql-hackers by date:
Соглашаюсь с условиями обработки персональных данных