Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 340405d

Browse files
authored
Create vacuum_full_cluster.sh
1 parent ffa274e commit 340405d

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

‎dba/vacuum_full_cluster.sh‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# VACUUM FULL for cluster
2+
for dd in \
3+
psql -U postgres -h [ host ] -p [ port ] -t -c "SELECT datname FROM pg_catalog.pg_database WHERE datname NOT IN ('postgres', 'template0', 'template1');";
4+
do echo $dd; \
5+
for tt in psql -U postgres -h [ host ] -p [ port ] $dd -c "SELECT '\"' || schemaname || '\".\"' || tablename || '\"' FROM pg_tables WHERE schemaname NOT IN ('pg_catalog', 'pg_toast', 'information_schema');" -t; \
6+
do echo $tt; \
7+
psql -U postgres -h [ host ] -p [ port ] $dd -c "VACUUM FULL $tt;";
8+
done;
9+
done

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /