X-Original-To: pgsql-sql@postgresql.org Received: from spampd.localdomain (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id 3B20847635E for ; Tue, 29 Apr 2003 16:58:39 -0400 (EDT) Received: from vm.radiocom.net.ua (ib-vm-sg.radiocom.net.ua [81.90.225.206]) by postgresql.org (Postfix) with ESMTP id 9598247635D for ; Tue, 29 Apr 2003 16:58:36 -0400 (EDT) Received: from sergey.local.radiocom.net.ua (sergey.local.radiocom.net.ua [10.10.1.10]) by vm.radiocom.net.ua with ESMTPœ id h3TKwZ5a036764 for ; Tue, 29 Apr 2003 23:58:35 +0300 (EEST) (envelope-from sss@radiocom.net.ua)œ From: Sergey Holod Organization: RadioCom ISP To: pgsql-sql@postgresql.org Subject: Making "SECURITY DEFINER" procedures.. Date: Tue, 29 Apr 2003 23:58:35 +0300 User-Agent: KMail/1.5 MIME-Version: 1.0 Content-Type: text/plain; charset="koi8-u" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200304292358.35245.sss@radiocom.net.ua> X-Spam-Status: No, hits=-6.6 required=5.0 tests=BAYES_01,USER_AGENT version=2.50 X-Spam-Level: X-Spam-Checker-Version: SpamAssassin 2.50 (1.173-2003-02-20-exp) X-Archive-Number: 200304/430 X-Sequence-Number: 13131 Hello!!! Just trying to make subj I made user "data", schema "data", several tables and small procedures on them in that schema and then a greater function (as "SECURITY DEFINER") in "public" schema which uses previous functions. I graned "EXECUTE" access to that function to "PUBLIC". When I try execute that function I get "ERROR: data: permission denied", but when I add some notices between parts of function I see following: tst=> select new_session('sergey','mypassword'); NOTICE: current user is data NOTICE: after delete NOTICE: after select NOTICE: after insert NOTICE: before return ERROR: data: permission denied so function executed with "data" privilegies, It deletes some data, inserts another and so on, It even runs till "return", but then I get error... It seems last error takes place during "auto commit" of transaction in which function executes.. Just don't undestand what is happens..:( -- With Best Regards, Sergey Holod