X-Original-To: pgsql-sql@postgresql.org Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id 77E3E475458 for ; Thu, 27 Feb 2003 19:22:49 -0500 (EST) Received: from postgresql.org ([64.49.215.8]) by localhost (postgresql.org [64.49.215.8:10024]) (amavisd-new) with SMTP id 06586-01 for ; Thu, 27 Feb 2003 19:22:33 -0500 (EST) Received: from megazone.bigpanda.com (megazone.bigpanda.com [63.150.15.178]) by postgresql.org (Postfix) with ESMTP id C172E475E4D for ; Thu, 27 Feb 2003 17:04:34 -0500 (EST) Received: by megazone.bigpanda.com (Postfix, from userid 1001) id 46F3ED5FA; Thu, 27 Feb 2003 14:04:36 -0800 (PST) Received: from localhost (localhost [127.0.0.1]) by megazone.bigpanda.com (Postfix) with ESMTP id 363F65C04; Thu, 27 Feb 2003 14:04:36 -0800 (PST) Date: Thu, 27 Feb 2003 14:04:36 -0800 (PST) From: Stephan Szabo To: Grignon Etienne Cc: Subject: Re: pgsql problem In-Reply-To: <00c801c2dde8$f69de7d0$0201a8c0@zimmer> Message-ID: <20030227140020.U90162-100000@megazone23.bigpanda.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Virus-Scanned: by amavisd-new X-Archive-Number: 200302/604 X-Sequence-Number: 12002 On Wed, 26 Feb 2003, Grignon Etienne wrote: > > test=# SELECT createuser('toto', true, true, true); > NOTICE: Begin Of Update Permissions > NOTICE: End Of Update Permissions > NOTICE: TRIGGER > createuser > ------------ > 0 > (1 row) > test=# > > > My problem is that the trigger for the insert is executed at the end of the > procedure, so I can't do the update of the user's permissions. > > For me and my co-workers, the NOTICE TRIGGER should be before Begin Of > Update Permissions. > > Could you explain to me how is it working ? Right now AFAIR after triggers run at the end of the containing statement (in this case the select of createuser) which is what causes the behavior you're seeing. I'm not sure of a good work around, off hand, for your case though.