# shared_preload_libraries

> shared_preload_libraries is the PostgreSQL setting that lists shared libraries to preload into server.
---

> [!NOTE]
> **Fact — official short description:** “Lists shared libraries to preload into server.”

## Identity {#identity}

| Field | Value | Meaning |
| --- | --- | --- |
| Type | `string` | Upstream pg_settings type |
| Context | `postmaster` | Requires a server restart |
| Unit | — | Raw unit |
| Range | — | Raw limits in the last observed version |
| Enum values | — | — for non-enum types |
| Category | Client Connection Defaults / Shared Library Preloading | Upstream classification |
| Latest boot value | `""` | empty string |
{.fields meta="-"}

## Lifecycle {#lifecycle}

| Fact | Value |
| --- | --- |
| First observed | PG9.0 (research boundary) |
| Present in | PG9.0–19 Beta 3 |
| Removed in | No |
| Introduction commit | Not asserted: predates the PG9.0 research boundary |
| Commit date | — |
| Discussion | — |

## Default history {#default-history}

| Versions | Raw `boot_val` | Unit | Human value |
| --- | --- | --- | --- |
| PG9.0–19 Beta 3 | `""` | — | empty string |
{.full-width caption="Measured PG9.0–19 Beta 3 boot defaults"}

## How it works {#mechanism}

shared_preload_libraries lists shared libraries to preload into server. Libraries load once in the postmaster before shared memory is finalized, enabling hooks and shared state unavailable to later LOAD; one missing library prevents server startup.

shared_preload_libraries is a POSTMASTER-context setting: PostgreSQL reads it during server startup, and a configuration reload or session SET cannot activate a new value.

Library discovery and preloading interact with installed binary versions, extension control files, server or backend startup, and the module's own GUCs.

## Tuning advice {#tuning-advice}

> [!TIP]
> **Advice.** These are workload-specific starting points and must be validated with measurements.

| Workload | Guidance |
| --- | --- |
| OLTP | Do not tune shared_preload_libraries generically. Load or expose only modules required by a reviewed feature, verify binary compatibility, and rehearse failure recovery before rollout. |
| OLAP | Use shared_preload_libraries for a measured extension or JIT requirement, accounting for backend startup, resident memory, and behavior under connection pooling. |
| Small nodes | Keep shared_preload_libraries minimal. A missing or incompatible module can reject connections or prevent startup, and every preloaded library consumes scarce address space or memory. |
{.full-width}

## Pigsty {#pigsty}

Values use the fixed 8-vCPU, 32-GiB, 100-GiB SSD fixture and render the current Pigsty templates for PG19 Beta 3; this does not assert current Pigsty support for that historical or beta release.

| Template | Effective value | Versus upstream boot | Source expression |
| --- | --- | --- | --- |
| OLTP | `pg_stat_statements, auto_explain` | different | `'{{ pg_libs \| default("pg_stat_statements, auto_explain") }}'` |
| OLAP | `pg_stat_statements, auto_explain` | different | `'{{ pg_libs \| default("pg_stat_statements, auto_explain") }}'` |
| CRIT | `pg_stat_statements, auto_explain` | different | `'{{ pg_libs \| default("$libdir/passwordcheck, pg_stat_statements, auto_explain") }}'` |
| TINY | `pg_stat_statements, auto_explain` | different | `'{{ pg_libs \| default("pg_stat_statements, auto_explain") }}'` |
{.full-width}

> [!CAUTION]
> **Advice — pending human review.** Fact from the current Pigsty template projection: OLTP: PG9.0–19 Beta 3 = pg_stat_statements, auto_explain (dcs); OLAP: PG9.0–19 Beta 3 = pg_stat_statements, auto_explain (dcs); CRIT: PG9.0–19 Beta 3 = pg_stat_statements, auto_explain (dcs); TINY: PG9.0–19 Beta 3 = pg_stat_statements, auto_explain (dcs). Advice, pending human review — Editorial inference: pg_stat_statements and auto_explain provide fleet-wide query statistics and targeted slow-plan evidence, accepting restart-time loading and shared overhead.

## Common pitfalls {#common-pitfalls}

- Expecting a reload or SET to activate shared_preload_libraries, although it requires a controlled server restart.
- Naming a missing or ABI-incompatible module and causing connection failure or a server that cannot start.
- Treating a search or preload path as harmless even though it defines which native code the server trusts.
- Changing shared_preload_libraries globally without a rollback plan and a client or operational compatibility test.

## Related parameters {#related-parameters}

[`session_preload_libraries`](/parameters/session-preload-libraries/) · [`local_preload_libraries`](/parameters/local-preload-libraries/) · [`dynamic_library_path`](/parameters/dynamic-library-path/) · [`jit_provider`](/parameters/jit-provider/) · [`extension_control_path`](/parameters/extension-control-path/)

## References {#references}

- [PostgreSQL 19 Beta 3 — shared_preload_libraries](https://www.postgresql.org/docs/19/runtime-config-client.html#GUC-SHARED-PRELOAD-LIBRARIES)
- [PostgreSQL 19 release notes](https://www.postgresql.org/docs/19/release-19.html)
- [Machine-readable GUC export](/data/guc.jsonl)
