This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
deployment:postgresql [2018/02/28 01:24] asok |
deployment:postgresql [2018/02/28 19:09] (current) asok |
||
---|---|---|---|
Line 53: | Line 53: | ||
<code> | <code> | ||
+ | |||
+ | -- Recreate Schema | ||
+ | |||
+ | DROP SCHEMA public CASCADE; | ||
+ | CREATE SCHEMA public; | ||
+ | GRANT ALL ON SCHEMA public TO postgres; | ||
+ | GRANT ALL ON SCHEMA public TO public; | ||
+ | |||
-- Show Running Queries -- Look for active ones | -- Show Running Queries -- Look for active ones | ||
Line 74: | Line 82: | ||
-- all databases and their sizes | -- all databases and their sizes | ||
select * from pg_user; | select * from pg_user; | ||
+ | |||
+ | -- number of records | ||
+ | SELECT schemaname,relname,n_live_tup | ||
+ | FROM pg_stat_user_tables | ||
+ | ORDER BY n_live_tup DESC; | ||
-- all tables and their size, with/without indexes | -- all tables and their size, with/without indexes |