stack depth limit exceeded - Mailing list pgsql-general

From Ovid
Subject stack depth limit exceeded
Date
Msg-id 133441.27185.qm@web65708.mail.ac4.yahoo.com
Whole thread Raw
Responses Re: stack depth limit exceeded
List pgsql-general
I'm getting the following error from Postgres:

  ERROR:  stack depth limit exceeded
  HINT:  Increase the configuration parameter "max_stack_depth", after ensuring
the platform's stack depth limit is adequate.
  CONTEXT:  SQL statement "UPDATE _test_changed_table SET updates = updates + 1
WHERE table_name =  $1 "
  PL/pgSQL function "fn_update_changes" line 2
This happens even after I drop and recreate the database.  What's going on is
that for every table in the database we create three triggers, similar to these
for the 'users' table:

tr_insert_users
tr_update_users
tr_delete_users

Each trigger will add 1 to the corresponding insert/update/delete column in a
table which tracks those.  This allows me, when I finish a test run, to check my
"_test_changed_table" table to see what updates, inserts and deletes have
happened on which table:

veure_test=# select * from _test_changed_table;
   id |table_name  |is_static |inserts |updates |deletes
----+-------------+-----------+---------+---------+---------
  4|location    |        1|      1|      0|      0
  8|email       |        0|      0|      0|      0
  1|roles       |        1|      0|      0|      0
 6|users |        1|      0|      0|      0
    ...

(We do this because we then know which tables have been altered on a given test
run and we only rebuild the changed tables, not the entire db. Saves a lot of
time).

This was working fine until this mornings 'stack depth' errors.  Can anyone give
me a pointer as to what's going on?  Is there more information I can provide to
help diagnose this?

Cheers,
Ovid
--
Buy the book         - http://www.oreilly.com/catalog/perlhks/
Tech blog            - http://blogs.perl.org/users/ovid/
Twitter              - http://twitter.com/OvidPerl
Official Perl 6 Wiki - http://www.perlfoundation.org/perl6



pgsql-general by date:

Previous
From: yj2133011
Date:
Subject: Re: On-disk size of db increased after restore
Next
From: Thom Brown
Date:
Subject: Re: stack depth limit exceeded