Received: from localhost (maia-5.hub.org [200.46.204.182]) by postgresql.org (Postfix) with ESMTP id E09339FB715 for ; Tue, 17 Jul 2007 17:21:49 -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 49966-01 for ; Tue, 17 Jul 2007 17:21:43 -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 059029FB6CB for ; Tue, 17 Jul 2007 17:21:46 -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 943C22C413B; Tue, 17 Jul 2007 22:21:44 +0200 (CEST) Received: from ip-80-236-221-18.dsl.scarlet.be ([80.236.221.18] helo=[192.168.1.105]) by smtp.eurofer.be with esmtpsa (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.63) (envelope-from ) id 1IAtXz-0003ZS-OV; Tue, 17 Jul 2007 22:21:44 +0200 Message-ID: <469D24C6.6090903@eurofer.be> Date: Tue, 17 Jul 2007 22:21:26 +0200 From: De Leeuw Guy User-Agent: IceDove 1.5.0.10 (X11/20070329) MIME-Version: 1.0 To: Andrew Sullivan , pgsql-admin@postgresql.org References: <20070716170957.GV18049@phlogiston.dyndns.org> <469BAF1D.8030108@eurofer.be> <20070716184837.GB18049@phlogiston.dyndns.org> <469BD389.4030606@eurofer.be> <20070716203641.GF18049@phlogiston.dyndns.org> <469C5AC4.7040903@eurofer.be> <20070717152848.GD21688@phlogiston.dyndns.org> <469CE4FB.9080403@eurofer.be> <20070717162306.GH21688@phlogiston.dyndns.org> <469D0E39.7040805@eurofer.be> <20070717192156.GP21688@phlogiston.dyndns.org> In-Reply-To: <20070717192156.GP21688@phlogiston.dyndns.org> X-Enigmail-Version: 0.94.2.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Spam_score: -3.8 X-SA-Exim-Connect-IP: 80.236.221.18 X-SA-Exim-Mail-From: G.De_Leeuw@eurofer.be Subject: Re: cache problem (v2) X-SA-Exim-Scanned: Yes (on smtp.eurofer.be) X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200707/189 X-Sequence-Number: 26170 > Is that BEGIN;? If not, this is _not_ one transaction. It's two. > Ok > You're not actually _calling_ the trigger, right? It just happens > automatically? Also, I don't have the slightest clue how this code=3 > (does not exist) works. AFAICT code=1. So code=3 is never true, no? > Yes it's a case study but my trigger consider this possibility. > >> Now I have a flat file : >> 1,150 >> 2,450 >> >> COPY .... path_to_this_flat_file >> >> code=3,qte=450 >> Why ? >> > > Because it's all one transaction, and because there's more than one > state your variables could resolve to, only one of them actually > applies is my _guess_. It's hard for me to say with any more detail > without the code and the schema. Anyway, you have two transactions > in your first example, it appears. The COPY statement is only one. > Ok, but strange for me ... the transaction is a guarantee of visibility inter process but in the same also ? If yes it' is possible to change that ? I see on the documentation (yes, yes I read them :-) ) that the UNCOMMITED_READ are equal to COMMITED READ in postgres > >> Another error also is "duplicate key" >> > > This is a different problem. Where is it coming from? Anyway, you > have some sort of collision there, as the result I assume of your > modifications of the data. Does it only happen with the COPY case? > If so, that's another clue that the trigger function is not doing > what you think it is. > Yes I agree, originally same problem > >> I read the documentation from postgres not all. But sufficiently to >> start a test of a trigger. >> > > But apparently not a successful one ;-) I'm just saying, it seems to > me that you have a deep misunderstanding of the way transaction scope > works. I think you need to have another look at that. I also think > you need to look a little harder at how COPY works as compared to > INSERT. > Yes for me in the same transaction I see my update but is not the case. But I agree I take more time to understand the transactional part :-) Regards Guy