From: De Leeuw Guy <G.De_Leeuw@eurofer.be>
To: Andrew Sullivan <ajs@crankycanuck.ca>
To: pgsql-admin@postgresql.org
Subject: Re: cache problem (v2)
Date: Tue, 17 Jul 2007 22:21:26 +0200
Message-ID: <469D24C6.6090903@eurofer.be> (raw)
In-Reply-To: <20070717192156.GP21688@phlogiston.dyndns.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>
> 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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-admin@postgresql.org
Cc: G.De_Leeuw@eurofer.be, ajs@crankycanuck.ca
Subject: Re: cache problem (v2)
In-Reply-To: <469D24C6.6090903@eurofer.be>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox