Skip to content

Commit

Permalink
improve checks
Browse files Browse the repository at this point in the history
  • Loading branch information
tillkuhn committed Sep 23, 2024
1 parent 6ccf012 commit 8a5f27e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions kotlin/dbimport.sh
Original file line number Diff line number Diff line change
Expand Up @@ -71,13 +71,13 @@ EOF
# https://dba.stackexchange.com/questions/84798/how-to-make-pg-dump-skip-extension
# https://stackoverflow.com/a/31470664/4292075
logit "Existing DBs $local_db_dev and $local_db_test re-initialized, triggering pg_restore"
set +x
set -x
pg_restore -l --single-transaction $local_dump |grep -v EXTENSION >"$(dirname $local_dump)/pg_restore_list"
pg_restore --use-list "$(dirname $local_dump)/pg_restore_list" \
--no-owner --role=$local_role -U $local_role -d $local_db_dev --single-transaction $local_dump
{ set +x; } 2>/dev/null
logit "Backup finished, running select check on $local_db_dev ($local_db_test remains empty)"
logit "Most recent backup may be from last nigt, run 'appctl backup-db' for a fresh one!"
logit "Most recent backup may be from last night, run 'appctl backup-db' for a fresh one!"
psql -U $local_role -d $local_db_dev <<-EOF
SELECT table_name,pg_size_pretty( pg_total_relation_size(quote_ident(table_name)))
FROM information_schema.tables WHERE table_schema = 'public'
Expand Down

0 comments on commit 8a5f27e

Please sign in to comment.