PostgreSQL monitor for iPhone

HeapDeck turns your iPhone into the on-call screen for a PostgreSQL server: one verdict, ten health tiles, and a screen behind each tile for the moment it turns red.

Updated · Vladimir Chemeris, the developer of HeapDeck

Download on the App Store
Scan to open it on your iPhone

Free · Pro $19.99 one-time · PostgreSQL 13–19 · iOS 17+ · iPhone and iPad

HeapDeck Health screen for a production server marked Critical, with Blocked named as the cause and ten tiles: blocked sessions, connections, longest query, throughput, cache hit, autovacuum, wraparound, replication, disk and slow queries

One screen for the 3 a.m. question: is this server in trouble, and where?

You open a connection and land on Health, with the list of tables one tab away. At the top sits one verdict for the whole server, Healthy, Warning, Critical or Limited, and under it ten tiles. Each tile has a status strip, and the verdict equals the worst tile. With Warning or Critical, a line under the verdict names the tiles behind it, such as Blocked.

Tile Shows Turns red at
Blocked sessions waiting on a lock, and the deepest chain 3 waiting, or a chain of 3
Sessions client sessions against max_connections, and how many sit idle in transaction 90% of max_connections
Longest query age of the oldest running statement, with its SQL 5 minutes
Cache hit share of reads served from shared buffers below 80%
Wraparound the oldest datfrozenxid as a share of 2³¹ 75%
Replication worst replay lag, or an inactive slot with its WAL 5 minutes of lag

Autovacuum never turns red, since wraparound has its own tile. It names the table with the most dead rows and turns amber once that table holds twice the dead rows that start autovacuum on it, by the table’s own settings or the server’s.

Throughput, disk size and slow queries carry no verdict. TPS has no universal threshold, PostgreSQL doesn’t report the size of the volume, and pg_stat_statements averages since its last reset, so its worst mean describes the past. Health refreshes every 10 seconds while it is on screen. If a refresh fails, the last values stay, with a banner that shows their age.

What you can do with it

The use cases page goes through the incidents one by one, from blocked sessions to a disk filling up.

A screen behind each tile

Tap a tile to open the screen behind it:

  • Locks: the blocking tree from pg_blocking_pids(), with the root blocker on top and the number of sessions stopping it would free. More on finding blocking queries.
  • Activity: sessions from pg_stat_activity, waiting ones first, with filters for idle in transaction and long runners. See pg_stat_activity on iPhone.
  • Vacuum & Bloat: wraparound with the oldest tables by relfrozenxid, dead tuples per table with a card for each table, unused indexes. See autovacuum and wraparound.
  • Replication: replay lag per standby broken down by WAL phase, and slots with the WAL they retain. See replication lag and slots.
  • Storage: database, table and index sizes.
  • Slow queries: the 300 heaviest statements from pg_stat_statements. A statement’s detail shows its role, database, timings and I/O, and the sessions running it now.

Activity and Locks refresh every 5 seconds while open. The other screens read the server when you open them, and you pull down to read again.

The connection

HeapDeck speaks the PostgreSQL protocol from your iPhone straight to your server, or through an SSH tunnel to your bastion. It supports PostgreSQL 13–19, primaries and standbys, with SCRAM-SHA-256 or md5 authentication.

To add a server, paste its postgres:// URI or key=value string, and HeapDeck fills in the form. New connections use sslmode=require. HeapDeck shows the certificate’s SHA-256 fingerprint the first time, remembers it, and stops to ask if it changes. The same works for managed providers whose certificate roots iOS doesn’t ship, and verify-full works with certificates from a CA that iOS trusts, as on Neon.

HeapDeck runs no server in the path and asks for no account. Passwords, SSH keys and pinned fingerprints stay in the iOS Keychain on the phone, and Face ID locks the app.

No superuser needed

A role with pg_monitor sees everything the monitoring screens show:

GRANT pg_monitor TO monitoring_role;

Without it, HeapDeck still connects and marks the data the server hides from your role, such as other users’ SQL. The GRANT sits one tap away on each screen that needs it.

Free and Pro

The monitoring screens are free for one saved server, along with the data browser and read-only SQL. HeapDeck Pro is one purchase of $19.99 for unlimited saved connections and the actions: cancel and terminate, VACUUM and ANALYZE, dropping a replication slot, writes in the console and the AI assistant. There is no subscription.

Limits

HeapDeck works while it is open. It doesn’t monitor in the background or send push alerts, so keep your alerting in Grafana, Datadog or PagerDuty and open HeapDeck when they page you (how the tools compare). On iPhone it runs in portrait. On iPad it runs full screen in every orientation, with a sidebar in place of the tab bar and the detail of the selected row beside each list.

Questions

Is there a PostgreSQL monitoring app for iPhone?

Yes. HeapDeck is a native iPhone and iPad app built around server state: Health, Activity, Locks, Vacuum & Bloat, Replication, Storage and Slow queries. See how other Postgres apps compare.

How often does HeapDeck refresh?

Health every 10 seconds, Activity and Locks every 5, while the screen is open. Vacuum & Bloat, Replication, Storage and Slow queries read the server when you open them, and you pull down to read again.

Do I need to install anything on the server?

You install no agent on the server. HeapDeck reads PostgreSQL's own views over a normal connection. Only Slow queries needs an extension, pg_stat_statements, and the screen explains how to enable it.