{"schema": "pgtrue.report/1", "url": "https://pgtrue.postgres.ai/shared/brief/c0f8019e-7ce4-4284-8254-dd0a5003f83f", "published": "2026-10-21T05:34:27Z", "publisher": "PostgresAI", "article": {"title": "pg_upgrade", "url": "https://www.postgresql.org/docs/current/pgupgrade.html", "date_published": "2026-10-15T00:00:00Z", "publisher": "PostgreSQL 18 Documentation"}, "grade": "A", "axes": [{"axis": "Factual", "summary": "A \u00b7 0 wrong of 23 checked \u00b7 0 caveats"}, {"axis": "Applicable", "summary": "A \u00b7 0 wrong of 15 checked \u00b7 0 caveats"}, {"axis": "Consistent", "summary": "A \u00b7 0 wrong of 23 checked \u00b7 0 caveats"}, {"axis": "Transparent", "summary": "0 wrong \u00b7 0 caveats \u00b7 2 checked"}, {"axis": "Safe", "summary": "A \u00b7 0 wrong of 60 checked \u00b7 0 caveats"}], "findings": [{"anchor": "F2", "url": "https://pgtrue.postgres.ai/shared/brief/c0f8019e-7ce4-4284-8254-dd0a5003f83f#F2", "claim": "pg_upgrade defaults to running servers on port 50432\u2026", "explanation": "pg_upgrade.h:20 defines port 50432. option.c:82-83 assigns that default to both clusters unless PGPORTOLD or PGPORTNEW supplies another value.", "verdict": "Accurate", "sources": [{"url": "https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/src/bin/pg_upgrade/pg_upgrade.h#L20-L20", "label": "REL_18_6 \u00b7 src/bin/pg_upgrade/pg_upgrade.h:20-20"}, {"url": "https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/src/bin/pg_upgrade/option.c#L82-L83", "label": "REL_18_6 \u00b7 src/bin/pg_upgrade/option.c:82-83"}]}, {"anchor": "F3", "url": "https://pgtrue.postgres.ai/shared/brief/c0f8019e-7ce4-4284-8254-dd0a5003f83f#F3", "claim": "See recovery_init_sync_method for information about the caveats\u2026", "explanation": "config.sgml:11771-11774 warns that Linux before 5.8 may omit reporting write errors to PostgreSQL. fd.c:3640-3646 describes filesystem-wide syncfs synchronization. These support the article's cross-reference.", "verdict": "Accurate", "sources": [{"url": "https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/doc/src/sgml/config.sgml#L11771-L11774", "label": "REL_18_6 \u00b7 doc/src/sgml/config.sgml:11771-11774"}, {"url": "https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/src/backend/storage/file/fd.c#L3640-L3646", "label": "REL_18_6 \u00b7 src/backend/storage/file/fd.c:3640-3646"}]}, {"anchor": "F4", "url": "https://pgtrue.postgres.ai/shared/brief/c0f8019e-7ce4-4284-8254-dd0a5003f83f#F4", "claim": "\u2026wal_level is not set to minimal\u2026", "title": "Physical standbys require wal_level above minimal", "explanation": "postmaster.c:852-854 rejects startup when max_wal_senders exceeds zero and wal_level equals minimal. The article correctly excludes minimal for the new primary serving physical standbys.", "verdict": "Accurate", "sources": [{"url": "https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/src/backend/postmaster/postmaster.c#L852-L854", "label": "REL_18_6 \u00b7 src/backend/postmaster/postmaster.c:852-854"}]}, {"anchor": "F5", "url": "https://pgtrue.postgres.ai/shared/brief/c0f8019e-7ce4-4284-8254-dd0a5003f83f#F5", "claim": "\u2026You do not need to run pg_backup_start() and pg_backup_stop()\u2026", "title": "The documented standby upgrade does not require pg_backup_start", "explanation": "pgupgrade.sgml:766-769 explicitly exempts this synchronized standby procedure from pg_backup_start. The exemption applies after the preceding shutdown and synchronization steps.", "verdict": "Accurate", "sources": [{"url": "https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/doc/src/sgml/ref/pgupgrade.sgml#L766-L769", "label": "REL_18_6 \u00b7 doc/src/sgml/ref/pgupgrade.sgml:766-769"}]}, {"anchor": "F6", "url": "https://pgtrue.postgres.ai/shared/brief/c0f8019e-7ce4-4284-8254-dd0a5003f83f#F6", "claim": "\u2026PGOPTIONS='-c vacuum_cost_delay=0' vacuumdb\u2026", "explanation": "config.sgml:9360-9364 defines zero as disabling cost-based vacuum delay. autovacuum.c:1681-1687 clears VacuumCostActive when vacuum_cost_delay is zero. These ranges establish the zero-delay behavior.", "verdict": "Accurate", "sources": [{"url": "https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/doc/src/sgml/config.sgml#L9360-L9364", "label": "REL_18_6 \u00b7 doc/src/sgml/config.sgml:9360-9364"}, {"url": "https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/src/backend/postmaster/autovacuum.c#L1681-L1687", "label": "REL_18_6 \u00b7 src/backend/postmaster/autovacuum.c:1681-1687"}]}, {"anchor": "F7", "url": "https://pgtrue.postgres.ai/shared/brief/c0f8019e-7ce4-4284-8254-dd0a5003f83f#F7", "claim": "If you did start the new cluster, it has written to shared files\u2026", "explanation": "pg_upgrade.c:176-179 states that link mode makes restarting the old cluster unsafe after the new cluster starts. This matches the article's link-mode rollback warning.", "verdict": "Accurate", "sources": [{"url": "https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/src/bin/pg_upgrade/pg_upgrade.c#L176-L179", "label": "REL_18_6 \u00b7 src/bin/pg_upgrade/pg_upgrade.c:176-179"}]}, {"anchor": "F8", "url": "https://pgtrue.postgres.ai/shared/brief/c0f8019e-7ce4-4284-8254-dd0a5003f83f#F8", "claim": "\u2026Unless the --no-statistics option is specified, pg_upgrade will transfer most optimizer statistics\u2026", "explanation": "PostgreSQL 18.6 enables statistics transfer in option.c:76. dump.c:65 selects --statistics unless the user disables it. These checks establish the default, not which statistics transfer or which regeneration commands complete the upgrade.", "verdict": "Accurate", "sources": [{"url": "https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/src/bin/pg_upgrade/option.c#L75-L76", "label": "REL_18_6 \u00b7 src/bin/pg_upgrade/option.c:75-76"}, {"url": "https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/src/bin/pg_upgrade/dump.c#L65-L65", "label": "REL_18_6 \u00b7 src/bin/pg_upgrade/dump.c:65-65"}]}, {"anchor": "F9", "url": "https://pgtrue.postgres.ai/shared/brief/c0f8019e-7ce4-4284-8254-dd0a5003f83f#F9", "claim": "\u2026regcollation regconfig regdictionary regnamespace regoper regoperator regproc regprocedure\u2026", "explanation": "check.c:170-177 lists regcollation, regconfig, regdictionary, regnamespace, regoper, regoperator, regproc, and regprocedure. All 8 names match the article's unsupported column-type list.", "verdict": "Accurate", "sources": [{"url": "https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/src/bin/pg_upgrade/check.c#L170-L177", "label": "REL_18_6 \u00b7 src/bin/pg_upgrade/check.c:170-177"}]}, {"anchor": "F11", "url": "https://pgtrue.postgres.ai/shared/brief/c0f8019e-7ce4-4284-8254-dd0a5003f83f#F11", "claim": "\u2026supports upgrades from 9.2.X and later\u2026", "title": "PostgreSQL 18 retains the 9.2 source-version floor", "explanation": "PostgreSQL 18.6 rejects source versions below 9.2 in src/bin/pg_upgrade/check.c:863. The same function requires the destination major version to match the utility. It also rejects downgrades.", "verdict": "Accurate", "sources": [{"url": "https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/src/bin/pg_upgrade/check.c#L850-L879", "label": "REL_18_6 \u00b7 src/bin/pg_upgrade/check.c:850-879"}]}, {"anchor": "F12", "url": "https://pgtrue.postgres.ai/shared/brief/c0f8019e-7ce4-4284-8254-dd0a5003f83f#F12", "claim": "Starting from PostgreSQL 18, database clusters maintain their own default char signedness setting\u2026", "title": "PostgreSQL 18 stores cluster char signedness", "explanation": "PostgreSQL 18.0 and 18.6 store default_char_signedness in src/include/catalog/pg_control.h:228. PostgreSQL 18.0's upgrade code states that earlier clusters lack this information. It derives their initial value from the platform where pg_upgrade was built.", "verdict": "Accurate", "sources": [{"url": "https://github.com/postgres/postgres/blob/3d6a828938a5fa0444275d3d2f67b64ec3199eb7/src/include/catalog/pg_control.h#L218-L231", "label": "REL_18_0 \u00b7 src/include/catalog/pg_control.h:218-231"}, {"url": "https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/src/include/catalog/pg_control.h#L228-L228", "label": "REL_18_6 \u00b7 src/include/catalog/pg_control.h:228-228"}, {"url": "https://github.com/postgres/postgres/blob/3d6a828938a5fa0444275d3d2f67b64ec3199eb7/src/bin/pg_upgrade/controldata.c#L580-L603", "label": "REL_18_0 \u00b7 src/bin/pg_upgrade/controldata.c:580-603"}]}, {"anchor": "F13", "url": "https://pgtrue.postgres.ai/shared/brief/c0f8019e-7ce4-4284-8254-dd0a5003f83f#F13", "claim": "\u2026only logical slots on the primary are copied\u2026", "title": "The PostgreSQL 17 slot migration boundary holds", "explanation": "PostgreSQL 17.0 and 18.6 restrict slot migration to logical slots. Their upgrade checks identify PostgreSQL 17 as the source-version boundary. Physical slots require recreation. The article states this distinction.", "verdict": "Accurate", "sources": [{"url": "https://github.com/postgres/postgres/blob/d7ec59a63d745ba74fba0e280bbf85dc6d1caa3e/src/bin/pg_upgrade/info.c#L650-L678", "label": "REL_17_0 \u00b7 src/bin/pg_upgrade/info.c:650-678"}, {"url": "https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/src/bin/pg_upgrade/info.c#L655-L680", "label": "REL_18_6 \u00b7 src/bin/pg_upgrade/info.c:655-680"}, {"url": "https://github.com/postgres/postgres/blob/d7ec59a63d745ba74fba0e280bbf85dc6d1caa3e/src/bin/pg_upgrade/check.c#L592-L614", "label": "REL_17_0 \u00b7 src/bin/pg_upgrade/check.c:592-614"}, {"url": "https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/src/bin/pg_upgrade/check.c#L610-L632", "label": "REL_18_6 \u00b7 src/bin/pg_upgrade/check.c:610-632"}]}, {"anchor": "F14", "url": "https://pgtrue.postgres.ai/shared/brief/c0f8019e-7ce4-4284-8254-dd0a5003f83f#F14", "claim": "\u2026it has written to shared files and it is unsafe to use the old cluster.", "title": "Link mode prevents safe rollback after the upgraded cluster starts", "explanation": "pg_upgrade.c:177-179 confirms the link-mode restart boundary. controldata.c:765-766 renames the old control file with a .old suffix. The article's rollback warning matches PostgreSQL 18.6.", "verdict": "Accurate", "sources": [{"url": "https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/src/bin/pg_upgrade/pg_upgrade.c#L139-L228", "label": "REL_18_6 \u00b7 src/bin/pg_upgrade/pg_upgrade.c:139-228"}, {"url": "https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/src/bin/pg_upgrade/controldata.c#L754-L779", "label": "REL_18_6 \u00b7 src/bin/pg_upgrade/controldata.c:754-779"}]}, {"anchor": "F15", "url": "https://pgtrue.postgres.ai/shared/brief/c0f8019e-7ce4-4284-8254-dd0a5003f83f#F15", "claim": "\u2026once the file transfer step begins, the old cluster will be destructively modified\u2026", "title": "Swap mode has an earlier rollback boundary than link mode", "explanation": "pg_upgrade.c:178-179 warns that swap mode makes the old cluster unsafe to start during file transfer. The article distinguishes this boundary from link mode's later restart boundary.", "verdict": "Accurate", "sources": [{"url": "https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/src/bin/pg_upgrade/pg_upgrade.c#L139-L228", "label": "REL_18_6 \u00b7 src/bin/pg_upgrade/pg_upgrade.c:139-228"}]}, {"anchor": "F16", "url": "https://pgtrue.postgres.ai/shared/brief/c0f8019e-7ce4-4284-8254-dd0a5003f83f#F16", "claim": "\u2026perform only the checks, even if the old server is still running.", "title": "The check mode supports a running old server", "explanation": "pg_upgrade.c:381-385 enables live checking when --check is set. check.c:775-782 exits after compatibility checks. The upgrade does not proceed into file transfer.", "verdict": "Accurate", "sources": [{"url": "https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/src/bin/pg_upgrade/pg_upgrade.c#L355-L392", "label": "REL_18_6 \u00b7 src/bin/pg_upgrade/pg_upgrade.c:355-392"}, {"url": "https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/src/bin/pg_upgrade/check.c#L769-L787", "label": "REL_18_6 \u00b7 src/bin/pg_upgrade/check.c:769-787"}]}, {"anchor": "F17", "url": "https://pgtrue.postgres.ai/shared/brief/c0f8019e-7ce4-4284-8254-dd0a5003f83f#F17", "claim": "\u2026when checking an old running server, the old and new port numbers must be different.", "title": "Live checks require different old and new ports", "explanation": "check.c:912-914 rejects equal port numbers when live_check is true. The article states the condition correctly.", "verdict": "Accurate", "sources": [{"url": "https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/src/bin/pg_upgrade/check.c#L900-L917", "label": "REL_18_6 \u00b7 src/bin/pg_upgrade/check.c:900-917"}]}, {"anchor": "F18", "url": "https://pgtrue.postgres.ai/shared/brief/c0f8019e-7ce4-4284-8254-dd0a5003f83f#F18", "claim": "Link mode also requires that the old and new cluster data directories be in the same file system.", "title": "Link and swap modes require compatible data-directory file systems", "explanation": "file.c:446-453 tests a hard link between the old and new data directories. Both link and swap modes fail when that prerequisite fails.", "verdict": "Accurate", "sources": [{"url": "https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/src/bin/pg_upgrade/file.c#L432-L456", "label": "REL_18_6 \u00b7 src/bin/pg_upgrade/file.c:432-456"}]}, {"anchor": "F19", "url": "https://pgtrue.postgres.ai/shared/brief/c0f8019e-7ce4-4284-8254-dd0a5003f83f#F19", "claim": "Setting --jobs to 2 or higher allows pg_upgrade to process multiple databases and tablespaces in parallel.", "title": "Two or more jobs enable parallel upgrade work", "explanation": "parallel.c:183-187 selects the parallel branch above 1 job. relfilenumber.c:131-135 describes parallel transfer across tablespaces. The article's threshold of 2 jobs matches PostgreSQL 18.6.", "verdict": "Accurate", "sources": [{"url": "https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/src/bin/pg_upgrade/relfilenumber.c#L125-L158", "label": "REL_18_6 \u00b7 src/bin/pg_upgrade/relfilenumber.c:125-158"}, {"url": "https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/src/bin/pg_upgrade/parallel.c#L172-L222", "label": "REL_18_6 \u00b7 src/bin/pg_upgrade/parallel.c:172-222"}]}, {"anchor": "F20", "url": "https://pgtrue.postgres.ai/shared/brief/c0f8019e-7ce4-4284-8254-dd0a5003f83f#F20", "claim": "This option has no effect when --no-sync is used.", "title": "Disabling synchronization bypasses the selected synchronization method", "explanation": "pg_upgrade.c:216-227 runs the synchronization command only when do_sync is true. A synchronization-method selection has no effect when that block does not run.", "verdict": "Accurate", "sources": [{"url": "https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/src/bin/pg_upgrade/pg_upgrade.c#L139-L228", "label": "REL_18_6 \u00b7 src/bin/pg_upgrade/pg_upgrade.c:139-228"}]}, {"anchor": "F21", "url": "https://pgtrue.postgres.ai/shared/brief/c0f8019e-7ce4-4284-8254-dd0a5003f83f#F21", "claim": "If it is selected but not supported, the pg_upgrade run will error.", "title": "Unsupported clone mode fails instead of falling back to copying", "explanation": "file.c:360-396 tests file cloning and raises fatal errors when cloning fails or the platform lacks support. The article states that failure behavior correctly.", "verdict": "Accurate", "sources": [{"url": "https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/src/bin/pg_upgrade/file.c#L320-L399", "label": "REL_18_6 \u00b7 src/bin/pg_upgrade/file.c:320-399"}]}, {"anchor": "F22", "url": "https://pgtrue.postgres.ai/shared/brief/c0f8019e-7ce4-4284-8254-dd0a5003f83f#F22", "claim": "\u2026this can be overridden to speed up statistics generation using PGOPTIONS\u2026", "title": "The vacuum cost delay also applies to explicit ANALYZE", "explanation": "autovacuum.c:1670-1674 assigns VacuumCostDelay to explicit VACUUM and ANALYZE operations. Setting vacuum_cost_delay=0 can remove that delay during statistics generation.", "verdict": "Accurate", "sources": [{"url": "https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/src/backend/postmaster/autovacuum.c#L1647-L1712", "label": "REL_18_6 \u00b7 src/backend/postmaster/autovacuum.c:1647-1712"}]}, {"anchor": "F23", "url": "https://pgtrue.postgres.ai/shared/brief/c0f8019e-7ce4-4284-8254-dd0a5003f83f#F23", "claim": "\u2026regclass , regrole , and regtype can be upgraded.", "title": "The supported reg* exceptions match preserved catalog OIDs", "explanation": "check.c:169-179 lists eight rejected reg* types. It exempts regclass, regrole, and regtype because their referenced catalog OIDs remain preserved.", "verdict": "Accurate", "sources": [{"url": "https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/src/bin/pg_upgrade/check.c#L155-L186", "label": "REL_18_6 \u00b7 src/bin/pg_upgrade/check.c:155-186"}]}, {"anchor": "F24", "url": "https://pgtrue.postgres.ai/shared/brief/c0f8019e-7ce4-4284-8254-dd0a5003f83f#F24", "claim": "pg_upgrade requires write permission in the current directory.", "title": "The current directory requires write access", "explanation": "exec.c:266-270 checks current-directory permissions and rejects insufficient access. The article correctly names write permission as a requirement.", "verdict": "Accurate", "sources": [{"url": "https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/src/bin/pg_upgrade/exec.c#L260-L273", "label": "REL_18_6 \u00b7 src/bin/pg_upgrade/exec.c:260-273"}]}, {"anchor": "F25", "url": "https://pgtrue.postgres.ai/shared/brief/c0f8019e-7ce4-4284-8254-dd0a5003f83f#F25", "claim": "\u2026multiple option invocations are appended\u2026", "title": "Repeated server-option arguments accumulate", "explanation": "option.c:149-173 appends repeated -o and -O values with a separating space. Later occurrences do not replace earlier server options.", "verdict": "Accurate", "sources": [{"url": "https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/src/bin/pg_upgrade/option.c#L148-L190", "label": "REL_18_6 \u00b7 src/bin/pg_upgrade/option.c:148-190"}]}]}