Bug: if "dump" file contains an error, "restore" is silent about it
Goal
Show error and do not continue if there is an error during restoration from the "dump" file.
TODO / How to implement
Steps to reproduce:
Use this file with --db-dump
:
create table t as select BLABLABLA_not_exists from generate_series(1, 10) _(i);
and this for --workload-custom-sql
:
delete from t where val > 0.01;
Here is how it will look like:
[2019-03-12T09:46:15+0300] Moving PGDATA to /storage (machine's /home/storage)...
[2019-03-12T09:46:41+0300] Time taken to apply Postgres initial configuration: 0:00:00.
[2019-03-12T09:46:41+0300] Restoring database from dump...
[2019-03-12T09:46:41+0300] Time taken to restore database: 0:00:00.
[2019-03-12T09:46:44+0300] Executing vacuumdb...
– no errors! And only later:
psql:/machine_home/nancy_289c2190829090ac7ce7f50796fa4a416f5f2cf2a66e8d5cdf7e59c4e265d2eb/storage/workload.sql:2: ERROR: relation "t" does not exist
LINE 1: delete from t where val > 0.01;
^
[2019-03-12T09:46:52+0300] Time taken to execute workload: 0:00:01.