Re: update problem in triggers

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Jamie Deppeler <jamie(at)doitonce(dot)net(dot)au>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: update problem in triggers
Date: 2005-09-20 03:09:49
Message-ID: 1687.1127185789@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Jamie Deppeler <jamie(at)doitonce(dot)net(dot)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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Ilja Golshtein 2005-09-20 05:26:11 Re: CREATE TEMP TABLE AS SELECT/ GET DIAGNOSTICS ROW_COUNT again
Previous Message Greg Sabino Mullane 2005-09-20 03:01:30 Re: Implementing a change log