Re: [HACKERS] SuperUser check in pg_stat_statements

2015-10-20 Thread Lukas Fittl
Rajan, I'll reply off-list since this isn't the right discussion for -hackers. Best, Lukas On Tue, Oct 20, 2015 at 7:02 AM, rajan wrote: > Hey Lukas, > > Thanks. Able to see the queries from all users. Can you explain the > monitoring.get_stat_statements()? > > > > -- > View this message in co

Re: [HACKERS] SuperUser check in pg_stat_statements

2015-10-20 Thread rajan
Hey Lukas, Thanks. Able to see the queries from all users. Can you explain the monitoring.get_stat_statements()? -- View this message in context: http://postgresql.nabble.com/SuperUser-check-in-pg-stat-statements-tp5870589p5870733.html Sent from the PostgreSQL - hackers mailing list archive at

Re: [HACKERS] SuperUser check in pg_stat_statements

2015-10-20 Thread Feike Steenbergen
You can create a Security Definer Funtion which can then be executed by then non-superuser monitoring role: (Assuming you have a role monitoring and pg_stat_statements is installed in schema public) -- connected as a superuser CREATE FUNCTION pg_stat_statements() RETURNS SETOF pg_stat

Re: [HACKERS] SuperUser check in pg_stat_statements

2015-10-19 Thread rajan
Jim, I already tried to create a view upon the pg_stat_statements, but no luck. -- View this message in context: http://postgresql.nabble.com/SuperUser-check-in-pg-stat-statements-tp5870589p5870683.html Sent from the PostgreSQL - hackers mailing list archive at Nabble.com. -- Sent via pgsql

Re: [HACKERS] SuperUser check in pg_stat_statements

2015-10-19 Thread Lukas Fittl
On Mon, Oct 19, 2015 at 3:12 PM, Jim Nasby wrote: > On 10/19/15 3:48 PM, rajan wrote: > >> Thanks Stephen and Shulgin for your response. >> >> Will go through the patch and will try to solve my problem using that. >> >> My scenario is that i need to have an user who cannot be a super user but >>

Re: [HACKERS] SuperUser check in pg_stat_statements

2015-10-19 Thread Jim Nasby
On 10/19/15 3:48 PM, rajan wrote: Thanks Stephen and Shulgin for your response. Will go through the patch and will try to solve my problem using that. My scenario is that i need to have an user who cannot be a super user but a monitor user, who will be able to see all the queries executed by al

Re: [HACKERS] SuperUser check in pg_stat_statements

2015-10-19 Thread rajan
Thanks Stephen and Shulgin for your response. Will go through the patch and will try to solve my problem using that. My scenario is that i need to have an user who cannot be a super user but a monitor user, who will be able to see all the queries executed by all users. -- View this message in

Re: [HACKERS] SuperUser check in pg_stat_statements

2015-10-19 Thread Stephen Frost
Rajan, * rajan (vgmon...@gmail.com) wrote: > When monitoring using pg_stat_satements I see that postgres by default > conceals queries executed by other users from the user who is selecting the > pg_stat_statements view. > > I have edited the pg_stat_statements.c by disabling the superuser check

Re: [HACKERS] SuperUser check in pg_stat_statements

2015-10-19 Thread Shulgin, Oleksandr
On Mon, Oct 19, 2015 at 5:15 PM, rajan wrote: > Hello, > > When monitoring using pg_stat_satements I see that postgres by default > conceals queries executed by other users from the user who is selecting the > pg_stat_statements view. > > I have edited the pg_stat_statements.c by disabling the su

[HACKERS] SuperUser check in pg_stat_statements

2015-10-19 Thread rajan
Hello, When monitoring using pg_stat_satements I see that postgres by default conceals queries executed by other users from the user who is selecting the pg_stat_statements view. I have edited the pg_stat_statements.c by disabling the superuser check function so that all queries will be visible t