Mahendra Singh Thalor <mahi6...@gmail.com> writes: > While doing some code changes with pg_dumpall and pg_rsetore[1], we noticed > that on_exit_nicely_list array has only fixed slots (MAX_ON_EXIT_NICELY=20) > but in some cases, we need more slots for pg_restore.
> *Ex: restore more than 20 databases by single pg_restore command.* > We are working on a patch[1] which dumps all the databases in non-text mode > by pg_dumpall and then we are restoring those dumps by pg_restore. So we > need more slots due to multiple databases. I can't help thinking that this means you're doing it wrong. That on_exit infrastructure is quite rickety --- see the comments for exit_nicely() itself --- so I don't think I trust the idea of dynamically adding callbacks. In the present usage there is actually only *one* callback and it's registered very near the start of either pg_dump or pg_restore. That avoids the platform-dependent hazards mentioned in the comment, but adding more callbacks later might not. I think you'd be better off tracking the cleanup work you have to do in some other place. regards, tom lane