Oliver Elphick <olly@lfix.co.uk> writes:
>> We are using a number of stored procedures that are called often from our
>> client programs.
> Are you somehow setting off an infinite recursion? How is this being
> called?
I doubt it would be an infinite-recursion problem, as that would soon
lead to stack overflow and core dump (or at least very obvious memory
bloat). I'm wondering about inefficient plans being generated for the
queries in the procedure.
> Try putting RAISE NOTICE statements in to track the progress of the
> code.
Right. See also recent discussion on pgsql-performance about
investigating plans used for plpgsql queries.
regards, tom lane