SequelPG

SequelPG now has automated tests that drive the real app against real servers: PostgreSQL 18, 16 and 13 in Docker, with SCRAM, MD5 and SSL-only roles, TLS with a private CA, and an SSH bastion. The first full run found a handful of things that didn’t work the way they should. v0.3.12 fixes all of them, and adds the SSL certificate settings that self-signed and private-CA servers need.

SSL: verify against your CA, or knowingly don’t

The connection form has two new SSL settings:

  • CA Certificate — a CA file (PEM) to verify the server against, chosen with Choose…. Leave it empty to use the system trust store. This is what sslrootcert does in libpq, and it’s what makes Verify CA and Verify Full usable with a company or cloud provider CA that macOS doesn’t know about. The same file is passed to pg_dump and psql for export and import.
  • Don’t verify server certificate — shown for Prefer and Require. The connection is encrypted, but the server’s identity isn’t checked; the form says so under the toggle. Use it for a self-signed certificate you can’t or don’t want to install.

Note the change in default: Prefer and Require verify the certificate again unless that toggle is on. In v0.3.10 they stopped verifying it, to match psql; now the choice is explicit and visible on each connection. If a server with a self-signed certificate stops connecting after the update, the error message says what to do: choose its CA certificate, or turn on Don’t verify server certificate. With Prefer, a failed SSL attempt still falls back to an unencrypted connection, as in libpq.

Through an SSH tunnel, the client connects to a local port, so the name it would check the certificate against is 127.0.0.1. Verify Full now checks the certificate against the database host name you entered instead, so it works through a tunnel too.

Stop really stops the query on the server

Pressing Stop (⌘.) used to end the wait in the app while the statement kept running on the server until it finished or hit the timeout. A long UPDATE kept its locks the whole time.

Now, when a query starts, SequelPG reads the backend’s process ID in the same round trip that sets its statement_timeout. Stop sends pg_cancel_backend(pid) over a second connection, which is how psql’s Ctrl-C works: the server cancels the statement, and the editor is ready again right away. The timeout setting is restored afterwards, so the next query on that connection isn’t affected.

Run a whole script

The editor used to reject anything with more than one statement, because the extended query protocol accepts one statement per call. Now Run splits the editor into statements and runs them in order on one connection, and the grid shows the last statement’s result. If a statement fails, the script stops there and shows that statement’s error.

The split works the way psql reads a file: semicolons inside string literals (including E'…'), quoted identifiers, $$ and $tag$ function bodies, -- and nested /* */ comments, and SQL-standard BEGIN ATOMIC … END bodies don’t end a statement. Each statement commits on its own unless you wrap the script in BEGIN … COMMIT.

Row counts for INSERT, UPDATE and DELETE

A statement that changes data now reports how many rows it changed, for example “5 rows affected”, in the result view and the status bar. The count comes from the command tag the server sends back (UPDATE 5), and covers INSERT, UPDATE, DELETE, MERGE and COPY.

Importing new dumps into older servers

pg_dump 17 and later write SET transaction_timeout = 0; at the top of every plain-SQL dump. PostgreSQL 16 and older don’t have that setting, so with Stop on first error the import failed on line one. SequelPG now replaces that one line in the dump’s header with a block that sets it only when the server is version 17 or later, and streams the rest of the file to psql unchanged. Nothing after the header is touched, so data that happens to contain the same text is safe.

Smaller fixes

  • timestamp and timestamptz values keep their microseconds (13:45:30.123456) instead of being rounded to milliseconds.
  • When the server closes the session (for example after pg_terminate_backend or a restart), the query fails with an error instead of waiting forever.

Concretely, v0.3.12 means

  • A CA Certificate file per connection, used by the app, pg_dump and psql
  • Don’t verify server certificate for Prefer and Require; without it, those modes verify the certificate
  • Verify Full works through SSH tunnels
  • Stop cancels the statement on the server
  • Scripts with several statements run in order and stop at the first error
  • Affected-row counts for data-changing statements
  • Plain-SQL dumps from pg_dump 17+ import into PostgreSQL 16 and older
  • Timestamps with full microsecond precision

Grab v0.3.12 from the latest release or build from source with Xcode.

Previously: v0.3.9 — switching saved connections in the sidebar works again. Next: v0.4.0 — an MCP server for Claude, Cursor and other AI assistants. Full feature reference and every shortcut in the documentation.