Parameter · Client Connection Defaults / Other Defaults
extension_control_path
Sets the path for extension control files. The remaining extension script and secondary control files are then loaded from the same directory where the primary control file was found.
- Default:
$system - Type: string
- Applies: Session (superuser)
In plain words
New in PostgreSQL 18. CREATE EXTENSION looks for a name.control file to learn how to install an extension. This setting lists where to look, so extensions can live outside PostgreSQL's own installation folder (handy for containers and read-only images).
For DBAs and operators
A colon-separated list of absolute directories (semicolons on Windows). $system is the compiled-in location (pg_config --sharedir). Each element is expected to contain an extension subdirectory, and /extension is appended automatically. An empty value means $system. The first directory that contains the control file wins; the extension's SQL scripts are then read from that same directory.
Example from the documentation:
extension_control_path = '/usr/local/share/postgresql:$system'
dynamic_library_path = '/usr/local/lib/postgresql:$libdir'
Remember dynamic_library_path: the control file only describes the extension, the .so must also be found. The setting affects pg_available_extensions too. Setting it per session is possible for superusers but meant for development; configure it in postgresql.conf. Before 18 the only option was copying files into the system share directory, which package managers and immutable container images made awkward.
How to change it
A superuser (or a role granted SET) can change it per session with SET.