Database : Postgres 9.6
Use case : I have a function that needs to be hidden, only a particular role/user can see it. I don't even want to expose even the name or body of function to other users/roles.
For example if I have a user named
test1 then he should not have any knowledge of existence of function called
top_secret_function_1 (not via PgAdmin not via any other command.)
Only the the users/roles that I want to see this function should see this function.
Importance : This function executes some important logic which I don't want to expose but still I need to give some other database access rights to some other users.
Klin suggested use of pg_temp but its does not seems effective but his suggestion triggered a idea of using different schema and then restrict the users/roles to schema.
when i reconnect the database the secret function is no longer valid in pg_temp ! I cannot use pg_temp as suggested because then I will have to define function in each users pg_temp schema when he connects