@@ -425,16 +425,16 @@ END
seq_alters=""
for seq in $sequences; do
orgseqval=$(psql_query <<END
- SELECT start_value || ' ' || last_value FROM $seq
+ SELECT s.last_value FROM $seq s
END
)
- read orgstart orglast <<END
+ read orglast <<END
$orgseqval
END
newlast=$(( 10000 * (2 + $orglast / 10000) ))
seq_alters+="
ALTER SEQUENCE $seq
- START WITH $orgstart
+ START WITH $newlast
RESTART WITH $newlast;
"
done
@@ -447,7 +447,15 @@ END
# Schema should now be identical to main DB
$(withtest get_pgdump_cmd) -s -O -x >$t.schema.created
- diff -u $t.schema.orig $t.schema.created
+
+ for wh in orig created; do
+ perl -pe '
+ next unless m{^CREATE SEQUENCE }..m{^\)};
+ $_ = "" if m/^\s*START WITH \d+$/;
+ ' <$t.schema.$wh >$t.schema.$wh-laund
+ done
+
+ diff -u $t.schema.orig-laund $t.schema.created-laund
#---------- mark resources that we are going to borrow ----------
Now (postgresql 11) start_value is in a different table. We don't really care about it very much and mostly care about the last value, so we fix that (and launder the for-db comparison dumps). Signed-off-by: Ian Jackson <iwj@xenproject.org> --- mg-schema-test-database | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-)