Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1YuqAg-0000xT-Rw for pgsql-bugs@arkaria.postgresql.org; Tue, 19 May 2015 22:39:34 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1YuqAg-0002cE-CH for pgsql-bugs@arkaria.postgresql.org; Tue, 19 May 2015 22:39:34 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1YuqAe-0002ZU-PV for pgsql-bugs@postgresql.org; Tue, 19 May 2015 22:39:32 +0000 Received: from hogranch.com ([75.101.82.47]) by makus.postgresql.org with esmtp (Exim 4.84) (envelope-from ) id 1YuqAb-00033h-GU for pgsql-bugs@postgresql.org; Tue, 19 May 2015 22:39:31 +0000 Received: from [192.168.0.2] (porker [192.168.0.2]) by hogranch.com (8.11.6/8.11.6) with ESMTP id t4JMdNH11448 for ; Tue, 19 May 2015 15:39:23 -0700 Message-ID: <555BBB96.2000506@hogranch.com> Date: Tue, 19 May 2015 15:39:18 -0700 From: John R Pierce User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.6.0 MIME-Version: 1.0 To: pgsql-bugs@postgresql.org Subject: Re: BUG #13318: refresh materilaized view privileges References: <20150519210727.26514.22507@wrigleys.postgresql.org> In-Reply-To: <20150519210727.26514.22507@wrigleys.postgresql.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-HawgScanner-Information: Please contact the ISP for more information X-HawgScanner: Found to be clean X-Pg-Spam-Score: -1.9 (-) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-bugs Precedence: bulk Sender: pgsql-bugs-owner@postgresql.org 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