# event_source

> event_source is the PostgreSQL setting that defines the application name used to identify PostgreSQL messages in the event log.
---

> [!NOTE]
> **Fact — official short description:** “Sets the application name used to identify PostgreSQL messages in the event log.”

## 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 | Reporting and Logging / Where to Log | Upstream classification |
| Latest boot value | `PostgreSQL` | PostgreSQL |
{.fields meta="-"}

## Lifecycle {#lifecycle}

| Fact | Value |
| --- | --- |
| First observed | PG9.2 |
| Present in | PG9.2–19 Beta 3 |
| Removed in | No |
| Introduction commit | [`d8ea33f2c027`](https://git.postgresql.org/gitweb/?p=postgresql.git;a=commit;h=d8ea33f2c02721c89c2434b9fda170afb7fe4999) — Support configurable eventlog application names on Windows |
| Commit date | 2011-10-25 |
| Discussion | — |

## Default history {#default-history}

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

## How it works {#mechanism}

event_source sets the application name used to identify PostgreSQL messages in the event log. This is a Windows event-log identifier and has no effect unless eventlog is an active log destination.

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

event_source is consulted only on Windows when eventlog is selected in log_destination; Windows Event Log registration, permissions, routing, and retention supply the rest of the pipeline.

## Tuning advice {#tuning-advice}

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

| Workload | Guidance |
| --- | --- |
| OLTP | Set event_source only for a Windows eventlog deployment, using a stable non-secret identity registered and routed by the host logging policy. |
| OLAP | Keep the same event source across workload classes so Windows collection rules and dashboards do not fragment by profile. |
| Small nodes | Leave event_source at its default unless eventlog is selected; changing a dormant label provides no capacity or observability benefit. |
{.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 | Unmodified | — | — |
| OLAP | Unmodified | — | — |
| CRIT | Unmodified | — | — |
| TINY | Unmodified | — | — |
{.full-width}

> [!CAUTION]
> **Advice — pending human review.** Fact from the current Pigsty template projection: OLTP: PG9.2–19 Beta 3 unmodified; OLAP: PG9.2–19 Beta 3 unmodified; CRIT: PG9.2–19 Beta 3 unmodified; TINY: PG9.2–19 Beta 3 unmodified. No Pigsty-specific rationale is inferred from an absent override.

## Common pitfalls {#common-pitfalls}

- Expecting a reload or SET to activate event_source, although it requires a controlled server restart.
- Changing the source name without registering or updating Windows Event Log routing and access policy.
- Expecting event_source to have any effect when eventlog is not an active log destination or the platform is not Windows.
- Changing event_source globally without a rollback plan and a client or operational compatibility test.

## Related parameters {#related-parameters}

[`logging_collector`](/parameters/logging-collector/) · [`log_destination`](/parameters/log-destination/) · [`log_directory`](/parameters/log-directory/) · [`log_filename`](/parameters/log-filename/) · [`log_rotation_age`](/parameters/log-rotation-age/) · [`log_rotation_size`](/parameters/log-rotation-size/)

## References {#references}

- [PostgreSQL 19 Beta 3 — event_source](https://www.postgresql.org/docs/19/runtime-config-logging.html#GUC-EVENT-SOURCE)
- [PostgreSQL 19 release notes](https://www.postgresql.org/docs/19/release-19.html)
- [Machine-readable GUC export](/data/guc.jsonl)
