# listen_addresses

> listen_addresses is the PostgreSQL setting that defines the host name or IP address(es) to listen to.
---

> [!NOTE]
> **Fact — official short description:** “Sets the host name or IP address(es) to listen to.”

## 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 | Connections and Authentication / Connection Settings | Upstream classification |
| Latest boot value | `localhost` | localhost |
{.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 | `localhost` | — | localhost |
{.full-width caption="Measured PG9.0–19 Beta 3 boot defaults"}

## How it works {#mechanism}

listen_addresses sets the host name or IP address(es) to listen to. The server binds the listed interfaces at startup; reachability still depends on port, pg_hba.conf, host firewalls, and network routing.

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

The listener endpoint combines listen_addresses and port at startup, while pg_hba.conf, TLS, firewalls, routing, and service discovery determine which clients can use it.

## Tuning advice {#tuning-advice}

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

| Workload | Guidance |
| --- | --- |
| OLTP | Set listen_addresses from the service topology and expose only required interfaces or ports. Validate poolers, health checks, pg_hba.conf, firewalls, failover, and restart sequencing together. |
| OLAP | Use an explicit analytical endpoint or network when isolation is required, but keep connection information consistent across failover targets. |
| Small nodes | Prefer local-only exposure unless remote access is required. Preserve a tested administrative route before changing listen_addresses and restarting. |
{.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.0–19 Beta 3 unmodified; OLAP: PG9.0–19 Beta 3 unmodified; CRIT: PG9.0–19 Beta 3 unmodified; TINY: PG9.0–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 listen_addresses, although it requires a controlled server restart.
- Assuming a bound address or port grants access; pg_hba.conf and operating-system or network controls still apply.
- Changing a startup-only endpoint without updating discovery, health checks, firewalls, clients, and the administrative recovery path.
- Changing listen_addresses globally without a rollback plan and a client or operational compatibility test.

## Related parameters {#related-parameters}

[`port`](/parameters/port/) · [`max_connections`](/parameters/max-connections/) · [`reserved_connections`](/parameters/reserved-connections/) · [`superuser_reserved_connections`](/parameters/superuser-reserved-connections/) · [`unix_socket_directories`](/parameters/unix-socket-directories/)

## References {#references}

- [PostgreSQL 19 Beta 3 — listen_addresses](https://www.postgresql.org/docs/19/runtime-config-connection.html#GUC-LISTEN-ADDRESSES)
- [PostgreSQL 19 release notes](https://www.postgresql.org/docs/19/release-19.html)
- [Machine-readable GUC export](/data/guc.jsonl)
