From 11f001ede0cea6df2b2292f576bc81ccd96b5043 Mon Sep 17 00:00:00 2001 From: Martin Winkler Date: Mon, 12 Oct 2020 22:13:31 +0200 Subject: [PATCH] Adding step to list databases --- seqs/postgres.sh | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/seqs/postgres.sh b/seqs/postgres.sh index 17b2197..2a8d09e 100755 --- a/seqs/postgres.sh +++ b/seqs/postgres.sh @@ -77,9 +77,16 @@ step_6() { exe su ${toolUser} -c "psql -c \"SELECT pg_size_pretty( pg_database_size('$dbname') );\"" } -step_8_info() { echo "List all tables of postgres [DATABASE]"; } -step_8_alias() { ALIAS="listtables"; } +step_8_info() { echo "List available databases"; } +step_8_alias() { ALIAS="listdb"; } step_8() { + exe cd ~postgres + exe su ${toolUser} -c "psql -c '\l'" +} + +step_10_info() { echo "List all tables of postgres [DATABASE]"; } +step_10_alias() { ALIAS="listtables"; } +step_10() { shift local dbname=$1 if [ -z $dbname ]; then