diff --git a/src/bin/pg_dump/pg_dump_sort.c b/src/bin/pg_dump/pg_dump_sort.c index 36de6b62573..dc35a937275 100644 --- a/src/bin/pg_dump/pg_dump_sort.c +++ b/src/bin/pg_dump/pg_dump_sort.c @@ -848,9 +848,14 @@ repairTypeFuncLoop(DumpableObject *typeobj, DumpableObject *funcobj) if (typeInfo->shellType) { addObjectDependency(funcobj, typeInfo->shellType->dobj.dumpId); - /* Mark shell type as to be dumped if any such function is */ + /* + * Mark shell type (always including the definition, as we need + * the shell type defined to identify the function fully) as to be + * dumped if any such function is + */ if (funcobj->dump) - typeInfo->shellType->dobj.dump = true; + typeInfo->shellType->dobj.dump = funcobj->dump | + DUMP_COMPONENT_DEFINITION; } }