Re: make MaxBackends available in _PG_init
Tom Lane <tgl@sss.pgh.pa.us>
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Robert Haas <robertmhaas@gmail.com>
Cc: Nathan Bossart <nathandbossart@gmail.com>,
Julien Rouhaud <rjuju123@gmail.com>,
Andres Freund <andres@anarazel.de>,
Michael Paquier <michael@paquier.xyz>,
"Bossart,
Nathan" <bossartn@amazon.com>,
Fujii Masao <masao.fujii@oss.nttdata.com>,
"wangsh.fnst@fujitsu.com" <wangsh.fnst@fujitsu.com>,
Bharath Rupireddy <bharath.rupireddyforpostgres@gmail.com>,
Greg Sabino Mullane <htamfids@gmail.com>,
"pgsql-hackers@lists.postgresql.org"
<pgsql-hackers@lists.postgresql.org>
Date: 2022-05-06T14:43:21Z
Lists: pgsql-hackers
Robert Haas <robertmhaas@gmail.com> writes: > On Fri, May 6, 2022 at 9:57 AM Tom Lane <tgl@sss.pgh.pa.us> wrote: >> I agree that _PG_fini functions as they stand are worthless. >> What I'm not getting is why we should care enough about that >> to break just about everybody's extension. Even if unloading >> extensions were feasible, who would bother? > Well, if we think that, then we ought to remove the NOT_USED code and > all the random _PG_fini() stuff that's still floating around. I think that's exactly what we should do, if it bugs you that stuff is just sitting there. I see no prospect that we'll ever make it work, because the question of unhooking from hooks is just the tip of the iceberg. As an example, what should happen with any custom GUCs the module has defined? Dropping their values might not be very nice, but if we leave them around then the next LOAD (if any) will see a conflict. Another fun question is whether it's ever safe to unload a module that was preloaded by the postmaster. In short, this seems like a can of very wriggly worms, with not a lot of benefit that would ensue from opening it. regards, tom lane
Commits
-
Add a new shmem_request_hook hook.
- 4f2400cb3f10 15.0 landed
-
Remove non-functional code for unloading loadable modules.
- ab02d702ef08 15.0 landed
-
Fix misleading comments about background worker registration.
- 701d918a426b 15.0 landed
-
Revert the addition of GetMaxBackends() and related stuff.
- 7fc0e7de9fb8 15.0 landed
-
Fix typo in multixact.c
- 0147fc7c8c92 15.0 landed
-
Reduce more the number of calls to GetMaxBackends()
- 4567596316d1 15.0 landed
-
Remove MaxBackends variable in favor of GetMaxBackends() function.
- aa64f23b0292 15.0 landed
-
Fix comments about bgworker registration before MaxBackends initialization
- 5ecd0183fb6a 15.0 landed
-
Fix bogus assertion in BootstrapModeMain().
- e12694523e7e 15.0 cited
-
Make sure MaxBackends is always set
- dfbba2c86cc8 9.3.0 cited