{"Entry":{"collection":"guc","key":"listen_addresses","name":"listen_addresses","aliases":[],"metadata":{"baseline":false,"boot_human":"Not specified","boot_val":null,"category":"Connections and Authentication / Connection Settings","category_zh":"","changed_in":[],"changes":[{"documentation_changed":false,"fields":{},"from":"7.4","status":"added","to":"8.0"},{"documentation_changed":true,"fields":{},"from":"8.4","status":"changed","to":"9.0"},{"documentation_changed":true,"fields":{},"from":"9.0","status":"changed","to":"9.1"},{"documentation_changed":true,"fields":{},"from":"9.5","status":"changed","to":"9.6"},{"documentation_changed":true,"fields":{},"from":"9.6","status":"changed","to":"10"},{"documentation_changed":true,"fields":{},"from":"10","status":"changed","to":"11"},{"documentation_changed":true,"fields":{},"from":"13","status":"changed","to":"14"},{"documentation_changed":true,"fields":{},"from":"16","status":"changed","to":"17"}],"content_hash":"7f3a333582e6fe4848c42f6943dadc81c0bbc89d3ebf09f7601a46935ac409f6","context":"","default_changed_in":[],"default_history":[{"from":"9.0","to":"19","value":"localhost"}],"derived_content_hash":"68598695d037246566b9f9f2b25503291198b861b188f984b28087e7e2490a23","editorial":{"advice":{"olap":"Use an explicit analytical endpoint or network when isolation is required, but keep connection information consistent across failover targets.","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.","small":"Prefer local-only exposure unless remote access is required. Preserve a tested administrative route before changing listen_addresses and restarting."},"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."],"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."],"references":[{"title":"PostgreSQL 19 Beta 4: listen_addresses","url":"https://www.postgresql.org/docs/19/runtime-config-connection.html#GUC-LISTEN-ADDRESSES"},{"title":"PostgreSQL 19 release notes","url":"https://www.postgresql.org/docs/19/release-19.html"}],"related":["port","max_connections","reserved_connections","superuser_reserved_connections","unix_socket_directories"],"summary":"listen_addresses is the PostgreSQL setting that defines the host name or IP address(es) to listen to."},"enumvals":[],"first_version":"8.0","group":"Connections and Authentication","group_slug":"connection","imported_at":"2026-09-27T17:57:31.488002+08:00","intro_commit":{},"key":"listen_addresses","last_version":"20","max_val":"","min_val":"","name":"listen_addresses","position":212,"present_in":["8.0","8.1","8.2","8.3","8.4","9.0","9.1","9.2","9.3","9.4","9.5","9.6","10","11","12","13","14","15","16","17","18","19","20"],"repair_provenance":{"original_source_revision":"english-manuals:86958eeb558d9b360c73bf9e25d405191553258593558e3737999c9badd04be3","receipt_sha256":"75f30ee613520c574aaf21bddca4a8c086fa80f8637996a1d94b32fa430c122b","repair":"wiki-repair-20261023"},"short_desc":"Specifies the TCP/IP address(es) on which the server is to listen for connections from client applications.","short_desc_zh":"","source_rev":"wiki-repair-20261023:16e05bae09868d1e90e0b0aa6cca43432fd378a1c82267b6114bcae9997df38d","unit":"","vartype":"string"}},"Definition":{"Collection":"guc","Key":"listen_addresses","SourceDatabase":"center","Version":"18","SourceTable":"guc","SourceKey":"listen_addresses","SourceRevision":"wiki-repair-20261023:16e05bae09868d1e90e0b0aa6cca43432fd378a1c82267b6114bcae9997df38d","Facts":{"boot_val":"localhost","category":"Connections and Authentication / Connection Settings","context":"postmaster","description":"Specifies the TCP/IP address(es) on which the server is to listen for connections from client applications. The value takes the form of a comma-separated list of host names and/or numeric IP addresses. The special entry * corresponds to all available IP interfaces. The entry 0.0.0.0 allows listening for all IPv4 addresses and :: allows listening for all IPv6 addresses. If the list is empty, the server does not listen on any IP interface at all, in which case only Unix-domain sockets can be used to connect to it. If the list is not empty, the server will start if it can listen on at least one TCP/IP address. A warning will be emitted for any TCP/IP address which cannot be opened. The default value is localhost, which allows only local TCP/IP “loopback” connections to be made. While client authentication (Chapter 20) allows fine-grained control over who can access the server, listen_addresses controls which interfaces accept connection attempts, which can help prevent repeated malicious connection requests on insecure network interfaces. This parameter can only be set at server start.","description_zh":"指定服务器用于监听来自客户端应用程序的连接的 TCP/IP 地址。该值采用逗号分隔的主机名和/或数字 IP 地址的形式。特殊条目* 对应于所有可用的 IP 接口。条目 0.0.0.0 允许监听所有 IPv4 地址，::允许监听所有 IPv6 地址。如果列表为空，则服务器不会在任何 IP 接口上监听，此时只能使用 Unix 域套接字进行连接。如果列表不为空，则服务器将在至少一个 TCP/IP 地址上可以监听时启动。对于任何无法打开的 TCP/IP 地址，将发出警告。默认值为 localhost，仅允许进行本地 TCP/IP“回环”连接。 在客户端认证（第 20 章）允许对谁可以访问服务器进行细粒度控制的同时，listen_addresses 控制哪些接口接受连接尝试，这可以帮助防止在不安全的网络接口上重复恶意连接请求。此参数只能在服务器启动时设置。","description_zh_html":"\u003cp\u003e\n         指定服务器用于监听来自客户端应用程序的连接的 TCP/IP 地址。该值采用逗号分隔的主机名和/或数字 IP 地址的形式。特殊条目\u003ccode class=\"literal\"\u003e*\u003c/code\u003e 对应于所有可用的 IP 接口。条目 \u003ccode class=\"literal\"\u003e0.0.0.0\u003c/code\u003e 允许监听所有 IPv4 地址，\u003ccode class=\"literal\"\u003e::\u003c/code\u003e允许监听所有 IPv6 地址。如果列表为空，则服务器不会在任何 IP 接口上监听，此时只能使用 Unix 域套接字进行连接。如果列表不为空，则服务器将在至少一个 TCP/IP 地址上可以监听时启动。对于任何无法打开的 TCP/IP 地址，将发出警告。默认值为 \u003cspan class=\"systemitem\"\u003elocalhost\u003c/span\u003e，仅允许进行本地 TCP/IP\u003cspan class=\"quote\"\u003e“\u003cspan class=\"quote\"\u003e回环\u003c/span\u003e”\u003c/span\u003e连接。\n       \u003c/p\u003e\u003cp\u003e\n         在客户端认证（\u003ca class=\"xref\" href=\"/zh/docs/18/client-authentication.html\" title=\"第 20 章 客户端认证\"\u003e第 20 章\u003c/a\u003e）允许对谁可以访问服务器进行细粒度控制的同时，\u003ccode class=\"varname\"\u003elisten_addresses\u003c/code\u003e 控制哪些接口接受连接尝试，这可以帮助防止在不安全的网络接口上重复恶意连接请求。此参数只能在服务器启动时设置。\n       \u003c/p\u003e","doc":{"anchor":"GUC-LISTEN-ADDRESSES","file":"runtime-config-connection.html","lang":"en","sha256":"567ba928f3e4c4783f548dc8a54f1e748f02bbe163924605f2132eb5b0da440d","slug":"18"},"documented":true,"enumvals":null,"extra_desc":null,"lang":"en","max_val":null,"metadata_version":"18","min_val":null,"name":"listen_addresses","short_desc":"Sets the host name or IP address(es) to listen to.","source":"pg-settings-source-snapshot","translation_provenance":{"inputs":[{"kind":"current-pgdoc-translation","path":"/Users/vonng/pgsty/pgdoc/zh/18/html/runtime-config-connection.html","sha256":"f4e5e4debc927cfa154bbdd71f3bf2eda8130ac3acace1109fe7d45ef2a3456b"}],"kind":"same-version-pgdoc","locale":"zh-Hans","source_revision":"b1b500221dbe5437cfca004d6b04d3f6e422765d","version":"18"},"unit":null,"vartype":"string","zh_from":"same-version-pgdoc"},"ManualEvidence":{"doc":{"anchor":"GUC-LISTEN-ADDRESSES","file":"runtime-config-connection.html","lang":"en","sha256":"567ba928f3e4c4783f548dc8a54f1e748f02bbe163924605f2132eb5b0da440d","slug":"18"}},"MeasuredEvidence":{"metadata_version":"18"}},"Text":{"Collection":"guc","Key":"listen_addresses","SourceDatabase":"center","Version":"18","Locale":"en","Title":"listen_addresses","Summary":"Specifies the TCP/IP address(es) on which the server is to listen for connections from client applications. The value takes the form of a comma-separated list of host names and/or numeric IP addresses. The special entry * corresponds to all available IP interfaces. The entry 0.0.0.0 allows listening for all IPv4 addresses and :: allows listening for all IPv6 addresses. If the list is empty, the server does not listen on any IP interface at all, in which case only Unix-domain sockets can be used to connect to it. If the list is not empty, the server will start if it can listen on at least one TCP/IP address. A warning will be emitted for any TCP/IP address which cannot be opened. The default value is localhost, which allows only local TCP/IP “loopback” connections to be made. While client authentication (Chapter 20) allows fine-grained control over who can access the server, listen_addresses controls which interfaces accept connection attempts, which can help prevent repeated malicious connection requests on insecure network interfaces. This parameter can only be set at server start.","BodyHTML":"\u003cp\u003eSpecifies the TCP/IP address(es) on which the server is to listen for connections from client applications. The value takes the form of a comma-separated list of host names and/or numeric IP addresses. The special entry * corresponds to all available IP interfaces. The entry 0.0.0.0 allows listening for all IPv4 addresses and :: allows listening for all IPv6 addresses. If the list is empty, the server does not listen on any IP interface at all, in which case only Unix-domain sockets can be used to connect to it. If the list is not empty, the server will start if it can listen on at least one TCP/IP address. A warning will be emitted for any TCP/IP address which cannot be opened. The default value is localhost, which allows only local TCP/IP “loopback” connections to be made. While client authentication (Chapter 20) allows fine-grained control over who can access the server, listen_addresses controls which interfaces accept connection attempts, which can help prevent repeated malicious connection requests on insecure network interfaces. This parameter can only be set at server start.\u003c/p\u003e","SourceRevision":"wiki-repair-20261023:16e05bae09868d1e90e0b0aa6cca43432fd378a1c82267b6114bcae9997df38d","ContentHash":"71f4ba54eb0b0b222f7dfa2f7035e4598da55315e736b1f88938ad65e8b3c5af","Payload":{"description":"Specifies the TCP/IP address(es) on which the server is to listen for connections from client applications. The value takes the form of a comma-separated list of host names and/or numeric IP addresses. The special entry * corresponds to all available IP interfaces. The entry 0.0.0.0 allows listening for all IPv4 addresses and :: allows listening for all IPv6 addresses. If the list is empty, the server does not listen on any IP interface at all, in which case only Unix-domain sockets can be used to connect to it. If the list is not empty, the server will start if it can listen on at least one TCP/IP address. A warning will be emitted for any TCP/IP address which cannot be opened. The default value is localhost, which allows only local TCP/IP “loopback” connections to be made. While client authentication (Chapter 20) allows fine-grained control over who can access the server, listen_addresses controls which interfaces accept connection attempts, which can help prevent repeated malicious connection requests on insecure network interfaces. This parameter can only be set at server start."}},"RequestedLocale":"en","Fallback":false,"Versions":["10","11","12","13","14","15","16","17","18","19","20","8.0","8.1","8.2","8.3","8.4","9.0","9.1","9.2","9.3","9.4","9.5","9.6"],"Locales":["en","zh-Hans"],"Signatures":null,"Spellings":null,"SQLState":null,"Evidence":null}
