create user backup;
create user test;

GRANT USAGE ON SCHEMA pg_catalog TO backup;
GRANT USAGE ON SCHEMA pg_catalog TO test;

REVOKE EXECUTE ON FUNCTION pg_switch_xlog() FROM backup;
REVOKE ALL ON FUNCTION pg_switch_xlog() FROM test;

grant all on table pg_subscription to backup;
revoke insert on table pg_subscription from backup;

revoke all on table pg_subscription from test;
grant select on table pg_subscription to test;

grant all on pg_stat_subscription to backup;
revoke all on pg_stat_subscription from test;

grant all on function pg_stat_get_subscription() to backup;
revoke all on function pg_stat_get_subscription() from test;
