Flag errors from psql when restoring from backups
When a database restore from PostgreSQL finishes, it's easy to miss
important errors that cause significant issues down the road. For
example, in #36405 (closed), the
primary key constraint in application_settings was not able to be
created due to duplicate keys present.
With this change, we now:
- Track all messages from stderr.
- Filter out messages with
does not exist. These are present becausepg_dumpis run with the--cleanargument to issue DROP statements, but--if-existswill filter this out automatically (!40792 (merged)). - If there are any error messages, play them back to the user with a warning that these errors may impact GitLab.
- Prompt the user to continue.
Edited by Stan Hu