Re: change on_exit_nicely_list array to the dynamic array to increase slots at run time for pg_restore - Mailing list pgsql-hackers

From Tom Lane
Subject Re: change on_exit_nicely_list array to the dynamic array to increase slots at run time for pg_restore
Date
Msg-id 749623.1741614188@sss.pgh.pa.us
Whole thread Raw
In response to change on_exit_nicely_list array to the dynamic array to increase slots at run time for pg_restore  (Mahendra Singh Thalor <mahi6run@gmail.com>)
List pgsql-hackers
Mahendra Singh Thalor <mahi6run@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



pgsql-hackers by date:

Previous
From: Kirill Reshke
Date:
Subject: Re: Vacuum statistics
Next
From: Kirill Reshke
Date:
Subject: Re: FSM doesn't recover after zeroing damaged page.