Search Postgresql Archives

Re: Order of Update - Second Try

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux