How do I grant execute permissions to select client_addr from pg_stat_replication; for a regular PostgreSQL user?
CREATE OR REPLACE FUNCTION client_addr_pg_stat_replication() RETURNS text AS $$
DECLARE ip text;
BEGIN 
select client_addr INTO ip from pg_stat_replication;
RETURN ip;
END;
$$ LANGUAGE plpgsql security definer;


OR

CREATE OR REPLACE FUNCTION client_addr_pg_stat_replication()
RETURNS text AS $x$
BEGIN 
RETURN client_addr from pg_stat_replication;
END;
$x$ LANGUAGE plpgsql security definer;