Skip to content

Commit

Permalink
Merge pull request #331 from ibrarahmad/PGSM-518
Browse files Browse the repository at this point in the history
PG-518: Internal Functions should NOT be visible in PGSM API.
  • Loading branch information
Naeem-Akhter authored Dec 12, 2022
2 parents 913064b + 5ae0f3a commit 2838eaa
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 0 deletions.
7 changes: 7 additions & 0 deletions pg_stat_monitor--1.0--2.0.sql
Original file line number Diff line number Diff line change
Expand Up @@ -369,11 +369,18 @@ $$
$$ LANGUAGE plpgsql;

SELECT pgsm_create_view();

REVOKE ALL ON FUNCTION range FROM PUBLIC;
REVOKE ALL ON FUNCTION get_cmd_type FROM PUBLIC;
REVOKE ALL ON FUNCTION pg_stat_monitor_settings FROM PUBLIC;
REVOKE ALL ON FUNCTION decode_error_level FROM PUBLIC;
REVOKE ALL ON FUNCTION pg_stat_monitor_internal FROM PUBLIC;
REVOKE ALL ON FUNCTION get_histogram_timings FROM PUBLIC;
REVOKE ALL ON FUNCTION pgsm_create_view FROM PUBLIC;
REVOKE ALL ON FUNCTION pgsm_create_11_view FROM PUBLIC;
REVOKE ALL ON FUNCTION pgsm_create_13_view FROM PUBLIC;
REVOKE ALL ON FUNCTION pgsm_create_14_view FROM PUBLIC;
REVOKE ALL ON FUNCTION pgsm_create_15_view FROM PUBLIC;

GRANT SELECT ON pg_stat_monitor TO PUBLIC;

6 changes: 6 additions & 0 deletions pg_stat_monitor--1.0.sql
Original file line number Diff line number Diff line change
Expand Up @@ -397,6 +397,12 @@ REVOKE ALL ON FUNCTION get_cmd_type FROM PUBLIC;
REVOKE ALL ON FUNCTION pg_stat_monitor_settings FROM PUBLIC;
REVOKE ALL ON FUNCTION decode_error_level FROM PUBLIC;
REVOKE ALL ON FUNCTION pg_stat_monitor_internal FROM PUBLIC;
REVOKE ALL ON FUNCTION get_histogram_timings FROM PUBLIC;
REVOKE ALL ON FUNCTION pgsm_create_view FROM PUBLIC;
REVOKE ALL ON FUNCTION pgsm_create_11_view FROM PUBLIC;
REVOKE ALL ON FUNCTION pgsm_create_13_view FROM PUBLIC;
REVOKE ALL ON FUNCTION pgsm_create_14_view FROM PUBLIC;
REVOKE ALL ON FUNCTION pgsm_create_15_view FROM PUBLIC;

GRANT SELECT ON pg_stat_monitor TO PUBLIC;

6 changes: 6 additions & 0 deletions pg_stat_monitor--2.0.sql
Original file line number Diff line number Diff line change
Expand Up @@ -471,6 +471,12 @@ REVOKE ALL ON FUNCTION get_cmd_type FROM PUBLIC;
REVOKE ALL ON FUNCTION pg_stat_monitor_settings FROM PUBLIC;
REVOKE ALL ON FUNCTION decode_error_level FROM PUBLIC;
REVOKE ALL ON FUNCTION pg_stat_monitor_internal FROM PUBLIC;
REVOKE ALL ON FUNCTION get_histogram_timings FROM PUBLIC;
REVOKE ALL ON FUNCTION pgsm_create_view FROM PUBLIC;
REVOKE ALL ON FUNCTION pgsm_create_11_view FROM PUBLIC;
REVOKE ALL ON FUNCTION pgsm_create_13_view FROM PUBLIC;
REVOKE ALL ON FUNCTION pgsm_create_14_view FROM PUBLIC;
REVOKE ALL ON FUNCTION pgsm_create_15_view FROM PUBLIC;

GRANT SELECT ON pg_stat_monitor TO PUBLIC;

0 comments on commit 2838eaa

Please sign in to comment.