Re: BUG #13318: refresh materilaized view privileges

From: John R Pierce <pierce(at)hogranch(dot)com>
To: pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #13318: refresh materilaized view privileges
Date: 2015-05-19 22:39:18
Message-ID: 555BBB96.2000506@hogranch.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On 5/19/2015 2:07 PM, Adrien(dot)Sales(at)gmail(dot)com wrote:
> CREATE OR REPLACE FUNCTION refresh_astre()
> RETURNS void
> SECURITY DEFINER -- <== added this
> AS $$
> BEGIN
> REFRESH MATERIALIZED VIEW vm_titi with data;
> RETURN;
> END;
> $$ LANGUAGE plpgsql;
>
> select refresh_astre();
>
> grant execute on function refresh_astre() to user_usr;
>
> psql -U user_usr test
>
> test=> select refresh_astre();
> ...

try again, with SECURITY DEFINER in the function declaration. This
says when this function is run, it runs with the permissions of the
function owner, rather than the caller.

.

--
john r pierce, recycling bits in santa cruz

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message sathhish 2015-05-20 13:38:36 BUG #13321: SQL SHELL(psql)
Previous Message Adrien.Sales 2015-05-19 21:07:27 BUG #13318: refresh materilaized view privileges