Re: server crash on recursive function invocation

From: "Andrew Dunstan" <andrew(at)dunslane(dot)net>
To: <idofyear(at)yahoo(dot)com>
Cc: <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: server crash on recursive function invocation
Date: 2006-06-01 00:27:24
Message-ID: 4718.24.211.165.134.1149121644.squirrel@www.dunslane.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Ali Baba said:
>
> hi,
> i was just trying recursive function invocation and got a server crash
> when i changed a GUC variable max_stack_depth, to a high number.
> fallowing is what i have tried.
>
> select max_val from pg_settings where name='max_stack_depth'; --
> returns 2097151 set max_stack_depth=2097151;
> CREATE OR REPLACE FUNCTION func() RETURNS INT AS $$
> DECLARE
> x int;
> BEGIN
> null;
> x := func();
> return 0;
> END;
> $$ LANGUAGE PLPGSQL;
> select func();
> and the server get crashed.
>
>
> Any ideas?
>

what the heck did you expect with an infinitely recursive function?

cheers

andrew

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2006-06-01 01:55:33 Re: server crash on recursive function invocation
Previous Message David Hoksza 2006-05-31 22:10:28 Re: session id and global storage