Re: Order of Update - Second Try - Mailing list pgsql-general

From Geoffrey
Subject Re: Order of Update - Second Try
Date
Msg-id 441FF9CE.8060500@3times25.net
Whole thread Raw
In response to Order of Update - Second Try  (Terry Lee Tucker <terry@esc1.com>)
List pgsql-general
Terry Lee Tucker wrote:
> Hello List:
>
> I posted a question over the weekend regarding this issue but I failed to
> communicate effectively what the problem is. I was weary :o[  Let me try
> again.
>
> I have a plpgsql function which makes updates to a set of records across two
> tables in a One to Many relationship hereinafter referred to as "parent" and
> "child".  The parent record contains two important sets of information that
> is relative to this process. The first is data that links the children to the
> parent. The second is data that links the parent to the to a third table that
> we will call "totals". The update to the totals table is accomplished by the
> execution of a trigger that is fired as a result of updating the child
> records. The function updates the child records in a loop and then, at the
> bottom of the function, the parent table is updated, setting to null the
> values that link it to the totals table. The problem is that the update to
> the parent table is occurring first; then, the updates to the child records
> are occurring.

I'm curious about this issue.  How is this possible?  I caught the
previous posting, but didn't see any responses.  Is there anyway to deal
with this issue.  I know I've got code that takes a similar approach and
I'm now concerned that I'm going to trash my database.

Anyone?

--
Until later, Geoffrey

pgsql-general by date:

Previous
From: Terry Lee Tucker
Date:
Subject: Order of Update - Second Try
Next
From: "William ZHANG"
Date:
Subject: Re: How I can get the real data type result instead of