1
0
mirror of https://github.com/postgres/postgres.git synced 2025-08-30 06:01:21 +03:00

Expose PQbackendPID() through walreceiver API

This will be used by a subsequent patch.

Reviewed-by: Masahiko Sawada <masahiko.sawada@2ndquadrant.com>
Discussion: https://www.postgresql.org/message-id/CA%2Bfd4k4dM0iEPLxyVyme2RAFsn8SUgrNtBJOu81YqTY4V%2BnqZA%40mail.gmail.com
This commit is contained in:
Peter Eisentraut
2020-01-14 14:05:25 +01:00
parent f595117e24
commit ee4ac46c8e
2 changed files with 15 additions and 0 deletions

View File

@@ -74,6 +74,7 @@ static char *libpqrcv_create_slot(WalReceiverConn *conn,
bool temporary,
CRSSnapshotAction snapshot_action,
XLogRecPtr *lsn);
static pid_t libpqrcv_get_backend_pid(WalReceiverConn *conn);
static WalRcvExecResult *libpqrcv_exec(WalReceiverConn *conn,
const char *query,
const int nRetTypes,
@@ -93,6 +94,7 @@ static WalReceiverFunctionsType PQWalReceiverFunctions = {
libpqrcv_receive,
libpqrcv_send,
libpqrcv_create_slot,
libpqrcv_get_backend_pid,
libpqrcv_exec,
libpqrcv_disconnect
};
@@ -858,6 +860,15 @@ libpqrcv_create_slot(WalReceiverConn *conn, const char *slotname,
return snapshot;
}
/*
* Return PID of remote backend process.
*/
static pid_t
libpqrcv_get_backend_pid(WalReceiverConn *conn)
{
return PQbackendPID(conn->streamConn);
}
/*
* Convert tuple query result to tuplestore.
*/