{"schema": "pgtrue.report/1", "url": "https://pgtrue.postgres.ai/shared/brief/e01006d6-e598-414b-9aeb-1bd662228ae3", "published": "2026-10-21T03:56:11Z", "publisher": "PostgresAI", "article": {"title": "All Your GUCs in a Row: primary_conninfo", "url": "https://thebuild.com/blog/all-your-gucs-in-a-row-primary_conninfo", "date_published": "2026-10-15T01:00:00Z", "author": "Christophe Pettus", "publisher": "thebuild.com"}, "grade": "A", "axes": [{"axis": "Factual", "summary": "A \u00b7 0 wrong of 17 checked \u00b7 0 caveats \u00b7 partly assessed"}, {"axis": "Applicable", "summary": "A \u00b7 0 wrong of 14 checked \u00b7 0 caveats"}, {"axis": "Consistent", "summary": "A \u00b7 0 wrong of 17 checked \u00b7 0 caveats"}, {"axis": "Transparent", "summary": "A \u00b7 0 wrong of 3 checked \u00b7 0 caveats"}, {"axis": "Safe", "summary": "A- \u00b7 1 wrong of 4 checked \u00b7 0 caveats"}], "findings": [{"anchor": "F1", "url": "https://pgtrue.postgres.ai/shared/brief/e01006d6-e598-414b-9aeb-1bd662228ae3#F1", "claim": "\u2026primary_conninfo = 'host=node1,node2,node3 port=5432 user=replicator passfile=/var/lib/postgresql/.pgpass target_session_attrs=read-write'\u2026", "title": "The displayed multi-host configuration contains invalid literal newlines", "explanation": "The displayed three-line assignment is invalid in postgresql.conf. src/backend/utils/misc/guc-file.l:92 excludes newlines from quoted strings. PostgreSQL 18 retains that restriction at line 89. Put the assignment on one physical line. Copying these literal line breaks into a new standby's configuration prevents startup.", "verdict": "Recipe error", "sources": [{"url": "https://github.com/postgres/postgres/blob/89df812eb890814b105d871185935b580478e660/src/backend/utils/misc/guc-file.l#L90-L108", "label": "REL_13_23 \u00b7 src/backend/utils/misc/guc-file.l:90-108"}, {"url": "https://github.com/postgres/postgres/blob/3d6a828938a5fa0444275d3d2f67b64ec3199eb7/src/backend/utils/misc/guc-file.l#L88-L105", "label": "REL_18_0 \u00b7 src/backend/utils/misc/guc-file.l:88-105"}]}, {"anchor": "F3", "url": "https://pgtrue.postgres.ai/shared/brief/e01006d6-e598-414b-9aeb-1bd662228ae3#F3", "claim": "\u2026primary_conninfo does not make a server a standby.", "title": "primary_conninfo does not enable standby mode", "explanation": "standby.signal enables standby mode in src/backend/access/transam/xlog.c:5512. recovery.signal enables archive recovery without standby mode. primary_conninfo supplies the sending-server connection after standby mode is selected.", "verdict": "Accurate", "sources": [{"url": "https://github.com/postgres/postgres/blob/89df812eb890814b105d871185935b580478e660/doc/src/sgml/config.sgml#L4249-L4290", "label": "REL_13_23 \u00b7 doc/src/sgml/config.sgml:4249-4290"}, {"url": "https://github.com/postgres/postgres/blob/89df812eb890814b105d871185935b580478e660/src/backend/utils/misc/guc.c#L3793-L3801", "label": "REL_13_23 \u00b7 src/backend/utils/misc/guc.c:3793-3801"}, {"url": "https://github.com/postgres/postgres/blob/89df812eb890814b105d871185935b580478e660/src/backend/access/transam/xlog.c#L5508-L5526", "label": "REL_13_23 \u00b7 src/backend/access/transam/xlog.c:5508-5526"}]}, {"anchor": "F4", "url": "https://pgtrue.postgres.ai/shared/brief/e01006d6-e598-414b-9aeb-1bd662228ae3#F4", "claim": "\u2026dbname=replication\u2026", "title": "Physical receivers use replication for password-file database matching", "explanation": "src/backend/replication/libpqwalreceiver/libpqwalreceiver.c:148 overrides dbname with replication for physical connections. The same routine forces replication=true. Its comment identifies password-file lookup as the reason for the database override.", "verdict": "Accurate", "sources": [{"url": "https://github.com/postgres/postgres/blob/89df812eb890814b105d871185935b580478e660/src/backend/replication/libpqwalreceiver/libpqwalreceiver.c#L125-L170", "label": "REL_13_23 \u00b7 src/backend/replication/libpqwalreceiver/libpqwalreceiver.c:125-170"}, {"url": "https://github.com/postgres/postgres/blob/89df812eb890814b105d871185935b580478e660/src/interfaces/libpq/fe-connect.c#L1195-L1245", "label": "REL_13_23 \u00b7 src/interfaces/libpq/fe-connect.c:1195-1245"}]}, {"anchor": "F5", "url": "https://pgtrue.postgres.ai/shared/brief/e01006d6-e598-414b-9aeb-1bd662228ae3#F5", "claim": "\u2026wal_retrieve_retry_interval (five seconds)\u2026", "title": "WAL retrieval retries follow the documented source sequence", "explanation": "src/backend/access/transam/xlog.c:12511 describes archive and local WAL checks before streaming. Recovery returns to those sources after streaming fails. wal_retrieve_retry_interval defaults to 5,000 milliseconds.", "verdict": "Accurate", "sources": [{"url": "https://github.com/postgres/postgres/blob/89df812eb890814b105d871185935b580478e660/src/backend/access/transam/xlog.c#L12508-L12522", "label": "REL_13_23 \u00b7 src/backend/access/transam/xlog.c:12508-12522"}, {"url": "https://github.com/postgres/postgres/blob/89df812eb890814b105d871185935b580478e660/src/backend/utils/misc/guc.c#L3104-L3113", "label": "REL_13_23 \u00b7 src/backend/utils/misc/guc.c:3104-3113"}, {"url": "https://github.com/postgres/postgres/blob/89df812eb890814b105d871185935b580478e660/src/backend/utils/misc/guc.c#L3108-L3111", "label": "REL_13_23 \u00b7 src/backend/utils/misc/guc.c:3108-3111"}, {"url": "https://github.com/postgres/postgres/blob/89df812eb890814b105d871185935b580478e660/src/backend/utils/misc/guc.c#L3104-L3113", "label": "REL_13_23 \u00b7 src/backend/utils/misc/guc.c:3104-3113"}]}, {"anchor": "F6", "url": "https://pgtrue.postgres.ai/shared/brief/e01006d6-e598-414b-9aeb-1bd662228ae3#F6", "claim": "\u2026set it to the empty string and reload\u2026", "title": "Reloading an empty primary_conninfo disables streaming", "explanation": "Configuration reload requests receiver restart when primary_conninfo changes. src/backend/access/transam/xlog.c:12779 starts a replacement only when the string is nonempty. PostgreSQL 13 supports this reload. PostgreSQL 12 requires restart.", "verdict": "Accurate", "sources": [{"url": "https://github.com/postgres/postgres/blob/89df812eb890814b105d871185935b580478e660/src/backend/utils/misc/guc.c#L3793-L3801", "label": "REL_13_23 \u00b7 src/backend/utils/misc/guc.c:3793-3801"}, {"url": "https://github.com/postgres/postgres/blob/89df812eb890814b105d871185935b580478e660/src/backend/postmaster/startup.c#L132-L149", "label": "REL_13_23 \u00b7 src/backend/postmaster/startup.c:132-149"}, {"url": "https://github.com/postgres/postgres/blob/89df812eb890814b105d871185935b580478e660/src/backend/access/transam/xlog.c#L12748-L12780", "label": "REL_13_23 \u00b7 src/backend/access/transam/xlog.c:12748-12780"}, {"url": "https://github.com/postgres/postgres/blob/ad1f2885b8c82e0c2d56d7974f012cbecce17a17/src/backend/utils/misc/guc.c#L3561-L3570", "label": "REL_12_0 \u00b7 src/backend/utils/misc/guc.c:3561-3570"}, {"url": "https://github.com/postgres/postgres/blob/89df812eb890814b105d871185935b580478e660/doc/src/sgml/config.sgml#L4283-L4286", "label": "REL_13_23 \u00b7 doc/src/sgml/config.sgml:4283-4286"}]}, {"anchor": "F7", "url": "https://pgtrue.postgres.ai/shared/brief/e01006d6-e598-414b-9aeb-1bd662228ae3#F7", "claim": "\u2026with the complete value, every time a reload changes the parameter\u2026", "title": "Configuration-change logging exposes inline connection passwords", "explanation": "src/backend/utils/misc/guc-file.l:456 logs the changed configuration value without redaction. The postmaster uses LOG severity for this message. The default log_min_messages value is WARNING, which includes LOG messages.", "verdict": "Accurate", "sources": [{"url": "https://github.com/postgres/postgres/blob/89df812eb890814b105d871185935b580478e660/src/backend/utils/misc/guc-file.l#L430-L460", "label": "REL_13_23 \u00b7 src/backend/utils/misc/guc-file.l:430-460"}, {"url": "https://github.com/postgres/postgres/blob/89df812eb890814b105d871185935b580478e660/src/backend/utils/misc/guc-file.l#L132-L142", "label": "REL_13_23 \u00b7 src/backend/utils/misc/guc-file.l:132-142"}, {"url": "https://github.com/postgres/postgres/blob/89df812eb890814b105d871185935b580478e660/src/backend/utils/misc/guc.c#L4552-L4560", "label": "REL_13_23 \u00b7 src/backend/utils/misc/guc.c:4552-4560"}]}, {"anchor": "F8", "url": "https://pgtrue.postgres.ai/shared/brief/e01006d6-e598-414b-9aeb-1bd662228ae3#F8", "claim": "\u2026pg_basebackup -R appends to postgresql.auto.conf\u2026", "title": "pg_basebackup preserves inherited slot settings unless it overrides them", "explanation": "src/fe_utils/recovery_gen.c:131 opens postgresql.auto.conf in append mode. The generator writes primary_slot_name only when it receives a replication-slot argument. Existing slot settings can therefore remain effective in a clone. Later primary_conninfo entries override earlier entries.", "verdict": "Accurate", "sources": [{"url": "https://github.com/postgres/postgres/blob/89df812eb890814b105d871185935b580478e660/src/fe_utils/recovery_gen.c#L20-L160", "label": "REL_13_23 \u00b7 src/fe_utils/recovery_gen.c:20-160"}, {"url": "https://github.com/postgres/postgres/blob/89df812eb890814b105d871185935b580478e660/src/fe_utils/recovery_gen.c#L20-L160", "label": "REL_13_23 \u00b7 src/fe_utils/recovery_gen.c:20-160"}, {"url": "https://github.com/postgres/postgres/blob/89df812eb890814b105d871185935b580478e660/src/fe_utils/recovery_gen.c#L20-L160", "label": "REL_13_23 \u00b7 src/fe_utils/recovery_gen.c:20-160"}, {"url": "https://github.com/postgres/postgres/blob/89df812eb890814b105d871185935b580478e660/doc/src/sgml/config.sgml#L146-L159", "label": "REL_13_23 \u00b7 doc/src/sgml/config.sgml:146-159"}, {"url": "https://github.com/postgres/postgres/blob/89df812eb890814b105d871185935b580478e660/src/backend/replication/basebackup.c#L202-L240", "label": "REL_13_23 \u00b7 src/backend/replication/basebackup.c:202-240"}]}, {"anchor": "F9", "url": "https://pgtrue.postgres.ai/shared/brief/e01006d6-e598-414b-9aeb-1bd662228ae3#F9", "claim": "\u2026it needs the upstream to report in_hot_standby\u2026", "title": "The primary selection restriction holds for older physical replication upstreams", "explanation": "PostgreSQL 14 libpq falls back to SELECT pg_catalog.pg_is_in_recovery() when in_hot_standby is unavailable. Physical replication senders reject that SQL. read-write instead uses SHOW transaction_read_only, which the replication protocol supports.", "verdict": "Accurate", "sources": [{"url": "https://github.com/postgres/postgres/blob/86a4dc1e6f29d1992a2afa3fac1a0b0a6e84568c/src/interfaces/libpq/fe-connect.c#L3597-L3638", "label": "REL_14_0 \u00b7 src/interfaces/libpq/fe-connect.c:3597-3638"}, {"url": "https://github.com/postgres/postgres/blob/89df812eb890814b105d871185935b580478e660/src/backend/replication/walsender.c#L1570-L1625", "label": "REL_13_23 \u00b7 src/backend/replication/walsender.c:1570-1625"}, {"url": "https://github.com/postgres/postgres/blob/89df812eb890814b105d871185935b580478e660/doc/src/sgml/libpq.sgml#L1844-L1860", "label": "REL_13_23 \u00b7 doc/src/sgml/libpq.sgml:1844-1860"}]}, {"anchor": "F10", "url": "https://pgtrue.postgres.ai/shared/brief/e01006d6-e598-414b-9aeb-1bd662228ae3#F10", "claim": "\u2026the slot-synchronization worker needs an ordinary database to connect to\u2026", "title": "Slot synchronization requires an explicit database in primary_conninfo", "explanation": "PostgreSQL 17 checks primary_conninfo for dbname in src/backend/replication/logical/slotsync.c:1020. The worker errors when dbname is absent. The version-matched documentation distinguishes this database connection from physical streaming.", "verdict": "Accurate", "sources": [{"url": "https://github.com/postgres/postgres/blob/d7ec59a63d745ba74fba0e280bbf85dc6d1caa3e/src/backend/replication/logical/slotsync.c#L1007-L1032", "label": "REL_17_0 \u00b7 src/backend/replication/logical/slotsync.c:1007-1032"}, {"url": "https://github.com/postgres/postgres/blob/d7ec59a63d745ba74fba0e280bbf85dc6d1caa3e/doc/src/sgml/config.sgml#L4809-L4818", "label": "REL_17_0 \u00b7 doc/src/sgml/config.sgml:4809-4818"}]}, {"anchor": "F12", "url": "https://pgtrue.postgres.ai/shared/brief/e01006d6-e598-414b-9aeb-1bd662228ae3#F12", "claim": "\u2026options=''-c wal_sender_timeout=5000''\u2026", "title": "The sender-timeout options example uses valid configuration quoting", "explanation": "doc/src/sgml/high-availability.sgml:752 contains the same options value and doubled quotes. wal_sender_timeout has PGC_USERSET context and millisecond units. The receiver can supply that upstream session setting through libpq options.", "verdict": "Accurate", "sources": [{"url": "https://github.com/postgres/postgres/blob/89df812eb890814b105d871185935b580478e660/doc/src/sgml/high-availability.sgml#L746-L755", "label": "REL_13_23 \u00b7 doc/src/sgml/high-availability.sgml:746-755"}, {"url": "https://github.com/postgres/postgres/blob/89df812eb890814b105d871185935b580478e660/src/backend/utils/misc/guc.c#L2795-L2803", "label": "REL_13_23 \u00b7 src/backend/utils/misc/guc.c:2795-2803"}, {"url": "https://github.com/postgres/postgres/blob/89df812eb890814b105d871185935b580478e660/doc/src/sgml/config.sgml#L146-L159", "label": "REL_13_23 \u00b7 doc/src/sgml/config.sgml:146-159"}]}, {"anchor": "F13", "url": "https://pgtrue.postgres.ai/shared/brief/e01006d6-e598-414b-9aeb-1bd662228ae3#F13", "claim": "\u2026password=********\u2026", "explanation": "libpqrcv_get_conninfo reads live connection options. src/backend/replication/libpqwalreceiver/libpqwalreceiver.c:300 identifies security-sensitive options, which the formatter replaces with eight asterisks. src/backend/replication/walreceiver.c:305 obtains that string and copies it into walrcv->conninfo.", "verdict": "Accurate", "sources": [{"url": "https://github.com/postgres/postgres/blob/89df812eb890814b105d871185935b580478e660/src/backend/replication/walreceiver.c#L290-L312", "label": "REL_13_23 \u00b7 src/backend/replication/walreceiver.c:290-312"}, {"url": "https://github.com/postgres/postgres/blob/89df812eb890814b105d871185935b580478e660/src/backend/replication/libpqwalreceiver/libpqwalreceiver.c#L281-L308", "label": "REL_13_23 \u00b7 src/backend/replication/libpqwalreceiver/libpqwalreceiver.c:281-308"}]}, {"anchor": "F14", "url": "https://pgtrue.postgres.ai/shared/brief/e01006d6-e598-414b-9aeb-1bd662228ae3#F14", "claim": "\u2026a slot is held by one walsender at a time\u2026", "title": "Two active receivers cannot share one physical replication slot", "explanation": "src/backend/replication/slot.c:469 detects ownership by another process. Slot acquisition then reports the active owner's PID. Clones that inherit a sibling's slot name can encounter the contention described in the article.", "verdict": "Accurate", "sources": [{"url": "https://github.com/postgres/postgres/blob/89df812eb890814b105d871185935b580478e660/src/backend/replication/slot.c#L450-L478", "label": "REL_13_23 \u00b7 src/backend/replication/slot.c:450-478"}]}, {"anchor": "F15", "url": "https://pgtrue.postgres.ai/shared/brief/e01006d6-e598-414b-9aeb-1bd662228ae3#F15", "claim": "\u2026outside that situation it is inert\u2026", "title": "primary_conninfo affects standby operation", "explanation": "PostgreSQL 13.23 documents no effect outside standby mode. See doc/src/sgml/config.sgml:4287.", "verdict": "Accurate", "sources": [{"url": "https://github.com/postgres/postgres/blob/89df812eb890814b105d871185935b580478e660/doc/src/sgml/config.sgml#L4287-L4287", "label": "REL_13_23 \u00b7 doc/src/sgml/config.sgml:4287-4287"}]}, {"anchor": "F16", "url": "https://pgtrue.postgres.ai/shared/brief/e01006d6-e598-414b-9aeb-1bd662228ae3#F16", "claim": "A .pgpass line with app or postgres in the database column will never match a walreceiver connection\u2026", "title": "Standby password-file entries use replication", "explanation": "PostgreSQL 13.23 specifies replication as the standby password-file database name. See doc/src/sgml/config.sgml:4275.", "verdict": "Accurate", "sources": [{"url": "https://github.com/postgres/postgres/blob/89df812eb890814b105d871185935b580478e660/doc/src/sgml/config.sgml#L4275-L4276", "label": "REL_13_23 \u00b7 doc/src/sgml/config.sgml:4275-4276"}]}, {"anchor": "F17", "url": "https://pgtrue.postgres.ai/shared/brief/e01006d6-e598-414b-9aeb-1bd662228ae3#F17", "claim": "The default is the empty string.", "title": "primary_conninfo defaults to an empty string", "explanation": "PostgreSQL 13.23 initializes PrimaryConnInfo to an empty string. See src/backend/utils/misc/guc.c:3798.", "verdict": "Accurate", "sources": [{"url": "https://github.com/postgres/postgres/blob/89df812eb890814b105d871185935b580478e660/src/backend/utils/misc/guc.c#L3798-L3799", "label": "REL_13_23 \u00b7 src/backend/utils/misc/guc.c:3798-3799"}]}, {"anchor": "F18", "url": "https://pgtrue.postgres.ai/shared/brief/e01006d6-e598-414b-9aeb-1bd662228ae3#F18", "claim": "\u20265 , five milliseconds\u2026", "title": "wal_sender_timeout=5 specifies 5 ms", "explanation": "PostgreSQL 13.23 marks wal_sender_timeout with GUC_UNIT_MS in src/backend/utils/misc/guc.c:2795. A unitless value of 5 means 5 ms.", "verdict": "Accurate", "sources": [{"url": "https://github.com/postgres/postgres/blob/89df812eb890814b105d871185935b580478e660/src/backend/utils/misc/guc.c#L2795-L2803", "label": "REL_13_23 \u00b7 src/backend/utils/misc/guc.c:2795-2803"}]}, {"anchor": "F19", "url": "https://pgtrue.postgres.ai/shared/brief/e01006d6-e598-414b-9aeb-1bd662228ae3#F19", "claim": "\u2026password=foopass inline, three times on one page\u2026", "title": "The documentation contains three inline password examples", "explanation": "PostgreSQL 13.23 includes password=foopass in three primary_conninfo examples. They appear in doc/src/sgml/high-availability.sgml:752, 883, and 995.", "verdict": "Accurate", "sources": [{"url": "https://github.com/postgres/postgres/blob/89df812eb890814b105d871185935b580478e660/doc/src/sgml/high-availability.sgml#L752-L752", "label": "REL_13_23 \u00b7 doc/src/sgml/high-availability.sgml:752-752"}, {"url": "https://github.com/postgres/postgres/blob/89df812eb890814b105d871185935b580478e660/doc/src/sgml/high-availability.sgml#L883-L883", "label": "REL_13_23 \u00b7 doc/src/sgml/high-availability.sgml:883-883"}, {"url": "https://github.com/postgres/postgres/blob/89df812eb890814b105d871185935b580478e660/doc/src/sgml/high-availability.sgml#L995-L995", "label": "REL_13_23 \u00b7 doc/src/sgml/high-availability.sgml:995-995"}]}]}