SELECT TABLE_NAME,
pg_size_pretty(table_size) AS table_size,
pg_size_pretty(indexes_size) AS indexes_size,
pg_size_pretty(total_size) AS total_size
FROM (
SELECT
TABLE_NAME,
pg_table_size(TABLE_NAME) AS table_size,
pg_indexes_size(TABLE_NAME) AS indexes_size,
pg_total_relation_size(TABLE_NAME) AS total_size
FROM (
SELECT ('"' || table_schema || '"."' || TABLE_NAME || '"') AS TABLE_NAME
FROM information_schema.tables
WHERE table_schema ='edu_power_audit' and TABLE_NAME like '%audit_messages%'
) AS all_tables
ORDER BY TABLE_NAME
) AS pretty_sizes;
pg_dump -h sp2-git-db-202 -p 5432 -d gitlabhq_production -Fc -s -U postgres | pg_restore -d gitlabhq_production -h sp2-git-db-301 -p 5432 -U postgres
<remote_servers>
<shard_localhost>
<shard>
<internal_replication>true</internal_replication>
<replica>
<host>localhost</host>
<port>9000</port>
</replica>
</shard>
</shard_localhost>
</remote_servers>
<!--
<zookeeper incl="zookeeper">
</zookeeper>
-->
описываем дефолтного пользователя жирно и им делаем других и им права даем
CREATE EXTENSION pg_buffercache;
#!/bin/bash
# Backup
pgbackrest.org
ставим из исходников
формируем метрики