Parameter · Client Connection Defaults / Shared Library Preloading
local_preload_libraries
Lists unprivileged shared libraries to preload into each backend.
- Default:
'' (empty) - Type: string
- Applies: Session (any user)
In plain words
A list of libraries each new session loads when it starts. Because ordinary users can set it (for example per role), only "safe" libraries placed in the special plugins folder can be loaded this way.
For DBAs and operators
Loaded at backend start, after authentication, from $libdir/plugins/ only (names are looked up there whether or not you write $libdir/plugins/). Changing it in a running session has no effect: it applies to the next connection. If a library is missing, the connection attempt fails.
Typical use: ALTER ROLE app SET local_preload_libraries = 'my_plugin', where an administrator has deliberately placed (or symlinked) a vetted library in plugins/. Standard contrib modules are not installed there by default, so attempts such as auto_explain fail unless the DBA links them.
Compare: session_preload_libraries (superuser-only, any library, also per connection) and shared_preload_libraries (once at server start, needed for shared memory or background workers).
How to change it
Any user can change it for their session with SET.
See it in context
Related parameters
session_preload_libraries shared_preload_libraries dynamic_library_path