From 94bc5bdf802e792024dc08e1df2be62ecf4f42ce Mon Sep 17 00:00:00 2001 From: Ian Barwick Date: Mon, 9 Feb 2015 18:31:18 +0900 Subject: [PATCH] Remove unneeded function --- repmgr.c | 16 ---------------- sql/repmgr_funcs.c | 18 +----------------- sql/repmgr_funcs.sql.in | 4 ---- 3 files changed, 1 insertion(+), 37 deletions(-) diff --git a/repmgr.c b/repmgr.c index de3fd671..b09ddd1d 100644 --- a/repmgr.c +++ b/repmgr.c @@ -2312,22 +2312,6 @@ create_schema(PGconn *conn) } PQclear(res); - // ZZZ no longer needed - sqlquery_snprintf(sqlquery, - "CREATE OR REPLACE FUNCTION %s.repmgr_get_primary_conninfo() " - " RETURNS text " - " AS '$libdir/repmgr_funcs', 'repmgr_get_primary_conninfo' " - " LANGUAGE C STRICT ", - get_repmgr_schema_quoted(conn)); - - res = PQexec(conn, sqlquery); - if (!res || PQresultStatus(res) != PGRES_COMMAND_OK) - { - fprintf(stderr, "Cannot create the function repmgr_get_primary_conninfo: %s\n", - PQerrorMessage(conn)); - return false; - } - PQclear(res); return true; } diff --git a/sql/repmgr_funcs.c b/sql/repmgr_funcs.c index 3c41ae91..7ac1230d 100644 --- a/sql/repmgr_funcs.c +++ b/sql/repmgr_funcs.c @@ -58,8 +58,7 @@ Datum repmgr_get_last_updated(PG_FUNCTION_ARGS); PG_FUNCTION_INFO_V1(repmgr_update_last_updated); PG_FUNCTION_INFO_V1(repmgr_get_last_updated); -Datum repmgr_get_primary_conninfo(PG_FUNCTION_ARGS); -PG_FUNCTION_INFO_V1(repmgr_get_primary_conninfo); + /* * Module load callback @@ -235,18 +234,3 @@ repmgr_get_last_updated(PG_FUNCTION_ARGS) } -/* - * get the `primary_conninfo` string used by walreceiver, - * which is the value parsed from recovery.conf at startup - * - * XXX is there a better way of doing this? - */ -Datum -repmgr_get_primary_conninfo(PG_FUNCTION_ARGS) -{ - /* use volatile pointer to prevent code rearrangement */ - volatile WalRcvData *walrcv = WalRcv; - - PG_RETURN_TEXT_P(cstring_to_text((const char *)walrcv->conninfo)); -} - diff --git a/sql/repmgr_funcs.sql.in b/sql/repmgr_funcs.sql.in index 658bd540..864c1c98 100644 --- a/sql/repmgr_funcs.sql.in +++ b/sql/repmgr_funcs.sql.in @@ -21,7 +21,3 @@ LANGUAGE C STRICT; CREATE FUNCTION repmgr_get_last_updated() RETURNS TIMESTAMP WITH TIME ZONE AS 'MODULE_PATHNAME', 'repmgr_get_last_updated' LANGUAGE C STRICT; - -CREATE FUNCTION repmgr_get_primary_conninfo() RETURNS TEXT -AS 'MODULE_PATHNAME', 'repmgr_get_primary_conninfo' -LANGUAGE C STRICT;