mirror of
https://github.com/postgres/postgres.git
synced 2025-07-03 20:02:46 +03:00
Rethink the way walreceiver is linked into the backend. Instead than shoving
walreceiver as whole into a dynamically loaded module, split the libpq-specific parts of it into dynamically loaded module and keep the rest in the main backend binary. Although Tom fixed the Windows compilation problems with the old walreceiver module already, this is a cleaner division of labour and makes the code more readable. There's also the prospect of adding new transport methods as pluggable modules in the future, which this patch makes easier, though for now the API between libpqwalreceiver and walreceiver process should be considered private. The libpq-specific module is now in src/backend/replication/libpqwalreceiver, and the part linked with postgres binary is in src/backend/replication/walreceiver.c.
This commit is contained in:
@ -8,7 +8,7 @@
|
||||
* Portions Copyright (c) 1994, Regents of the University of California
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $PostgreSQL: pgsql/src/backend/bootstrap/bootstrap.c,v 1.256 2010/01/15 09:19:00 heikki Exp $
|
||||
* $PostgreSQL: pgsql/src/backend/bootstrap/bootstrap.c,v 1.257 2010/01/20 09:16:23 heikki Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@ -425,20 +425,7 @@ AuxiliaryProcessMain(int argc, char *argv[])
|
||||
|
||||
case WalReceiverProcess:
|
||||
/* don't set signals, walreceiver has its own agenda */
|
||||
{
|
||||
PGFunction WalReceiverMain;
|
||||
|
||||
/*
|
||||
* Walreceiver is not linked directly into the server
|
||||
* binary because we would then need to link the server
|
||||
* with libpq. It's compiled as a dynamically loaded module
|
||||
* to avoid that.
|
||||
*/
|
||||
WalReceiverMain = load_external_function("walreceiver",
|
||||
"WalReceiverMain",
|
||||
true, NULL);
|
||||
WalReceiverMain(NULL);
|
||||
}
|
||||
WalReceiverMain();
|
||||
proc_exit(1); /* should never return */
|
||||
|
||||
default:
|
||||
|
Reference in New Issue
Block a user