Re: viewing source code - Mailing list pgsql-performance

From Alvaro Herrera
Subject Re: viewing source code
Date
Msg-id 20071218185223.GD8088@alvh.no-ip.org
Whole thread Raw
In response to Re: viewing source code  ("Roberts, Jon" <Jon.Roberts@asurion.com>)
List pgsql-performance
Roberts, Jon escribió:
> So you are saying I need to create a view per user to achieve this?  That
> isn't practical for an enterprise level database.

No -- that would be quite impractical indeed.  I'm talking about
something like

revoke all privileges on pg_proc from public;
create view limited_pg_proc
as select * from pg_proc
where proowner = (select oid from pg_authid where rolname = current_user);
grant select on limited_pg_proc to public;

Of course, it is only a rough sketch.  It needs to be improved in a
number of ways.  But it shows that even with pure SQL the solution is
not far; with backend changes it is certainly doable (for example invent
a separate "view source" privilege for functions).

--
Alvaro Herrera                                http://www.CommandPrompt.com/
The PostgreSQL Company - Command Prompt, Inc.

pgsql-performance by date:

Previous
From: "Joshua D. Drake"
Date:
Subject: Re: viewing source code
Next
From: Paul Lambert
Date:
Subject: Optimising a query