Skip to content

Do not block pg_upgrade (skip check when IsBinaryUpgrade)#10

Open
thomas-bright wants to merge 1 commit into
eradman:masterfrom
bright-eu:skip-check-during-binary-upgrade
Open

Do not block pg_upgrade (skip check when IsBinaryUpgrade)#10
thomas-bright wants to merge 1 commit into
eradman:masterfrom
bright-eu:skip-check-during-binary-upgrade

Conversation

@thomas-bright

Copy link
Copy Markdown
Contributor

Follow-up to #9, addressing problem 2 from #8.

pg_upgrade issues catalog UPDATEs without a WHERE clause — e.g. UPDATE pg_catalog.pg_database SET datfrozenxid = … — which safeupdate blocks, so the upgrade fails unless safeupdate is disabled first. These run while the server is in binary-upgrade mode, so skip the check when IsBinaryUpgrade is set. The previous hook is still called (just above), so other extensions keep working during the upgrade.

Verified: a plain PG17→PG18 pg_upgrade that fails with stock safeupdate (UPDATE requires a WHERE clause) completes with this change, safeupdate still enabled.

No automated test — exercising it needs a real pg_upgrade (two clusters), which doesn't fit the pg_tmp harness.

Disclosure: I used an AI assistant to help investigate and draft this; I reproduced and verified it myself.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Comment thread safeupdate.c
#include "nodes/nodeFuncs.h"
#include "parser/analyze.h"
#include "utils/guc.h"
#include "miscadmin.h"

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Move this import below #include "fmgr.h" (run make format to check)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants