[go: up one dir, main page]

HeapDeck: Postgres® Monitor for iPhone

See what's burning in your Postgres.Put it out.

Paged about Postgres with your laptop at home? HeapDeck shows who is blocking and how close the server is to wraparound, and you act from your iPhone. Contain the incident on the phone, then fix the cause at your desk.

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 of a production server in a Critical state: blocked sessions first, then connections, the longest query, wraparound and replication

See who's blocking everyone in Postgres. Stop the root with a preview.

Locks builds the blocking tree from pg_blocking_pids() and puts the root blocker on top: its pid, user@app, how long it has held the lock and what it is running. Under it, every session stuck in the queue.

  • The root's button follows its state: Cancel root while it runs a statement, Terminate root when it sits idle in transaction. The count on the button covers the sessions waiting on the root itself, and the confirmation lists their pids. PRO
  • HeapDeck reads the chain again before it sends anything and asks again if the numbers changed. Afterwards it reports what it measured: how many sessions it unblocked and how many still wait.
  • Cancel stops the running query. Terminate ends the session and rolls back its transaction, after you type the root's pid. PRO
  • Each waiter shows its lock, like RowExclusiveLock on public.orders. HeapDeck marks a root sitting idle in transaction and flags a deadlock as a deadlock.
Locks screen: the root blocker has been idle in transaction for 06:48 and blocks four sessions; below it the Terminate root (unblocks 2) button and why a cancel would be ignored

Know your wraparound % before Postgres stops taking writes.

Vacuum & Bloat shows how close the server is to transaction ID wraparound, as a share of 2³¹, with the oldest tables by relfrozenxid age. At the limit, PostgreSQL refuses writes with database is not accepting commands to avoid wraparound data loss.

  • From 75% the screen warns you and names the common reasons autovacuum can't keep up: a long open transaction, an inactive replication slot, a stuck worker.
  • Dead tuples per table, with the dead share and when the table was last vacuumed.
  • Unused indexes with the space they hold. HeapDeck copies DROP INDEX CONCURRENTLY for you and never runs it itself.
  • Run VACUUM (ANALYZE) or ANALYZE on a table from the list. VACUUM FULL asks you to type the table name first. PRO
Vacuum & Bloat screen: transaction ID wraparound at 86%, a warning that the database stops accepting writes at 100%, and three likely causes

Reach your Postgres through your bastion, with the rights your role has.

HeapDeck connects your iPhone straight to your server or through your SSH bastion. You need no account, and no HeapDeck server stands between you and your data. If you set up the AI assistant, it talks to the provider you chose, with your key.

  • SSH with a password, an Ed25519, ECDSA or RSA key and its passphrase, or a Secure Enclave key, through up to three hosts. HeapDeck pins each host key on first connect.
  • TLS with sslmode=require by default. HeapDeck pins the certificate's SHA-256 fingerprint and holds the connection if the certificate changes, until you decide.
  • Passwords, keys and fingerprints stay in this iPhone's Keychain, with no iCloud sync. Face ID opens the app.
  • No superuser? The screen keeps what your role can see and shows the GRANT pg_monitor for the rest.
Verify this server sheet on first connect: the server's SHA-256 certificate fingerprint, to compare with your records before trusting it

The screens you open during a Postgres incident

Ten health tiles up front and a native screen behind each one, so you skip typing psql on a phone keyboard. The SQL console covers the rest and classifies each statement before it runs.

  • Health

    Ten tiles: sessions against max_connections, blocked sessions, the longest query, TPS, cache hit, autovacuum, wraparound, replication, database size and slow queries. A Warning or Critical verdict names the tiles behind it. Refreshes every 10 seconds while open.

  • Activity

    Sessions from pg_stat_activity, waiting ones first. Filter by active, idle in transaction, longer than 10 s or waiting. Swipe a row to cancel or terminate it.

  • Replication and slots

    Replay lag per standby, broken down by WAL phase. Slots with the WAL they retain, and a warning when an inactive slot is filling your disk.

  • Slow queries

    The 300 heaviest statements from pg_stat_statements, sorted by total time, mean, calls or rows. A statement's detail shows its role, database, timings and I/O, and the sessions running it now (PostgreSQL 14+).

  • Data and SQL console

    Browse tables, filter on the server, follow foreign keys, export a page as CSV or JSON. The console classifies each statement as you type; on Free, reads run inside BEGIN READ ONLY.

  • AI assistant PRO

    Explains an incident or a lock chain and drafts the fix, with your own API key or your own Ollama. It reads a redacted snapshot and leaves running anything to you.

HeapDeck's built-in demo, in dark and light like iOS.

Cancel the blocking session sheet: pid 24310, an ALTER TABLE migration active for 01:12; This should unblock 2 waiting sessions

Cancel root The sessions it frees, before you confirm.

Vacuum & Bloat screen: dead tuples per table and six indexes with no scans, 34 GB in total

Vacuum & Bloat Dead tuples and unused indexes, with the space they hold.

Activity screen: sessions with their state, wait time and SQL, the blocking one marked blocking 4 sessions

Activity Waiting sessions first.

Replication screen: two standbys with replay lag and a warning that an inactive slot makes PostgreSQL keep WAL forever

Replication Lag per standby, slots holding WAL.

Slow queries screen: statements sorted by total time with calls, mean time and rows

Slow queries From pg_stat_statements.

Activity screen for a role without pg_monitor: you can see sessions, but not their SQL, with a Show me how button

Limited access No pg_monitor? The screen names the hidden data and the fix.

SQL console: DELETE FROM public.orders classified as Destructive, WHERE clause missing, 18.1M estimated rows

SQL classifier Its verdict on a DELETE without WHERE.

Assistant answer: an idle transaction holds a row lock on orders, seven sessions wait, with the suggested next steps

AI assistant It explains a lock chain.

What the model sees: the snapshot sent to the model, with names replaced by placeholders like table_1

What the model sees The exact text, before you send it.

Data tab: the orders table in a grid, showing 200 of 18,412,004 rows

Data 200-row pages, filtered on the server.

Cancel root The sessions it frees, before you confirm.

Postgres monitoring is free. Pro is one purchase.

Try it on your own production first: the monitoring screens cost nothing for one server. Pro adds more servers and the actions for $19.99, once. No subscription, no account.

Free

forever

Point it at one production server and see what is going on.

  • The seven monitoring screens: Health, Activity, Locks, Vacuum & Bloat, Replication, Storage, Slow queries
  • One saved connection with TLS, SSH tunnel, pinned fingerprints and Face ID
  • Data browser with server-side filters, foreign keys, CSV and JSON export
  • SQL console for reads, inside a read-only transaction
  • The SQL classifier and its explanations

Pro

$19.99

one-time purchase

For the moment you need to act.

  • Unlimited saved connections, one per server you are on call for
  • Cancel and terminate sessions, stop the root of a lock chain
  • VACUUM, ANALYZE and dropping a replication slot
  • Writes and DDL in the console, behind confirmations
  • Insert, edit and delete rows in tables with a primary key
  • The AI assistant with your own key or model

Pro actions stay visible on Free, marked PRO, so you can see what they would do. The assistant works for free on the built-in demo incident. Outside the US, the App Store shows the price in your currency.

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

Questions about HeapDeck and Postgres

Does it work with Neon, Supabase, Amazon RDS, Cloud SQL or Azure?

HeapDeck works with any PostgreSQL 13–19 your iPhone can reach, self-hosted or managed, primary or standby. If your role is not a superuser, the screens mark the data PostgreSQL hides from it and show the GRANT pg_monitor that fixes it.

We checked Neon, Supabase and Amazon RDS live. Paste the connection string from the Connect panel in Neon or Supabase; for RDS, enter the instance endpoint from the RDS console. Neon works over its direct host and its -pooler host. Supabase's direct host has only an IPv6 address: on a network without IPv6, HeapDeck says so and points you to the Session pooler string.

verify-full works when the certificate chains to a root that iOS trusts, as Neon's does. Amazon RDS signs with its own root CA, which iOS doesn't ship; for RDS and providers like it, use sslmode=require: the connection is encrypted and HeapDeck pins the certificate fingerprint on first connect.

Can it reach a database behind a bastion?

Yes. Turn on the SSH tunnel in the connection and enter the bastion's host, user and a password or key. HeapDeck reads Ed25519, ECDSA and RSA keys in OpenSSH, PEM, PKCS#8 or PuTTY format, with or without a passphrase, and can create a Secure Enclave key that never leaves your iPhone.

Behind more than one hop, add up to two jump hosts, each with its own login. HeapDeck answers two-factor prompts and pins each host key on first connect. Client certificates (mTLS) aren't supported.

Do my credentials or data leave my iPhone?

HeapDeck connects straight to your server or through your SSH bastion, with no server of ours in between. You need no account. Passwords, SSH keys and pinned fingerprints stay in the iOS Keychain on this device, without iCloud sync.

Two things can leave the phone, both under your control: a question to the AI provider you set up (Pro), and crash reports and usage counts, which you can switch off on first launch or in Settings. Neither contains SQL, table names, hostnames, values or credentials. The details are in the privacy policy.

Do I need superuser?

No. A role with pg_monitor covers the monitoring screens: GRANT pg_monitor TO your_role;. Without it HeapDeck still works and labels what the server hides from your role. Cancelling other roles' sessions needs the usual PostgreSQL rights, such as pg_signal_backend; without them, HeapDeck gives you the command to hand to your DBA.

Cancel or terminate: which one?

Cancel (pg_cancel_backend) stops the query a session is running; the session and its transaction stay open. Terminate (pg_terminate_backend) kills the whole session and rolls its transaction back.

A session that is idle in transaction has no running query, so cancel does nothing to it: terminate is what releases its locks. HeapDeck asks you to type the pid before terminating the root of a lock chain or a session on a Production connection.

Can HeapDeck break my database?

Free can't write: console reads run inside BEGIN READ ONLY … ROLLBACK. On Pro, a write passes four checks in order: Pro, the connection's Read-only switch, the SQL classifier and your confirmation.

VACUUM FULL, dropping a slot and terminating a lock root ask you to type the table name, slot name or pid first. A connection marked Production gets a PROD badge and stricter confirmations.

Why not SSH in and run psql?

You still can. HeapDeck gives each incident question its own screen, so you don't type queries on a phone keyboard: who is blocking and how many wait, what the root is running, how close wraparound is, which slot holds WAL. It reads the lock chain again before acting and asks you to confirm.

What does the AI assistant see?

A redacted snapshot of the screen you asked about. It never contains host, port, passwords or keys, and values become placeholders like $1. For cloud models, HeapDeck hides database, table and column names by default and puts them back on your phone when the answer arrives.

Requests go from your iPhone to the provider you chose with your own key (Anthropic, OpenAI, OpenRouter, Z.ai), or to your own Ollama or OpenAI-compatible server. “What the model sees” shows the exact text before you send it. The assistant is part of Pro and leaves running SQL to you.

Is there a subscription?

No. One server is free to monitor, and Pro, with unlimited servers and the actions, is a single purchase of $19.99 tied to your Apple ID. There is no account and no trial clock.

Will it alert me when something breaks?

No. HeapDeck works while it is open and does no background monitoring. Keep your alerting where it is: HeapDeck is the screen you open after the page.

Does it run on iPad?

Yes. On iPad, HeapDeck runs full screen in every orientation, with a sidebar in place of the tab bar. Locks shows the lock tree beside the selected session, and the SQL console takes the full width. Pro follows your Apple ID, so one purchase covers your iPhone and iPad.

Amazon Web Services, AWS and Amazon RDS are trademarks of Amazon.com, Inc. or its affiliates. Neon, Supabase, Google Cloud SQL and Microsoft Azure are trademarks of their respective owners. HeapDeck is not affiliated with or endorsed by any of them.

Guides for Postgres incidents

The problems that page you at night, one page each: the SQL to check by hand and what HeapDeck shows.

From the blog

All posts

Have it on your phone before the next Postgres incident.

Add a server, pin its certificate, and use the monitoring screens for free. Pro unlocks the actions for the night you need them.

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