postgresql-sql-runner

Run read-only SQL queries against Patroni master pods in Kubernetes.

1|3|Updated Mar 23, 2026
One-click install
npx skills add https://github.com/IldarMinaev/troubleshooting-skill --skill postgresql-sql-runner
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: postgresql-sql-runner
Source: https://github.com/IldarMinaev/troubleshooting-skill/tree/main/skills/postgresql-sql-runner
Command: npx skills add https://github.com/IldarMinaev/troubleshooting-skill --skill postgresql-sql-runner

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Run read-only SQL queries against PostgreSQL clusters managed by Patroni in Kubernetes.

Core Features & Use Cases

  • Read-only diagnostics: executes non-DDL SQL safely to diagnose replication status, connections, and configuration.
  • Master discovery & execution workflow: identifies the Patroni master pod and executes SQL via kubectl on the leader.
  • Common use cases: verify replication status, connection health, and memory/WAL configurations across Kubernetes deployments.

Quick Start

Run a read-only SQL query against the Patroni master using the provided SQL files and kubectl exec workflow.

Frequently Asked Questions about postgresql-sql-runner

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I run read-only SQL queries on a Patroni master in Kubernetes?▼

You can run read-only SQL queries on a Patroni master in Kubernetes by identifying the leader pod and executing predefined SQL files via kubectl exec with strict read-only rules and explicit timeouts to protect data.

What is the safest way to check PostgreSQL replication status in Kubernetes?▼

The safest way to check PostgreSQL replication status in Kubernetes is by executing predefined read-only SQL via kubectl exec on the Patroni master pod, applying strict non-DDL rules and explicit timeouts to prevent data modification.

Can I use kubectl to diagnose PostgreSQL connection health on Patroni pods?▼

Yes, you can use kubectl to diagnose PostgreSQL connection health on Patroni pods by executing non-DDL SQL queries against the identified master leader to verify connection status, memory, and WAL configurations safely.

How does the master discovery workflow for Patroni PostgreSQL clusters work?▼

The master discovery workflow for Patroni PostgreSQL clusters identifies the current leader pod in Kubernetes, then routes predefined read-only SQL diagnostics via kubectl exec to that specific master pod for safe query execution.

Do I need explicit timeouts to run SQL diagnostics on Kubernetes PostgreSQL clusters?▼

Yes, explicit timeouts are required to run SQL diagnostics on Kubernetes PostgreSQL clusters, ensuring read-only queries executed via kubectl exec on Patroni master pods do not block system resources indefinitely.

What are the limitations of using kubectl exec for PostgreSQL diagnostics?▼

Limitations of using kubectl exec for PostgreSQL diagnostics include strict read-only and non-DDL SQL restrictions, preventing any data modification, DDL operations, or writes to the Patroni master pods during execution.