Rename various shared library functions

Some of the more generically named functions are at risk of colliding
with functions defined in other libraries. To mitigate that risk,
prefix with "repmgr_", unless the name already has some reference
to repmgr.

This requires an extension version bump.

RM20471.
This commit is contained in:
Ian Barwick
2021-02-23 10:14:16 +09:00
parent d34b4e71a6
commit dd8204e013
6 changed files with 298 additions and 41 deletions

View File

@@ -88,38 +88,38 @@ void _PG_fini(void);
static void repmgr_shmem_startup(void);
Datum set_local_node_id(PG_FUNCTION_ARGS);
PG_FUNCTION_INFO_V1(set_local_node_id);
Datum repmgr_set_local_node_id(PG_FUNCTION_ARGS);
PG_FUNCTION_INFO_V1(repmgr_set_local_node_id);
Datum get_local_node_id(PG_FUNCTION_ARGS);
PG_FUNCTION_INFO_V1(get_local_node_id);
Datum repmgr_get_local_node_id(PG_FUNCTION_ARGS);
PG_FUNCTION_INFO_V1(repmgr_get_local_node_id);
Datum standby_set_last_updated(PG_FUNCTION_ARGS);
PG_FUNCTION_INFO_V1(standby_set_last_updated);
Datum repmgr_standby_set_last_updated(PG_FUNCTION_ARGS);
PG_FUNCTION_INFO_V1(repmgr_standby_set_last_updated);
Datum standby_get_last_updated(PG_FUNCTION_ARGS);
PG_FUNCTION_INFO_V1(standby_get_last_updated);
Datum repmgr_standby_get_last_updated(PG_FUNCTION_ARGS);
PG_FUNCTION_INFO_V1(repmgr_standby_get_last_updated);
Datum set_upstream_last_seen(PG_FUNCTION_ARGS);
PG_FUNCTION_INFO_V1(set_upstream_last_seen);
Datum repmgr_set_upstream_last_seen(PG_FUNCTION_ARGS);
PG_FUNCTION_INFO_V1(repmgr_set_upstream_last_seen);
Datum get_upstream_last_seen(PG_FUNCTION_ARGS);
PG_FUNCTION_INFO_V1(get_upstream_last_seen);
Datum repmgr_get_upstream_last_seen(PG_FUNCTION_ARGS);
PG_FUNCTION_INFO_V1(repmgr_get_upstream_last_seen);
Datum get_upstream_node_id(PG_FUNCTION_ARGS);
PG_FUNCTION_INFO_V1(get_upstream_node_id);
Datum repmgr_get_upstream_node_id(PG_FUNCTION_ARGS);
PG_FUNCTION_INFO_V1(repmgr_get_upstream_node_id);
Datum set_upstream_node_id(PG_FUNCTION_ARGS);
PG_FUNCTION_INFO_V1(set_upstream_node_id);
Datum repmgr_set_upstream_node_id(PG_FUNCTION_ARGS);
PG_FUNCTION_INFO_V1(repmgr_set_upstream_node_id);
Datum notify_follow_primary(PG_FUNCTION_ARGS);
PG_FUNCTION_INFO_V1(notify_follow_primary);
Datum repmgr_notify_follow_primary(PG_FUNCTION_ARGS);
PG_FUNCTION_INFO_V1(repmgr_notify_follow_primary);
Datum get_new_primary(PG_FUNCTION_ARGS);
PG_FUNCTION_INFO_V1(get_new_primary);
Datum repmgr_get_new_primary(PG_FUNCTION_ARGS);
PG_FUNCTION_INFO_V1(repmgr_get_new_primary);
Datum reset_voting_status(PG_FUNCTION_ARGS);
PG_FUNCTION_INFO_V1(reset_voting_status);
Datum repmgr_reset_voting_status(PG_FUNCTION_ARGS);
PG_FUNCTION_INFO_V1(repmgr_reset_voting_status);
Datum set_repmgrd_pid(PG_FUNCTION_ARGS);
PG_FUNCTION_INFO_V1(set_repmgrd_pid);
@@ -139,8 +139,8 @@ PG_FUNCTION_INFO_V1(repmgrd_pause);
Datum repmgrd_is_paused(PG_FUNCTION_ARGS);
PG_FUNCTION_INFO_V1(repmgrd_is_paused);
Datum get_wal_receiver_pid(PG_FUNCTION_ARGS);
PG_FUNCTION_INFO_V1(get_wal_receiver_pid);
Datum repmgr_get_wal_receiver_pid(PG_FUNCTION_ARGS);
PG_FUNCTION_INFO_V1(repmgr_get_wal_receiver_pid);
/*
@@ -233,7 +233,7 @@ repmgr_shmem_startup(void)
/* ==================== */
Datum
set_local_node_id(PG_FUNCTION_ARGS)
repmgr_set_local_node_id(PG_FUNCTION_ARGS)
{
int local_node_id = UNKNOWN_NODE_ID;
int stored_node_id = UNKNOWN_NODE_ID;
@@ -303,7 +303,7 @@ set_local_node_id(PG_FUNCTION_ARGS)
Datum
get_local_node_id(PG_FUNCTION_ARGS)
repmgr_get_local_node_id(PG_FUNCTION_ARGS)
{
int local_node_id = UNKNOWN_NODE_ID;
@@ -320,7 +320,7 @@ get_local_node_id(PG_FUNCTION_ARGS)
/* update and return last updated with current timestamp */
Datum
standby_set_last_updated(PG_FUNCTION_ARGS)
repmgr_standby_set_last_updated(PG_FUNCTION_ARGS)
{
TimestampTz last_updated = GetCurrentTimestamp();
@@ -337,7 +337,7 @@ standby_set_last_updated(PG_FUNCTION_ARGS)
/* get last updated timestamp */
Datum
standby_get_last_updated(PG_FUNCTION_ARGS)
repmgr_standby_get_last_updated(PG_FUNCTION_ARGS)
{
TimestampTz last_updated;
@@ -354,7 +354,7 @@ standby_get_last_updated(PG_FUNCTION_ARGS)
Datum
set_upstream_last_seen(PG_FUNCTION_ARGS)
repmgr_set_upstream_last_seen(PG_FUNCTION_ARGS)
{
int upstream_node_id = UNKNOWN_NODE_ID;
@@ -377,7 +377,7 @@ set_upstream_last_seen(PG_FUNCTION_ARGS)
Datum
get_upstream_last_seen(PG_FUNCTION_ARGS)
repmgr_get_upstream_last_seen(PG_FUNCTION_ARGS)
{
long secs;
int microsecs;
@@ -411,7 +411,7 @@ get_upstream_last_seen(PG_FUNCTION_ARGS)
Datum
get_upstream_node_id(PG_FUNCTION_ARGS)
repmgr_get_upstream_node_id(PG_FUNCTION_ARGS)
{
int upstream_node_id = UNKNOWN_NODE_ID;
@@ -426,7 +426,7 @@ get_upstream_node_id(PG_FUNCTION_ARGS)
}
Datum
set_upstream_node_id(PG_FUNCTION_ARGS)
repmgr_set_upstream_node_id(PG_FUNCTION_ARGS)
{
int upstream_node_id = UNKNOWN_NODE_ID;
int local_node_id = UNKNOWN_NODE_ID;
@@ -462,7 +462,7 @@ set_upstream_node_id(PG_FUNCTION_ARGS)
Datum
notify_follow_primary(PG_FUNCTION_ARGS)
repmgr_notify_follow_primary(PG_FUNCTION_ARGS)
{
int primary_node_id = UNKNOWN_NODE_ID;
@@ -505,7 +505,7 @@ notify_follow_primary(PG_FUNCTION_ARGS)
Datum
get_new_primary(PG_FUNCTION_ARGS)
repmgr_get_new_primary(PG_FUNCTION_ARGS)
{
int new_primary_node_id = UNKNOWN_NODE_ID;
@@ -527,7 +527,7 @@ get_new_primary(PG_FUNCTION_ARGS)
Datum
reset_voting_status(PG_FUNCTION_ARGS)
repmgr_reset_voting_status(PG_FUNCTION_ARGS)
{
if (!shared_state)
PG_RETURN_NULL();
@@ -735,7 +735,7 @@ repmgrd_is_paused(PG_FUNCTION_ARGS)
Datum
get_wal_receiver_pid(PG_FUNCTION_ARGS)
repmgr_get_wal_receiver_pid(PG_FUNCTION_ARGS)
{
int wal_receiver_pid;