X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.130]) by svr1.postgresql.org (Postfix) with ESMTP id 61852D1B9A7 for ; Wed, 20 Aug 2003 17:53:43 -0300 (ADT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (neptune.hub.org [64.117.224.130]) (amavisd-new, port 10024) with ESMTP id 94151-10 for ; Wed, 20 Aug 2003 17:53:34 -0300 (ADT) Received: from sss.pgh.pa.us (unknown [192.204.191.242]) by svr1.postgresql.org (Postfix) with ESMTP id E2564D1BB56 for ; Wed, 20 Aug 2003 17:53:31 -0300 (ADT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.12.9/8.12.9) with ESMTP id h7KKrN5H019304; Wed, 20 Aug 2003 16:53:23 -0400 (EDT) To: "Aasmund Midttun Godal" Cc: pgsql-sql@postgresql.org Subject: Re: Before/After Trigger User Switching In-reply-to: <20030820203343.8271.qmail@one.kreator.com> References: <20030820171250.15333.qmail@one.kreator.com> <17711.1061410347@sss.pgh.pa.us> <20030820203343.8271.qmail@one.kreator.com> Comments: In-reply-to "Aasmund Midttun Godal" message dated "Wed, 20 Aug 2003 22:33:43 +0200" Date: Wed, 20 Aug 2003 16:53:22 -0400 Message-ID: <19303.1061412802@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/248 X-Sequence-Number: 14864 "Aasmund Midttun Godal" writes: > Thank you for your quick reply! > I understand your point of view, however the fact remains that you want the > action to be done as though it was the DEFINER user that did it, and that > has not changed even thoug the function itself has finished? ... if there's any bug here, I'd argue that it's that we don't force trigger functions to run as the owner of the table they're on. The privileges of the user that did the INSERT or whatever are the wrong thing in any case, I'd say. Which suggests a workaround for the moment: your trigger function should be a SECURITY DEFINER. regards, tom lane