Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 15c1abd

Browse files
committed
Remove _PG_fini()
ab02d70 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
1 parent 678a835 commit 15c1abd

File tree

2 files changed

+5
-13
lines changed

2 files changed

+5
-13
lines changed

src/include/fmgr.h

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -425,14 +425,13 @@ extern int no_such_variable
425425

426426

427427
/*
428-
* Declare _PG_init/_PG_fini centrally. Historically each shared library had
429-
* its own declaration; but now that we want to mark these PGDLLEXPORT, using
430-
* central declarations avoids each extension having to add that. Any
431-
* existing declarations in extensions will continue to work if fmgr.h is
432-
* included before them, otherwise compilation for Windows will fail.
428+
* Declare _PG_init centrally. Historically each shared library had its own
429+
* declaration; but now that we want to mark these PGDLLEXPORT, using central
430+
* declarations avoids each extension having to add that. Any existing
431+
* declarations in extensions will continue to work if fmgr.h is included
432+
* before them, otherwise compilation for Windows will fail.
433433
*/
434434
extern PGDLLEXPORT void _PG_init(void);
435-
extern PGDLLEXPORT void _PG_fini(void);
436435

437436

438437
/*-------------------------------------------------------------------------

src/test/modules/ldap_password_func/ldap_password_func.c

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323
PG_MODULE_MAGIC;
2424

2525
void _PG_init(void);
26-
void _PG_fini(void);
2726

2827
/* hook function */
2928
static char *rot13_passphrase(char *password);
@@ -37,12 +36,6 @@ _PG_init(void)
3736
ldap_password_hook = rot13_passphrase;
3837
}
3938

40-
void
41-
_PG_fini(void)
42-
{
43-
/* do nothing yet */
44-
}
45-
4639
static char *
4740
rot13_passphrase(char *pw)
4841
{

0 commit comments

Comments
 (0)