Remove _PG_fini()

ab02d702ef has removed from the backend the code able to support the
unloading of modules, because this has never worked.  This removes the
last references to _PG_fini(), that could be used as a callback for
modules to manipulate the stack when unloading a library.

The test module ldap_password_func had the idea to declare it, doing
nothing.  The function declaration in fmgr.h is gone.

It was left around in 2022 to avoid breaking extension code, but at this
stage there are also benefits in letting extension developers know that
keeping the unloading code is pointless and this move leads to less
maintenance.

Reviewed-by: Tom Lane, Heikki Linnakangas
Discussion: https://postgr.es/m/ZsQfi0AUJoMF6NSd@paquier.xyz
This commit is contained in:
Michael Paquier 2024-08-21 07:24:03 +09:00
parent 678a8358d1
commit 15c1abd977
2 changed files with 5 additions and 13 deletions

View File

@ -425,14 +425,13 @@ extern int no_such_variable
/*
* Declare _PG_init/_PG_fini centrally. Historically each shared library had
* its own declaration; but now that we want to mark these PGDLLEXPORT, using
* central declarations avoids each extension having to add that. Any
* existing declarations in extensions will continue to work if fmgr.h is
* included before them, otherwise compilation for Windows will fail.
* Declare _PG_init centrally. Historically each shared library had its own
* declaration; but now that we want to mark these PGDLLEXPORT, using central
* declarations avoids each extension having to add that. Any existing
* declarations in extensions will continue to work if fmgr.h is included
* before them, otherwise compilation for Windows will fail.
*/
extern PGDLLEXPORT void _PG_init(void);
extern PGDLLEXPORT void _PG_fini(void);
/*-------------------------------------------------------------------------

View File

@ -23,7 +23,6 @@
PG_MODULE_MAGIC;
void _PG_init(void);
void _PG_fini(void);
/* hook function */
static char *rot13_passphrase(char *password);
@ -37,12 +36,6 @@ _PG_init(void)
ldap_password_hook = rot13_passphrase;
}
void
_PG_fini(void)
{
/* do nothing yet */
}
static char *
rot13_passphrase(char *pw)
{