Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1XZbye-0002h1-V8 for pgsql-bugs@arkaria.postgresql.org; Thu, 02 Oct 2014 08:43:09 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1XZbye-0004K9-8n for pgsql-bugs@arkaria.postgresql.org; Thu, 02 Oct 2014 08:43:08 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1XZbyd-0004K2-Bi for pgsql-bugs@postgresql.org; Thu, 02 Oct 2014 08:43:07 +0000 Received: from wrigleys.postgresql.org ([204.145.124.246]) by magus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1XZbyZ-0004kU-N7 for pgsql-bugs@postgresql.org; Thu, 02 Oct 2014 08:43:05 +0000 MIME-Version: 1.0 Subject: BUG #11552: Trigger functions (but not funcs in trigger or rule conditions) are called regardless their privs To: pgsql-bugs@postgresql.org From: bashtanov@imap.cc Date: Thu, 02 Oct 2014 08:42:08 +0000 Message-ID: <20141002084208.2543.34215@wrigleys.postgresql.org> X-Pg-Spam-Score: -1.1 (-) Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit 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 The following bug has been logged on the website: Bug reference: 11552 Logged by: Alexey Bashtanov Email address: bashtanov@imap.cc PostgreSQL version: 9.3.4 Operating system: CentOS 6.5 Description: Hello! Actions I performed: 0. login as user repl (I have one) 1. create a table "x", reassign it to ro user 2. create a function foo() owned by repl 3. create a trigger after insert on x for each row execute foo() 4. make the function foo() not callable by anyone (revoke execute from public and from repl) 5. login as ro 6. try to insert into x. It works, trigger is fired (!) 7. login as repl 8. make the function foo() callable by repl 9. drop the existing trigger, create another one similar but with condition `when (foo() is null)` 10. make the function foo() not callable by anyone 11. login as ro 12. try to insert into x. It does not work, trigger is not fired because it cannot call foo() The behavior in pp. 6, 12 is pretty strange, namely that it is different in these two situations. At least this should be mentioned in docs. Regards, Alexey -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs