{"Entry":{"collection":"guc","key":"port","name":"port","aliases":[],"metadata":{"baseline":true,"boot_human":"Not specified","boot_val":null,"category":"Connections and Authentication / Connection Settings","category_zh":"","changed_in":[],"changes":[{"documentation_changed":true,"fields":{},"from":"7.4","status":"changed","to":"8.0"}],"content_hash":"d3924ad3867c73e6bb3caf418786c705c6be394aefc25480fa77cecc6cbdcec5","context":"","default_changed_in":[],"default_history":[{"from":"9.0","to":"19","value":"5432"}],"editorial":{"advice":{"olap":"Use an explicit analytical endpoint or network when isolation is required, but keep connection information consistent across failover targets.","oltp":"Set port 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 port and restarting."},"mechanism":["port sets the TCP port the server listens on. One port is used for every TCP listener address and becomes part of client connection strings, service discovery, firewall rules, and health checks.","port 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 port, 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 port globally without a rollback plan and a client or operational compatibility test."],"references":[{"title":"PostgreSQL 19 Beta 4: port","url":"https://www.postgresql.org/docs/19/runtime-config-connection.html#GUC-PORT"},{"title":"PostgreSQL 19 release notes","url":"https://www.postgresql.org/docs/19/release-19.html"}],"related":["listen_addresses","max_connections","reserved_connections","superuser_reserved_connections","unix_socket_directories"],"summary":"port is the PostgreSQL setting that defines the TCP port the server listens on."},"enumvals":[],"first_version":"7.4","group":"Connections and Authentication","group_slug":"connection","imported_at":"2026-09-27T17:57:31.830449+08:00","intro_commit":{},"key":"port","last_version":"20","max_val":"","min_val":"","name":"port","position":312,"present_in":["7.4","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"],"short_desc":"The TCP port the server listens on; 5432 by default.","short_desc_zh":"","source_rev":"english-manuals:ba3248cdd98bcbc851e59200baa1862a7b9a021df6db65e4bb1d1c0c0aca6efb","unit":"","vartype":"integer"}},"Definition":{"Collection":"guc","Key":"port","SourceDatabase":"center","Version":"18","SourceTable":"guc","SourceKey":"port","SourceRevision":"english-manuals:ba3248cdd98bcbc851e59200baa1862a7b9a021df6db65e4bb1d1c0c0aca6efb","Facts":{"boot_val":"5432","category":"Connections and Authentication / Connection Settings","context":"postmaster","description":"The TCP port the server listens on; 5432 by default. Note that the same port number is used for all IP addresses the server listens on. This parameter can only be set at server start.","doc":{"anchor":"GUC-PORT","file":"runtime-config-connection.html","lang":"en","sha256":"567ba928f3e4c4783f548dc8a54f1e748f02bbe163924605f2132eb5b0da440d","slug":"18"},"documented":true,"enumvals":null,"extra_desc":null,"lang":"en","max_val":"65535","metadata_version":"18","min_val":"1","name":"port","short_desc":"Sets the TCP port the server listens on.","source":"pg-settings-source-snapshot","unit":null,"vartype":"integer"},"ManualEvidence":{"doc":{"anchor":"GUC-PORT","file":"runtime-config-connection.html","lang":"en","sha256":"567ba928f3e4c4783f548dc8a54f1e748f02bbe163924605f2132eb5b0da440d","slug":"18"}},"MeasuredEvidence":{"metadata_version":"18"}},"Text":{"Collection":"guc","Key":"port","SourceDatabase":"center","Version":"18","Locale":"en","Title":"port","Summary":"The TCP port the server listens on; 5432 by default. Note that the same port number is used for all IP addresses the server listens on. This parameter can only be set at server start.","BodyHTML":"\u003cp\u003eThe TCP port the server listens on; 5432 by default. Note that the same port number is used for all IP addresses the server listens on. This parameter can only be set at server start.\u003c/p\u003e","SourceRevision":"english-manuals:ba3248cdd98bcbc851e59200baa1862a7b9a021df6db65e4bb1d1c0c0aca6efb","ContentHash":"9cc305d60888897bab32cb7ab9c86bf182e69c521b4d6550b6aa2772cc8f96a3","Payload":{"description":"The TCP port the server listens on; 5432 by default. Note that the same port number is used for all IP addresses the server listens on. This parameter can only be set at server start."}},"RequestedLocale":"zh-Hans","Fallback":true,"Versions":["10","11","12","13","14","15","16","17","18","19","20","7.4","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"],"Signatures":null,"Spellings":null,"SQLState":null,"Evidence":null}
