Repository navigation
pg_dump: stop overriding --function-oids with the namespace policy - #2175
Open
MisterRaindrop wants to merge 1 commit into
Open
MisterRaindrop wants to merge 1 commit into
MisterRaindrop wants to merge 1 commit into
Conversation
getFuncs() called selectDumpableFunction() and then immediately called selectDumpableObject() on the same object, which overwrites dobj->dump with the parent namespace's dump_contains. --relation-oids sets every namespace to DUMP_COMPONENT_NONE (see selectDumpableNamespace), so a function named by --function-oids was dropped from the dump whenever --relation-oids was also given -- which is how minirepro always calls pg_dump: pg_dump -sxO db --relation-oids 0 --function-oids 17021 emitted no CREATE FUNCTION at all. Drop the second call and let selectDumpableFunction() decide, as Greenplum does. It now takes the archive so it can still give extension membership the last word, and assigns DumpComponents bitmasks rather than a bool. Exercised by minirepro.feature:282. Split out of apache#1639 (originally ac20f61).
MisterRaindrop
added a commit
to MisterRaindrop/cloudberry
that referenced
this pull request
Oct 23, 2026
The suite comes from apache#1639, where it ran with that PR's fixes. Here it runs without them, and these scenarios fail until they land. Tag them @needs_fix and skip that tag in every job; each fix removes the tag from the scenarios it makes pass, which is also how it shows they do. A comment beside each tag names the fix. analyzedb 1 0977ac5 (identifiers and pg.escape_string) gpactivatestandby 1 apache#1889 (forced activation after a clean shutdown) gpaddmirrors 2 mirror postgresql.conf check; not pinned down yet, among b971d48, a3bfe47 and 8377856 gpcheckcat 11 0bfc1d7 gpinitstandby 2 apache#2172 (pg_basebackup EXCLUDE); without it the new standby promotes itself gpinitsystem 19 b971d48 gpmovemirrors 4 a3bfe47, 51955ac, 7056e02 (one of them a Scenario Outline with four examples) gpstop 2 45a1155, 51955ac (the gpstop lock) minirepro 3 3fccb75 (tables a view reads), 51955ac, apache#2175 (pg_dump --function-oids) The commit hashes are those in apache#1639. gprecoverseg is tagged as a whole: without its fixes a scenario hangs and the job reaches its 120 minute timeout, so the scenarios that do fail cannot be told apart from the ones never reached. It comes back as the gprecoverseg fixes land.
2 tasks done
Alena0704
self-requested a review
October 24, 2026 17:52
2 of 6 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
pg_dump --function-oidshas not selected anything.getFuncs()calledselectDumpableFunction()and thenselectDumpableObject()on the same object, and the second call overwrote the decision with the parent namespace'sdump_contains. Two consequences:--relation-oids(or-t) as well, every namespace isDUMP_COMPONENT_NONE(selectDumpableNamespace()), so the requested functions were dropped. That is how minirepro calls pg_dump (pg_dump -sxO db --relation-oids ... --function-oids ...), so minirepro never emitted aCREATE FUNCTION.--function-oidsdumped every function in a dumpable namespace, so the list had no effect.The second call is gone and
selectDumpableFunction()decides alone, as in Greenplum. It now checks extension membership first, asselectDumpableObject()did, and assignsDumpComponentsrather than a bool. With no--function-oids, the outcome is the same as before: the namespace'sdump_contains, with extension members left to their extension.Split out of #1639 (originally ac20f61, by @tuhaihe).
Test Plan
Demo cluster (Rocky 8 build image), a database with tables
t,u, functionsf1,f2,select_oneinpublic,s2.g, and a view;pg_dumpfrommainand from this branch against the same database:main--relation-oids t --function-oids f1tonlyt,f1--function-oids f1f1,f2,s2.g(+ tables)f1(+ tables)--relation-oids 0 --function-oids f1(minirepro's form)f1minirepro -q "SELECT select_one()"CREATE FUNCTION public.select_one()pg_dump -sandpg_dumpall -s, no selection optionsmain, apart from the random\restrictkeyBehave's "Dump database objects of only functions" (
minirepro.feature) covers this once the suite (#2170) is in.Type of Change
Checklist