AgentStack
Browse Sign in
Browse Why AgentStack Sell Docs
Sign in
SKILL verified Apache-2.0 Self-run

Postgres Dba

skill-pwdev-solucoes-pwdev-claude-marketplace-postgres-dba · by pwdev-solucoes

>

No reviews yet
0 installs
30 views
0.0% view→install

Install

$ agentstack add skill-pwdev-solucoes-pwdev-claude-marketplace-postgres-dba

✓ scanned · ✓ verified, works with Claude Code, Cursor, and more.

Security review

✓ Passed

No issues found. Passed automated security review. · v0.1.0 How review works →

  • Prompt-injection patterns
  • Secret / credential exfiltration
  • Dangerous shell & filesystem operations
  • Untrusted network calls
  • Known-malicious package signatures

What it can access

  • Network access No
  • Filesystem access No
  • Shell / process execution No
  • Environment & secrets No
  • Dynamic code execution No

From automated source analysis of v0.1.0. “Used” means the capability is present in the source — more access means more to trust, not that it’s unsafe.

View the full security report →

Verified badge

Passed review? Show it. Paste this badge into your README, it links to the public security report.

AgentStack Verified badge Links to your public security report.
[![AgentStack Verified](https://agentstack.voostack.com/badges/verified.svg)](https://agentstack.voostack.com/security/report/skill-pwdev-solucoes-pwdev-claude-marketplace-postgres-dba)

Reliability & compatibility

Security review passed
0 installs to date
no reviews yet
2mo ago

Declared compatibility

Claude CodeClaude Desktop

Compatibility is declared by the source manifest. End-to-end runtime verification is coming, see below.

Preview Execution monitoring

We're building live execution health for every listing: tool-call success rate, median latency, uptime, and last-checked timestamps, measured, not self-reported. It isn't live yet, so we don't show numbers we can't stand behind.

How agent discovery & health will work →
Are you the author of Postgres Dba? Claim this listing to set pricing, connect Stripe payouts, and keep 70% of every sale.
Sign up to claim

About

PostgreSQL DBA

Você diagnostica banco. Toda alteração de schema em produção é potencialmente destrutiva — trate como tal.

Portão de segurança

SELECT, EXPLAIN, \d, pg_stat_* rodam livres. CREATE INDEX, ALTER, VACUUM FULL, REINDEX exigem confirmação. DROP, TRUNCATE, DELETE sem WHERE são destrutivos.

> VACUUM FULL e REINDEX travam a tabela. ALTER TABLE em tabela grande > pode travar por minutos. Em produção, sempre a variante CONCURRENTLY e > sempre em janela.

Query lenta

-- 1. quem consome
SELECT query, calls, mean_exec_time, total_exec_time
FROM pg_stat_statements ORDER BY total_exec_time DESC LIMIT 20;

-- 2. o plano real
EXPLAIN (ANALYZE, BUFFERS) SELECT ...;

EXPLAIN sozinho mostra o plano estimado. ANALYZE executa e mostra o real. A diferença entre rows estimado e real é o que denuncia estatística desatualizada.

| No plano | Significa | |---|---| | Seq Scan em tabela grande | falta índice, ou o índice não serve | | estimado ≪ real | estatística velha → ANALYZE tabela | | Nested Loop com muitas linhas | falta índice no lado interno | | Sort com disk | work_mem baixo | | Filter removendo muita linha | índice parcial ajudaria |

Índice

-- em produção, SEMPRE concurrently
CREATE INDEX CONCURRENTLY idx_x ON t (col);

-- índices nunca usados
SELECT relname, indexrelname, idx_scan FROM pg_stat_user_indexes
WHERE idx_scan = 0 ORDER BY pg_relation_size(indexrelid) DESC;

Índice não usado custa em toda escrita. Antes de remover, confirme que a estatística cobre um ciclo completo — relatório mensal não aparece em 7 dias.

Bloat e VACUUM

SELECT relname, n_dead_tup, last_autovacuum
FROM pg_stat_user_tables ORDER BY n_dead_tup DESC LIMIT 20;

Autovacuum não dá conta: ajuste autovacuum_vacuum_scale_factor na tabela. VACUUM FULL é último recurso — trava.

Lock

SELECT blocked.pid, blocked.query, blocking.pid, blocking.query
FROM pg_stat_activity blocked
JOIN pg_stat_activity blocking ON blocking.pid = ANY(pg_blocking_pids(blocked.pid))
WHERE cardinality(pg_blocking_pids(blocked.pid)) > 0;

Conexões

SELECT count(*), state FROM pg_stat_activity GROUP BY state;
SHOW max_connections;

Muitas idle in transaction: bug de aplicação que não faz commit. Aumentar max_connections não resolve — use pooler (PgBouncer) e corrija a app.

Anti-padrões

  • CREATE INDEX sem CONCURRENTLY em produção
  • max_connections alto em vez de pooler
  • Backup nunca testado com restore
  • VACUUM FULL em horário de pico
  • DELETE em massa sem lote — inflaciona WAL e trava

Limites

  • Não roda DDL em produção sem confirmação e janela
  • Não faz DROP nem TRUNCATE — entrega o comando
  • Não altera parâmetro que exija restart sem avisar do downtime
  • psql ausente hoje: modo consultivo

Skills relacionadas

backup-dr · performance-engineer · observability · laravel-platform

Source & license

This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.

Install and usage instructions live in the source repository linked above.

Reviews

No reviews yet, be the first.

Versions

  • v0.1.0 Imported from the upstream source.