pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: John R Pierce <pierce@hogranch.com>
To: pgsql-bugs@postgresql.org
Subject: Re: BUG #13318: refresh materilaized view privileges
Date: Tue, 19 May 2015 15:39:18 -0700
Message-ID: <555BBB96.2000506@hogranch.com> (raw)
In-Reply-To: <20150519210727.26514.22507@wrigleys.postgresql.org>
References: <20150519210727.26514.22507@wrigleys.postgresql.org>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-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



-- 
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs



view thread (2+ messages)

Message-ID: <555BBB96.2000506@hogranch.com>
Permalink:  ../555BBB96.2000506@hogranch.com/
Also on:    postgresql.org/message-id/555BBB96.2000506@hogranch.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-bugs@postgresql.org
  Cc: pierce@hogranch.com
  Subject: Re: BUG #13318: refresh materilaized view privileges
  In-Reply-To: <555BBB96.2000506@hogranch.com>
  References: <20150519210727.26514.22507@wrigleys.postgresql.org> <555BBB96.2000506@hogranch.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox