Hi,
(refer file src/bin/pg_dump/pg_backup_utils.c)

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.

Apart from the attached patch solution, we thought of some more solutions.
*Solution 1*: reset array index with each database restore, but this might
break some other things.
*Solution 2:* for each database, we can keep the index of the
on_exit_nicely_list array and after restoring a particular database we can
reset the index to old value but this looks like a hack.

Here, I am proposing a patch which will dynamically enlarge the
on_exit_nicely_list array by doubling the previous size.

Thoughts?

[1] : pg_dumpall with non-text mode
<https://www.postgresql.org/message-id/flat/cb103623-8ee6-4ba5-a2c9-f32e3a4933fa%40dunslane.net>
[2]: problem of on_exit_nicely_list array
<202503051512.tr7vcirldfns@alvherre.pgsql>
-- 
Thanks and Regards
Mahendra Singh Thalor
EnterpriseDB: http://www.enterprisedb.com

Attachment: v01-enlarge-on_exit_nicely_list-array-whenever-no-slot.patch
Description: Binary data

Reply via email to