]> xenbits.xensource.com Git - people/iwj/colo-for-testing.git/commitdiff
transfer-flight-history: make it work when repeated
authorIan Jackson <ian.jackson@eu.citrix.com>
Thu, 26 Mar 2015 11:21:56 +0000 (11:21 +0000)
committerIan Jackson <Ian.Jackson@eu.citrix.com>
Thu, 26 Mar 2015 11:21:56 +0000 (11:21 +0000)
transfer-flight-history

index 7d05c92bc7246734614072f383605ab617bc5903..ca1cf25431c3339752ed50d25a39c026dbd7dfed 100755 (executable)
@@ -6,18 +6,29 @@ of=cam101-history-load
 
 exec 3>$of
 
+echo >&3 '\set ON_ERROR_STOP 1'
+
 echo >&3 "BEGIN;"
 
-for t in flights flights_harness_touched jobs runvars steps;
+tables='flights flights_harness_touched jobs runvars steps'
+
+df=cam101-history-deletes
+exec 4>$df
+for t in $tables
 do
-       echo >&3 "DELETE FROM $t WHERE flight < 50000;"
+       echo >&4 "DELETE FROM $t WHERE flight < 50000;"
+done
+tac $df >&3
 
+for t in $tables;
+do
        tf=cam101-history-$t.tmp
        pg_dump \
                -a -b -F plain -O \
                --table=$t \
                --no-security-labels \
                --no-tablespaces \
+               --serializable-deferrable \
                -f $tf -h osstestdb.db.cam.xci-test.com osstestdb
        sed -e 's/^SELECT pg_catalog\.setval/-- &/g' <$tf >&3
 done