Re: update problem in triggers - Mailing list pgsql-general

From Tom Lane
Subject Re: update problem in triggers
Date
Msg-id 1687.1127185789@sss.pgh.pa.us
Whole thread Raw
In response to update problem in triggers  (Jamie Deppeler <jamie@doitonce.net.au>)
List pgsql-general
Jamie Deppeler <jamie@doitonce.net.au> writes:
> I am having with this simple trigger i wrote, worked when i created it
> but now i get this error  "Stack depth Limit Exceeded"

You've written an infinite recursion: the trigger does another UPDATE on
the same table that it is an UPDATE trigger for.  The approach seems
seriously foolish in the first place --- you should be altering the NEW
record in a BEFORE trigger, not trying to change the record over again
after it's already written out.

            regards, tom lane

pgsql-general by date:

Previous
From: "Greg Sabino Mullane"
Date:
Subject: Re: Implementing a change log
Next
From: "Ilja Golshtein"
Date:
Subject: Re: CREATE TEMP TABLE AS SELECT/ GET DIAGNOSTICS ROW_COUNT again