Re: How to hide stored procedure's bodies from specific user

From: Saimon Lim <aimon(dot)slim(at)gmail(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: How to hide stored procedure's bodies from specific user
Date: 2015-02-13 11:17:11
Message-ID: CAOkVcQ6U96c8NR7Zk76o0ZT9Ai7siBnTOea3jNeeRZvuHwrouw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Thanks for your help

I want to restrict some postgres users as much as possible and allow them
to execute a few my own stored procedures only.

If I block access using:

REVOKE ALL ON pg_catalog.pg_proc FROM PUBLIC;
REVOKE ALL ON FUNCTION pg_catalog.pg_get_functiondef(oid) FROM PUBLIC;

the user will fail to select procedure's body from pg_catalog.pg_proc and
using psql \sf of \ef.
Is this method correct?

2015-02-12 11:53 GMT+03:00 Saimon Lim <aimon(dot)slim(at)gmail(dot)com>:

> For clarification - I run the commands using psql program.
>
> 2015-02-11 12:54 GMT+03:00 Saimon Lim <aimon(dot)slim(at)gmail(dot)com>:
>
>> Hi
>> I want to hide my own stored procedures' bodies from the specific user.
>> As far as I know, procedure's body is visible in the pg_catalog.pg_proc
>> table.
>>
>> So, I did the following:
>> REVOKE ALL ON pg_catalog.pg_proc FROM PUBLIC;
>>
>> And after it, when user tries:
>> SELECT * from pg_proc;
>>
>> The following error occurs:
>> ERROR: permission denied for relation pg_proc
>>
>> It turns out that user don't have access to the body of the procedure.
>> But I still can get stored procedure's body using
>> \sf function_name
>> or with
>> \ef function_name
>>
>> So, how can I completely hide my own stored procedure's bodies from this
>> user?
>>
>> Thanks in advance
>> Saimon
>>
>
>

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Bald, Glenn 2015-02-13 11:49:33 Unknown error while running <> postgresql_installer_dc46cfee2c\getlocales.exe
Previous Message Pavel Stehule 2015-02-13 10:52:39 Re: Initializing JsonbValue from cstring