Re: stack depth limit exceeded

From: Michael Fuhr <mike(at)fuhr(dot)org>
To: Jamie Deppeler <jamie(at)doitonce(dot)net(dot)au>
Cc: PostgreSQL General <pgsql-general(at)postgresql(dot)org>
Subject: Re: stack depth limit exceeded
Date: 2005-08-29 02:38:06
Message-ID: 20050829023806.GA56266@winnie.fuhr.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Mon, Aug 29, 2005 at 12:01:59PM +1000, Jamie Deppeler wrote:
> At the moment i am trying to execute a very simple function but i am
> getting the following error stack depth limit exceeded

That's often a sign of infinite recursion, i.e., a function that
keeps calling itself, either directly or indirectly.

> CREATE OR REPLACE FUNCTION "contacts"."addContactField" () RETURNS
> trigger AS
> $body$
> begin
> update contacts.person
> set "contact" = new.firstname
> where person."primary" = new."primary";
> return null;
> end;
> $body$
> LANGUAGE 'plpgsql' VOLATILE CALLED ON NULL INPUT SECURITY INVOKER;

What's the trigger definition look like? I'd guess that the update
on contacts.person has a trigger that somehow gets back to this
function, which updates contacts.person, which invokes the trigger,
etc.

--
Michael Fuhr

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2005-08-29 02:42:38 Re: stack depth limit exceeded
Previous Message Jamie Deppeler 2005-08-29 02:01:59 stack depth limit exceeded