How to Update pgAdmin 4 to 9.19 in Server Mode Without Losing Your Password Exec Commands

To update pgAdmin 4 to 9.19 in server mode without losing your Password Exec Commands, define each command in SERVER_PASSEXEC_COMMANDS before the first startup. On that startup, pgAdmin converts commands that match exactly with an entry and deletes the rest, with no way to undo it.

pgAdmin 4 v9.19 was released on October 29, 2026. According to the project itself, it brings 22 new features, 10 maintenance changes, and 104 bug fixes, 15 of them with CVE identifiers. If you use pgAdmin on the desktop, update as usual. If you use it as a shared web application in server mode, three default values change, and one of them deletes data.

What is pgAdmin 4 and who is affected by version 9.19?

pgAdmin 4 is the open-source graphical tool for managing PostgreSQL, published under the PostgreSQL Licence. It works in two ways: as a desktop application for one person (desktop mode) or as a web application with its own users (server mode, SERVER_MODE = True). If when you enter pgAdmin it asks for an email and pgAdmin password, like the official image dpage/pgadmin4 with PGADMIN_DEFAULT_EMAIL, you’re in server mode.

The sensitive changes affect only server mode. On the desktop, Password Exec Commands remain free text and placeholder markers continue to work.

In server mode, when you update three things change:

  1. Free-text Password Exec Commands stop running. ENABLE_SERVER_PASS_EXEC_CMD becomes obsolete and is ignored. Now the administrator defines named commands in SERVER_PASSEXEC_COMMANDS, and each user chooses a name in the server properties.
  2. libpq services are blocked by default. The new SERVER_MODE_ALLOWED_SERVICES is an empty list, and according to config.py, a server configured with any other service cannot be saved or connected.
  3. SSH tunnels no longer use the SSH agent. A tunnel that relied on the agent needs an identity file or a password.

Only the first one is irreversible. The other two cut connections until you fix the configuration.

What happens on the first startup after updating?

On that startup, pgAdmin reads SERVER_PASSEXEC_COMMANDS only once and converts the configuration database:

  • Each saved free-text command is converted to the name of the entry whose arguments, joined with a single space, are identical to it.
  • All other saved commands are deleted, and that cannot be undone.
  • If the dictionary is empty, the conversion is postponed: the old commands remain in the database unused, a warning is logged on each startup, and the conversion runs on the first startup that has at least one entry.

That postponement is your safety net, but read it carefully: as soon as you add one entry, all commands that don’t match some entry are deleted on that startup. Add all the entries you need at once.

On shared servers, if a user’s own command is deleted, that user inherits the command of the owner instead, if the owner has one.

How do I update pgAdmin 4 on Docker without losing commands?

Back up the configuration database, review what commands and services you use, translate them to the new configuration, and only then update. The examples use the official image; if you install the Python wheel or a system package, the steps are the same with your paths.

Step 1: back up the configuration database

Inside pgAdmin, deletion cannot be undone. A backup made before updating is your way to go back. In the official container, the configuration database is pgadmin4.db, inside /var/lib/pgadmin:

docker cp <container>:/var/lib/pgadmin/pgadmin4.db ./pgadmin4-pre-9.19.db

In an installation with wheel or package, the file is whatever SQLITE_PATH indicates. If you store pgAdmin configuration in an external PostgreSQL database, back that up instead.

Step 2: list the commands and services you use

Run this read-only query on the backup. It works with the 9.18 schema, in which the server and sharedserver tables have the columns name, passexec_cmd, and service:

SELECT 'server' AS source, name, passexec_cmd, service
FROM server
WHERE passexec_cmd IS NOT NULL OR service IS NOT NULL
UNION ALL
SELECT 'sharedserver', name, passexec_cmd, service
FROM sharedserver
WHERE passexec_cmd IS NOT NULL OR service IS NOT NULL;
sqlite3 ./pgadmin4-pre-9.19.db < inventory.sql

Copy the passexec_cmd values exactly as they appear. The match is character by character.

Step 3: convert each command into a named entry

Each entry associates a name with a list: first the executable and then its arguments, one per element.

Before (9.18):

# config_local.py
SERVER_MODE = True
ENABLE_SERVER_PASS_EXEC_CMD = True

and, in the server properties, the free-text command:

/usr/local/bin/get-pg-pass --ttl 300

After (9.19):

# config_local.py
SERVER_MODE = True
SERVER_PASSEXEC_COMMANDS = {
    'vault': ['/usr/local/bin/get-pg-pass', '--ttl', '300']
}

/usr/local/bin/get-pg-pass, --ttl, and 300 joined with spaces give exactly the saved command, so that server converts to vault and continues to work.

If you configure the container with environment variables, the value is a Python expression:

# docker-compose.yml
environment:
  PGADMIN_CONFIG_SERVER_PASSEXEC_COMMANDS: "{'vault': ['/usr/local/bin/get-pg-pass', '--ttl', '300']}"

A /pgadmin4/config_local.py mounted in the container has priority over PGADMIN_CONFIG_* variables. The script must exist inside the container, which runs as the pgadmin user (UID 5050).

Step 4: allow the libpq services you use

If the inventory showed any value in service, add it, or those servers will stop connecting:

SERVER_MODE_ALLOWED_SERVICES = ['reporting']

Services are looked up in the services file of the account running pgAdmin (~/.pg_service.conf, PGSERVICEFILE, or PGSYSCONFDIR), not in a file per user. config.py is clear about the cost: adding a service shares its credentials with all pgAdmin users, who can also change the host in the entry and send that password to a server of their choice. Add only services whose credentials can be used by anyone with a pgAdmin account.

Step 5: give an identity file to tunnels that used the SSH agent

In server mode, tunnels never use the SSH agent of the account running pgAdmin. Any server whose tunnel relied on it needs an identity file or a password in the SSH tunnel configuration.

Step 6: update, start once, and check the log

Update the image or package and start it. If you left the dictionary empty, look in the log for the postponed conversion warning. Then open each server that had a Password Exec Command and verify that the dropdown shows the expected name and not “None”.

If you install with the Python wheel: on Python 3.10 or later, pgAdmin 9.19 requires Flask-Security-Too 5.8.3 or later, which fixes an open redirect (GHSA-ccgp-pv8r-95wm). Installations with Python 3.9 stay on the 5.6 series, so don’t force that dependency on 3.9.

The compatible database versions are PostgreSQL and EDB Advanced Server from 14 to 18. The included utilities (psql, pg_dump, pg_dumpall, and pg_restore) are version 18.6.

Which commands won’t convert?

No command that depends on a shell, uses placeholder markers, or doesn’t match character by character with an entry will convert:

  • Those that used a shell. Commands now execute directly, without a shell, so pipes, redirects, and $VARIABLES don’t work, and a list can’t express them. Move that logic to a script and add the script to the list.
  • Those that had host, port, or user placeholders. In server mode they are no longer substituted. Connection data now comes as environment variables: PGADMIN_PASSEXEC_HOST, _PORT, _USERNAME, _DATABASE, _PGADMIN_USER, and _AUTH_SOURCE.
  • Those with a double space or quotes. They don’t match the single-space join of any list.

There’s a security warning in config.py worth taking seriously: only PGADMIN_PASSEXEC_PGADMIN_USER and PGADMIN_PASSEXEC_AUTH_SOURCE identify who is requesting the password. The host, port, user, and database are defined by whoever edits the server, so your script must decide which password to return based on the pgAdmin identity and treat the other four values as untrusted input.

Does the command still see my environment variables?

No. It receives PATH, HOME, LANG, LANGUAGE, TZ, TMPDIR, TMP, TEMP, USER, LOGNAME, any LC_* variable, and the PGADMIN_PASSEXEC_* variables. If your script needs something else, like a Vault address, declare it explicitly:

SERVER_PASSEXEC_ENV_PASSTHROUGH = ['VAULT_ADDR']

Don’t pass variables with secrets that the command doesn’t need.

What’s new in pgAdmin 4 9.19?

Besides the security change, 9.19 brings improvements for everyone, including the desktop:

  • Export Query Tool results to JSON or XML, choose file encoding, and optionally add a byte order mark (BOM).
  • Edit rows through simple updatable views in View/Edit Data.
  • A Statistics node for managing extended statistics.
  • pg_timetable chain and task management.
  • PostgreSQL 18: UNLOGGED partitioned tables and new options for pg_dump and pg_restore in the Backup and Restore dialogs.
  • Results grid and editor: “copy with headers”, range selection with shift+click, shortcut to duplicate lines, and Escape to close dialogs.
  • OAuth2: group claims can limit which shared servers each user sees (OAUTH2_SERVER_GROUP_CLAIM), and OAUTH2_AUTO_LOGIN skips the login page when OAuth2 is the only provider.
  • pgEdge Starfleet in the cloud deployment wizard.

What vulnerabilities does pgAdmin 9.19 fix?

The release notes list 15 CVEs by identifier and issue number, without severity scores, so this table doesn’t include them either.

CVE Issue Fix
CVE-2026-116238 #10676 Failed login attempt limit bypass
CVE-2026-116239 #10675 LDAP/Kerberos logging in to the wrong account
CVE-2026-116240 #10674 File Manager operating on paths without verification
CVE-2026-116241 #10663 System command injection in Import/Export Data (incomplete fix for CVE-2026-17566)
CVE-2026-116242 #10662 Service account SSH identity used in tunnels
CVE-2026-116243 #10656 Executable binary path inside shared storage
CVE-2026-116244 #10655 Service account Kerberos credentials
CVE-2026-116245 #10654 Unrestricted connection services
CVE-2026-116246 #10653 Passwords left in process environment
CVE-2026-116247 #10652 Service account client files used by libpq
CVE-2026-116248 #10651 Non-admin users sharing servers
CVE-2026-116249 #10650 Connection file paths escaping storage
CVE-2026-116250 #10647 Race conditions with symlinks in Import/Export Servers and File Manager uploads
CVE-2026-116251 #10646 Sessions surviving a password change
CVE-2026-116252 #10645 Connection redirect via database names when refreshing materialized views

Two related fixes have no CVE: the same symlink race conditions in Backup, Restore, and Import/Export Data files (#10648), and rejection of hard links and FIFOs in both symlink fixes (#10649). Several of these vulnerabilities, like unrestricted services or service account credentials, explain why the default values above changed: the new restrictions are the fix.


And you? How do your pgAdmin servers get PostgreSQL passwords today: Password Exec Command, pgpass file, libpq service, or something else?

How do you run pgAdmin 4?
  • Desktop (desktop mode)
  • Server mode in Docker
  • Server mode with Python wheel or system package
  • I use another tool (tell us which)
0 votantes

Comment below or, if you received this article by email, reply directly to the email: your reply will be published here.

Related: I Replaced Redis with PostgreSQL (And It’s Faster)