X-Original-To: pgsql-sql@postgresql.org Received: from spampd.localdomain (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id BBFBE47640E for ; Wed, 30 Apr 2003 00:55:23 -0400 (EDT) Received: from megazone.bigpanda.com (megazone.bigpanda.com [63.150.15.178]) by postgresql.org (Postfix) with ESMTP id 57DB547640B for ; Wed, 30 Apr 2003 00:55:19 -0400 (EDT) Received: by megazone.bigpanda.com (Postfix, from userid 1001) id EA897D613; Tue, 29 Apr 2003 21:55:24 -0700 (PDT) Received: from localhost (localhost [127.0.0.1]) by megazone.bigpanda.com (Postfix) with ESMTP id E04345C04; Tue, 29 Apr 2003 21:55:24 -0700 (PDT) Date: Tue, 29 Apr 2003 21:55:24 -0700 (PDT) From: Stephan Szabo To: Tom Lane Cc: Sergey Holod , Subject: Re: Making "SECURITY DEFINER" procedures.. - SOLVED In-Reply-To: <19603.1051675837@sss.pgh.pa.us> Message-ID: <20030429215026.I66727-100000@megazone23.bigpanda.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Spam-Status: No, hits=-26.0 required=5.0 tests=BAYES_01,EMAIL_ATTRIBUTION,IN_REP_TO,QUOTED_EMAIL_TEXT, REPLY_WITH_QUOTES autolearn=ham version=2.50 X-Spam-Level: X-Spam-Checker-Version: SpamAssassin 2.50 (1.173-2003-02-20-exp) X-Archive-Number: 200304/439 X-Sequence-Number: 13140 On Wed, 30 Apr 2003, Tom Lane wrote: > Sergey Holod writes: > > GRANT USAGE ON schema data TO rcbilling; > > Don't fully undestand why I need that, but It works.. > > Okay, that's the same bug we found just a couple days ago. Schema-usage > errors are checked at query parse time, not execution time, and the > foreign-key triggers weren't being careful to set the right context for > those checks. There's a fix in place for 7.3.3. As a more general question, as what user should triggers from an action inside a security definer function be run as? The fk triggers will work after changing the place the permissions are changed, but afaics user after triggers won't unless the trigger function is also security definer.