You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudberry.apache.org by "MisterRaindrop (via GitHub)" <gi...@apache.org> on 2026/10/23 10:41:01 UTC

[PR] pg_dump: stop overriding --function-oids with the namespace policy [cloudberry]

MisterRaindrop opened a new pull request, #2175:
URL: https://github.com/apache/cloudberry/pull/2175

   ### What does this PR do?
   
   `pg_dump --function-oids` has not selected anything. `getFuncs()` called `selectDumpableFunction()` and then `selectDumpableObject()` on the same object, and the second call overwrote the decision with the parent namespace's `dump_contains`. Two consequences:
   
   - With `--relation-oids` (or `-t`) as well, every namespace is `DUMP_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 a `CREATE FUNCTION`.
   - On its own, `--function-oids` dumped 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, as `selectDumpableObject()` did, and assigns `DumpComponents` rather than a bool. With no `--function-oids`, the outcome is the same as before: the namespace's `dump_contains`, with extension members left to their extension.
   
   Split out of #1639 (originally ac20f618cca, by @tuhaihe).
   
   ### Test Plan
   
   Demo cluster (Rocky 8 build image), a database with tables `t`, `u`, functions `f1`, `f2`, `select_one` in `public`, `s2.g`, and a view; `pg_dump` from `main` and from this branch against the same database:
   
   | | `main` | this PR |
   |---|---|---|
   | `--relation-oids t --function-oids f1` | `t` only | `t`, `f1` |
   | `--function-oids f1` | `f1`, `f2`, `s2.g` (+ tables) | `f1` (+ tables) |
   | `--relation-oids 0 --function-oids f1` (minirepro's form) | no function | `f1` |
   | `minirepro -q "SELECT select_one()"` | no `CREATE FUNCTION public.select_one()` | present |
   | `pg_dump -s` and `pg_dumpall -s`, no selection options | | identical to `main`, apart from the random `\restrict` key |
   
   Behave's "Dump database objects of only functions" (`minirepro.feature`) covers this once the suite (#2170) is in.
   
   ### Type of Change
   - [x] Bug fix (non-breaking change)
   
   ### Checklist
   - [x] This PR contains AI-assisted code generation
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudberry.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cloudberry.apache.org
For additional commands, e-mail: commits-help@cloudberry.apache.org