Re: server crash on recursive function invocation - Mailing list pgsql-hackers

From Andrew Dunstan
Subject Re: server crash on recursive function invocation
Date
Msg-id 4718.24.211.165.134.1149121644.squirrel@www.dunslane.net
Whole thread Raw
In response to server crash on recursive function invocation  (Ali Baba <idofyear@yahoo.com>)
List 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




pgsql-hackers by date:

Previous
From: Ali Baba
Date:
Subject: server crash on recursive function invocation
Next
From: Tom Lane
Date:
Subject: Re: server crash on recursive function invocation