Received: from localhost (maia-2.hub.org [200.46.204.187]) by postgresql.org (Postfix) with ESMTP id EF0169FB26B for ; Sat, 28 Jul 2007 11:51:19 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.187]) (amavisd-maia, port 10024) with ESMTP id 87196-09 for ; Sat, 28 Jul 2007 11:51:04 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.5 Received: from BRUBLUmx12.mactelecom.net (BRUBLUmx12.mactelecom.net [217.64.240.4]) by postgresql.org (Postfix) with ESMTP id F24F89FA5EA for ; Sat, 28 Jul 2007 11:51:14 -0300 (ADT) Received: from smtp.eurofer.be (217.64.254.218.mactelecom.net [217.64.254.218]) by BRUBLUmx12.mactelecom.net (Postfix) with ESMTP id 3F95B8381E5; Sat, 28 Jul 2007 16:51:13 +0200 (CEST) Received: from ip-80-236-229-195.dsl.scarlet.be ([80.236.229.195] helo=[192.168.1.104]) by smtp.eurofer.be with esmtpsa (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.63) (envelope-from ) id 1IEnd5-0005t4-Sw; Sat, 28 Jul 2007 16:51:13 +0200 Message-ID: <46AB57C4.6050608@eurofer.be> Date: Sat, 28 Jul 2007 16:50:44 +0200 From: De Leeuw Guy User-Agent: IceDove 1.5.0.10 (X11/20070329) MIME-Version: 1.0 To: Stephan Szabo CC: pgsql-admin@postgresql.org References: <46AA144F.3010604@eurofer.be> <20070727133449.X1155@megazone.bigpanda.com> In-Reply-To: <20070727133449.X1155@megazone.bigpanda.com> X-Enigmail-Version: 0.94.2.0 Content-Type: text/plain; charset=windows-1250 Content-Transfer-Encoding: 8bit X-Spam_score: -3.8 X-SA-Exim-Connect-IP: 80.236.229.195 X-SA-Exim-Mail-From: G.De_Leeuw@eurofer.be Subject: Re: trigger and pg_fini X-SA-Exim-Scanned: Yes (on smtp.eurofer.be) X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200707/326 X-Sequence-Number: 26307 Hello Stephan Thanks for you respons. Stephan Szabo a écrit : > _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. > No, I make a small test : In _PG_fini I create a file and close it (via fopen), I quit pgsql and the file are never created, bul a small lsof say me that the module are unloaded. > What data are you managing? If you can palloc it into an appropriately > lived context, it might be easier for you to manage. > I manage a small cache. pfree release the memory, but it's not possible to trigger a special action like "save the cache now". > What information do you want? > I event like "startBegin", "endBegin", "startCopy", "endCopy" .... > You can get whether it's a row or transaction event, as well as whether it > was insertion, update or delete from the context.data How can I detect (in language C) that the trigger work on a transaction context or a row context ? And it is possible to receive an event when this transaction are ended ? Regards Guy