Skip to content
Monghoul
Free, monitor on Pro

A PostgreSQL IDE that checks every edit before it commits

Monghoul is a desktop PostgreSQL IDE for Windows, macOS and Linux. Write SQL with completion from your schemas and joins from your foreign keys, read the plan with real rows and times, and edit rows in the result grid. Every grid change is reviewed and applied in one transaction.

Download Monghoul Read the PostgreSQL docs
PostgreSQL · Edit in the grid, review the diff, apply in one transaction
A PostgreSQL draft tab: a SELECT in the editor and its rows in the result grid, with the row count, the cap and the time in the status line
Fig 01 SQL draft · A PostgreSQL read and its rows, in the same grid MongoDB results use
A PostgreSQL draft with a script of four statements; Run all in the tab’s transaction asks first and says nothing is saved until Commit; then a band under the toolbar says the transaction is open with 3 rows changed and not committed, with Roll back and Commit
PostgreSQL · Manual commit: nothing is saved until you click Commit

Does completion know my tables and foreign keys?

Completion reads the lists the tree already loaded and asks the server nothing as you type. After alias. it offers that relation’s columns with their type and their PK, FK and NOT NULL marks, and after JOIN it offers up to 8 joins from your foreign keys and the Database Map.

How do I see why a PostgreSQL query is slow?

Explain runs a read to measure its rows and times, and plans a data change without running it. Estimate plan, in the Run menu, plans a read without running it. A plan shows as a tree, a table and JSON.

Explain of a PostgreSQL join as a tree, the root first, with the execution time and each node’s actual rows beside its estimate
Fig 02 Explain · PostgreSQL’s plan with real rows and times beside the estimates

Can I filter by a value in the result?

Right-click a cell and choose Filter by This Value or Exclude This Value. Monghoul adds the condition to the statement’s own WHERE, or to its HAVING when the query groups, with the value as a query parameter, and runs it again. A NULL becomes IS NULL, Sort Query Ascending puts a column first in ORDER BY, and Undo takes the edit back in one step.

Can I run a whole SQL script?

Run all statements (Alt+X) runs the selection or the whole draft in order, up to 200 statements. Monghoul checks the whole script first, so a statement it refuses stops the script before anything runs. The Statements list shows each statement’s status, rows, time and message. In Manual commit the script runs in the tab’s transaction, and nothing is saved until you click Commit.

A PostgreSQL script of four statements after Run all: the Statements list shows each one succeeded, with its rows, its time, Open result and Show in query
Fig 03 Run all · Each statement of the script, with its status, rows and time

Does it ask before a DELETE with no WHERE?

Run plans each statement first. A statement that can drop data or change every row asks before it runs, and the dialog names the reasons, such as “every row (no WHERE)”, TRUNCATE, CASCADE or ALTER COLUMN TYPE. It shows the exact statement with its parameters, and says that result caps do not limit the rows a write changes.

The Destructive Write confirm for a PostgreSQL TRUNCATE: the connection, database and schema it writes to, the TRUNCATE reason, the exact statement, and Execute Anyway
Fig 04 Writes · A statement that can drop data or change every row asks first, with its reasons

Can I edit rows in the result and review them first?

A SELECT of one table that holds its primary key can be edited in the grid. Changes are staged, not written. Review Changes shows them as a table with the old value above the new one, and Apply runs them all in one transaction. A row that changed since it was read stops the whole batch, and nothing is written.

A PostgreSQL result with staged edits: a new title, a value set to NULL, one set to DEFAULT, a deleted row and a new row, and a strip counting the changes
Fig 05 Grid edits · Changes are staged in the grid, and nothing is written until Apply

Can I run several statements and commit them myself?

Switch the tab to Manual commit, and the first write opens a transaction. A band under the toolbar counts the rows changed and not committed, with Commit and Roll back. The transaction rolls back after 10 minutes with no statement, when the tab closes and when the app quits.

Which statements in pg_stat_statements cost the most?

On Pro, the Cluster Monitor’s Statements mode lists the first 200 statements by calls, total time, mean time or rows. Live shows the sessions that run a statement or sit idle in a transaction, with what blocks each one, and Terminate session ends one after a confirm.

The PostgreSQL Cluster Monitor in Statements mode: pg_stat_statements, the slowest first, with calls and times per statement
Fig 06 Monitoring · pg_stat_statements, slowest first, in the Cluster Monitor Pro

Does it draw my foreign keys?

Database Map draws each declared foreign key as a line, and adds likely links from column names that a Scan checks against the data. A finding such as a foreign key with no index opens a CREATE INDEX draft that runs only when you run it.

The Database Map of a PostgreSQL database: its tables by schema, with a line for each declared foreign key
Fig 07 Database Map · PostgreSQL’s foreign keys as lines, read from the catalog with no scan

Connecting to PostgreSQL

  • A PostgreSQL server reached directly or through an SSH tunnel, with or without TLS. Test Connection names its version.
  • Host, port 5432 and database postgres by default, or Paste URL with a postgresql:// URL.
  • TLS: Verify full by default, Require, or Disable; a CA file is optional.
  • An SSH tunnel with a password or a private key, and a host key check.
  • Read-only access mode, query and connect timeouts, and a result cap of up to 10,000 rows.

What it does not do on PostgreSQL

  • No client certificate and no proxy option on the connection.
  • REINDEX DATABASE and REINDEX SYSTEM do not run in Monghoul.
  • VACUUM and the CONCURRENTLY commands need a direct connection, not a pooler that changes the server process between statements.
  • A view, a foreign table, a partitioned table, a join or a computed column cannot be edited in the grid.

Shared with the other engines

The same windows as on the other engines, with PostgreSQL's words and limits. Compare all five.

PostgreSQL questions

Does Monghoul run VACUUM and CREATE INDEX CONCURRENTLY?

Yes. They cannot run inside a transaction, so a draft runs them on their own connection, and their card says Completed. If a CREATE INDEX CONCURRENTLY fails, Monghoul names the INVALID index it left and the DROP INDEX CONCURRENTLY statement that removes it.

What happens if the COMMIT gets no answer?

The result says "Write outcome unknown" and tells you to check the database before you run the write again. Monghoul never runs a saved write again by itself.

How do I use query parameters like $1 in a draft?

Write `$1`, `$2` and so on. A Query parameters strip above the editor gets a field for each one, and PostgreSQL gives each field its type when the strip gets the focus, so a date gets a calendar and an enum gets its labels.

Can I see who is blocking a PostgreSQL session?

On Pro, the Cluster Monitor lists up to 500 client sessions with what each waits for and the sessions that block it, and a link opens the blocking one. A role without pg_monitor sees its own sessions only, and the view says so.

Point it at your PostgreSQL database

43 MB installer. Free for 8 connections, and a 14-day Pro trial with no card.

Download Monghoul