pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Andrew Sullivan <ajs@crankycanuck.ca>
To: pgsql-admin@postgresql.org
Subject: Re: cache problem (v2)
Date: Tue, 17 Jul 2007 12:23:06 -0400
Message-ID: <20070717162306.GH21688@phlogiston.dyndns.org> (raw)
In-Reply-To: <469CE4FB.9080403@eurofer.be>
References: <469B4927.9030604@eurofer.be>
	<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>

On Tue, Jul 17, 2007 at 05:49:15PM +0200, De Leeuw Guy wrote:

> > Your trigger function runs inside the transaction of the calling
> > statement, unless you have explicitly started a transaction. 
> >   
> Not possible from a trigger

Yes, sorry, I phrased that wrong.  Let me put it differently: your
trigger runs only inside the transaction of the calling statement,
unless that statement itself is inside a longer explicitly-called
transaction.  For example:

t1						t2

BEGIN						
UPDATE table_with_trigger
SELECT something		 	SELECT ...FROM trigger_effect
INSERT something else
COMMIT

In this case, t2 does _not_ see the effects of the trigger in t1,
because those effects are not visible until the COMMIT.  But

t1						t2

UPDATE table_with_trigger
SELECT something			SELECT...FROM trigger_effect
INSERT something else

in this case, t2 _does_ see the effects, because the trigger's
effects are COMMITted implicitly after the UPDATE statement.

> Yes true, It's my first step with postgres but also with a relationnal
> database.
> But I'm sure that with COPY the data are not correctly updated and
> if I edit the file loaded by the COPY command and adapt it with each
> line with a command INSERT all work fine.

If I read that right, you admit that you are inexperienced with the
concepts and the software, and you are unable to show us all the
relevant code or send us a precise description of what you are
doing; but, you are convinced nevertheless that the problem is a bug
or deficiency in PostgreSQL that nobody else seems to be having, and
not a problem with your approach?  I suggest you think again.

A

-- 
Andrew Sullivan  | ajs@crankycanuck.ca
However important originality may be in some fields, restraint and 
adherence to procedure emerge as the more significant virtues in a 
great many others.   --Alain de Botton



view thread (14+ messages)  latest in thread

Message-ID: <20070717162306.GH21688@phlogiston.dyndns.org>
Permalink:  ../20070717162306.GH21688@phlogiston.dyndns.org/
Also on:    postgresql.org/message-id/20070717162306.GH21688@phlogiston.dyndns.org

 · 

reply

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: ajs@crankycanuck.ca
  Subject: Re: cache problem (v2)
  In-Reply-To: <20070717162306.GH21688@phlogiston.dyndns.org>

* 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