Connections

Saved connections, authentication and .pgpass, TLS, and the sessions pgtc holds on a server.

Saved connections

The top-level rows of the tree, stored in settings.toml (Files and folders) without passwords. File → New connection… adds one; nothing is sent to the server until Connect.

New connection dialog, filled in
Filled in.
FieldNotes
NameDisplay name only.
HostHost name, address, or the directory of the Unix-domain socket.
Maintenance DBdbname of the server session: cluster-wide catalogs (pg_database, pg_roles, pg_tablespace), pg_settings, the server-wide dashboard and the profiler.
User nameThe role of every session pgtc opens on this server.
PasswordOptional. Empty: from .pgpass, or asked for when the server requests one.
Save passwordWritten to .pgpass after the first successful authentication (Passwords).
SSL mode, Root cert. filesslmode, sslrootcert (SSL).
AI not allowedDisables the AI assistant for this server: its schema is never sent to a provider (Privacy).

Changing or deleting a saved connection

Context menu of a server
F2 on a server row.

Editing a connected server

Connecting

Connect in the server's F2 menu or in File.

The server row: version and configuration

Information about a connected server
A connected server in the Default tab.

For a connected server the Default tab lists pg_settings as visible to the role:

Read when the row is first selected and cached until disconnect; Ctrl+R on the server row reads it again.

The login dialog

Passwords: the .pgpass file

Passwords are persisted only in libpq's password file, shared with psql and other libpq clients. No keyring.

PlatformFile
Linux, macOS~/.pgpass
Windows%APPDATA%\postgresql\pgpass.conf
AnyPGPASSFILE, if set.

SSL (TLS)

The sessions pgtc opens on the server

One session per database and per tab, on demand; all with the saved connection's role.

SessionDatabaseOpenedTerminated
ServerMaintenance databaseConnectDisconnect
Per database expanded in the tree (tree, definitions, Find object)That databaseExpandCollapse of the database or the server, Disconnect
Per query tabThe tab's databaseTab opensTab closes
Per dashboard, profiler, statistics tabMaintenance database, or the tab's databaseTab opensTab closes
Short-lived: server-wide Find object, definition export / load, the profiler's execution planEach database concernedFor the operation

Disconnecting

Disconnect terminates every session on that server and closes its tabs. First, as on quit:

  1. per query tab with unsaved text: Save them? (can be turned off in Settings);
  2. with a session in a transaction block: Commit all / Rollback all / Cancel.

Cancel aborts the disconnect.

A lost session is reported in the status line. Losing the server session collapses the server's row; a query tab keeps its text.

Connecting from the command line

pgtc -h db.example.com -p 5432 -U app adventureworks
pgtc postgresql://app@db.example.com/adventureworks?sslmode=verify-full