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:

  1. Track all messages from stderr.
  2. Filter out messages with does not exist. These are present because pg_dump is run with the --clean argument to issue DROP statements, but --if-exists will filter this out automatically (!40792 (merged)).
  3. If there are any error messages, play them back to the user with a warning that these errors may impact GitLab.
  4. Prompt the user to continue.
Edited by Stan Hu

Merge request reports

Loading