Guide · Engines
A PostgreSQL GUI client
Read this when you are choosing a desktop client for PostgreSQL, or when the one you have can't reach the server. The first half is PostgreSQL itself: what stands between a client and a server, and what the engine makes hard once you are in. The second half is what Seqora does with each of those, and what it doesn't.
Reach the server
A PostgreSQL server listens on port 5432. Out of the box, listen_addresses is localhost, so a fresh server takes only loopback and Unix-socket connections, by the connection settings. A client on another machine needs that changed and the server restarted.
Getting past the port, the server reads pg_hba.conf from the top. The first line that matches the connection type, database, user and address decides the sign-in method. If no line matches, the server refuses with no pg_hba.conf entry for host, as the client authentication docs show. That error is about the server's rules, not your password.
| What you see | What it usually means |
|---|---|
| Connection refused, or a timeout | Nothing listens on that address and port, or a firewall drops it. |
no pg_hba.conf entry for host |
The server answered, and no pg_hba.conf line allows this user from here. |
password authentication failed for user |
A line matched, and the password or the user name is wrong. |
| A TLS or certificate error | The client asked for a check the server's certificate doesn't pass. See TLS. |
A hostssl line in pg_hba.conf matches only connections that use TLS, so a server can refuse a plaintext client that a host line would have let in. New passwords are stored as scram-sha-256, the default for password_encryption since PostgreSQL 14.
Pick the TLS mode that checks
libpq, PostgreSQL's own client library, has six sslmode values. The SSL support page lists what each one protects against.
sslmode |
Encrypts | Checks the certificate |
|---|---|---|
disable |
No | No |
allow |
If the server wants | No |
prefer |
If the server offers | No |
require |
Yes | No |
verify-ca |
Yes | Signed by a trusted CA |
verify-full |
Yes | Signed by a trusted CA, and the host name |
The default is prefer, and the docs call it insecure: it encrypts when it can and never checks who answered. require stops a passive listener and nothing else. For a server across the internet, use verify-full. A managed database from a cloud provider has a certificate a client can check, so there is no reason to settle for less.
Sockets and SSH
On the server's own machine, psql with no host connects through a Unix-domain socket, a file named .s.PGSQL.5432 in /tmp by default. A host that starts with / is a socket directory, by the libpq connection docs. Socket connections often sign in with peer, which trusts the operating system's user name, so sudo -u postgres psql works where a GUI with a password doesn't. A GUI that only speaks TCP needs a pg_hba.conf line for host on 127.0.0.1 with a password method.
A server inside a private network is usually reached through a bastion. An SSH tunnel carries the connection to the bastion and on to port 5432 from there. The database still sees a TCP connection, from the bastion's address, so pg_hba.conf has to allow that address.
Passwords you already have
libpq reads two files a GUI can reuse.
- The password file:
~/.pgpass, or%APPDATA%\postgresql\pgpass.confon Windows, onehostname:port:database:username:passwordper line. On Linux and macOS libpq ignores it unless only you can read it (chmod 600). - The connection service file:
~/.pg_service.conf, with named sections such as[commerce-primary]holding a host, port, database and user.
What PostgreSQL makes hard
Schema changes take strong locks. ALTER TABLE takes an ACCESS EXCLUSIVE lock unless the docs name a weaker one for that form, and that lock blocks even a plain SELECT. A waiting lock also blocks the requests that queue behind it: an ALTER TABLE orders waiting for a long report holds up every new read of orders until the report ends. Setting lock_timeout before the change makes it give up instead. Which ALTER TABLE locks the table goes through the common forms.
Some changes rewrite the table. Adding a column with a constant default is a catalog change. Adding one with a volatile default such as clock_timestamp(), or changing a column's type, normally rewrites every row while holding that lock.
DDL is transactional, with exceptions. Most schema changes can run inside BEGIN and roll back, which makes a dry run possible. CREATE DATABASE, VACUUM, ALTER SYSTEM and CREATE INDEX CONCURRENTLY refuse to run in a transaction block. A failed CREATE INDEX CONCURRENTLY leaves an INVALID index behind that queries ignore and writes still maintain.
An open transaction holds on. A client left in a transaction keeps its locks and stops vacuum from cleaning up behind it. idle_in_transaction_session_timeout ends such sessions, and it is off by default.
EXPLAIN ANALYZE runs the statement. On an UPDATE or DELETE the rows change, so the docs suggest BEGIN, EXPLAIN ANALYZE, then ROLLBACK. Since PostgreSQL 18 it reports buffers without being asked.
Query statistics need setup. pg_stat_statements has to be in shared_preload_libraries, which needs a restart, and then CREATE EXTENSION in each database that should have the view, by its docs.
What to look for in a client
- It offers
verify-full, or its own name for it, and says plainly when a connection is not checked. - It reads
.pgpassandpg_service.conf, so your connections don't have to be typed twice. - It shows whether you are in a transaction, and doesn't leave one open behind a closed tab.
- It runs
EXPLAIN ANALYZEon a write only inside a transaction it rolls back. - It tells you which lock a schema change takes before you run it on a busy table.
- It makes the production connection look different from the local one.
Seqora on PostgreSQL
PostgreSQL is the engine Seqora was built on first, and every feature it has works here. Connect walks the dialog. These are the parts that answer the sections above.
- TLS. Four modes:
Off,Prefer,RequireandVerify.Verifychecks the certificate and the host name, likeverify-full, against the certificates your operating system trusts. A host that isn't on your computer starts atRequire. - No sockets. Seqora connects over TCP only. A server on your own machine is
localhost:5432, and the first screen lists one it finds there asPostgreSQL on localhost:5432. - SSH. A tunnel takes a key file, a password or your SSH agent, and reads hosts from
~/.ssh/config. Seqora checks the host key the first time and refuses a key that changed. - Import.
Import connections…reads.pgpassandpg_service.conf, the system-wide service files too, and the saved connections of DBeaver, DataGrip and TablePlus. - Writes. Every connection opens locked. Unlocked, grid edits wait in
Pending changesfor a review and apply in one transaction. The SQL editor stops aDELETEorUPDATEwithout aWHERE, aDROPor aTRUNCATEfor a review.Reverttakes a write back after checking the rows haven't changed since, from the grid or from the SQL editor. See Edit data. - Locks. Before DDL runs, the lock forecast shows the lock each statement takes, whether it rewrites the table, the sessions it would wait behind, and a safer form where there is one.
- Plans (Pro). The Plan tab draws the plan as row flow and says where the time went. It measures a read on its own, and a write only through
Analyze in rollback.Test indexplans the query again with a hypothetical index throughhypopg. See Why is this query slow? - Workload. The session recorder reads
pg_stat_statementsand lists every query pattern your app sends, with exact counts. Without the extension it gives you the statements that set it up.
PostgreSQL is also the only engine with the lock forecast, undo from the SQL editor, View as role (Pro), extension pages, row-level security on the Access page, and the index advisor's tested adds (Pro). MySQL, MariaDB, SQLite and SQL Server has the full table.
To read one plan without installing anything, paste it into the EXPLAIN visualizer. The plan never leaves your browser.
Caveats
- Seqora doesn't sign in with a client certificate, and it doesn't take a CA file of its own. A server whose certificate comes from a private CA passes
Verifyonly once that CA is trusted by your operating system. An imported connection that used either says so on its row. - An imported connection that used a Unix socket is changed to
localhostover TCP, and the row says so. - The lock is Seqora's, not the server's. For a guarantee, connect as a user that only has
SELECT. Test indexneeds thehypopgextension on the server. Without it the Plan tab still reads the plan.- No PostgreSQL version is certified yet. The target is PostgreSQL 16.