Received: from localhost (maia-5.hub.org [200.46.204.182]) by postgresql.org (Postfix) with ESMTP id 9E8DD9FB675 for ; Fri, 27 Jul 2007 17:45:45 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.182]) (amavisd-maia, port 10024) with ESMTP id 69895-07 for ; Fri, 27 Jul 2007 17:45:39 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.5 Received: from megazone.bigpanda.com (megazone.bigpanda.com [64.147.171.210]) by postgresql.org (Postfix) with ESMTP id 6C6B19FB678 for ; Fri, 27 Jul 2007 17:45:42 -0300 (ADT) Received: by megazone.bigpanda.com (Postfix, from userid 1001) id 8AE0835553; Fri, 27 Jul 2007 13:45:41 -0700 (PDT) Received: from localhost (localhost [127.0.0.1]) by megazone.bigpanda.com (Postfix) with ESMTP id 896353554D; Fri, 27 Jul 2007 13:45:41 -0700 (PDT) Date: Fri, 27 Jul 2007 13:45:41 -0700 (PDT) From: Stephan Szabo To: De Leeuw Guy Cc: pgsql-admin@postgresql.org Subject: Re: trigger and pg_fini In-Reply-To: <46AA144F.3010604@eurofer.be> Message-ID: <20070727133449.X1155@megazone.bigpanda.com> References: <46AA144F.3010604@eurofer.be> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200707/319 X-Sequence-Number: 26300 On Fri, 27 Jul 2007, De Leeuw Guy wrote: > I make a lot of tests with trigger and first problem the function > _PG_fini are never called it is a bug ?. _PG_fini is called when the file is unloaded, but not at process end, according to the documentation, so I don't think it does what you want. > This is a big problem for me because I want to cleanup the data managed > by my trigger. What data are you managing? If you can palloc it into an appropriately lived context, it might be easier for you to manage. > second problem I cannot detect from a trigger the kind of call (row or > transaction) What information do you want? You can get whether it's a row or transaction event, as well as whether it was insertion, update or delete from the context.