Re: BUG #13318: refresh materilaized view privileges - Mailing list pgsql-bugs

From John R Pierce
Subject Re: BUG #13318: refresh materilaized view privileges
Date
Msg-id 555BBB96.2000506@hogranch.com
Whole thread Raw
In response to BUG #13318: refresh materilaized view privileges  (Adrien.Sales@gmail.com)
List pgsql-bugs
On 5/19/2015 2:07 PM, Adrien.Sales@gmail.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

pgsql-bugs by date:

Previous
From: Adrien.Sales@gmail.com
Date:
Subject: BUG #13318: refresh materilaized view privileges
Next
From: sathhish@hotmail.com
Date:
Subject: BUG #13321: SQL SHELL(psql)