Skip site navigation (1) Skip section navigation (2)

Re: Why would this crash my server

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: glenn <vmstech(at)tpg(dot)com(dot)au>
Cc: "pgsql-novice(at)postgresql(dot)org" <pgsql-novice(at)postgresql(dot)org>
Subject: Re: Why would this crash my server
Date: 2003-02-24 02:46:48
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-novice
glenn <vmstech(at)tpg(dot)com(dot)au> writes:
> -- Here is my experimental function
> create or replace function zz_dump() returns setof zz  as '
> declare
>         thiscur  refcursor;
>         zz_tmp zz%rowtype ;
> begin
>         open thiscur for select a, b from zz;
>         fetch thiscur into zz_tmp  ;
>         return zz_tmp;
> end;' language 'plpgsql';

Try 7.3 --- plpgsql functions don't support returning sets in
earlier releases.  (You can't do it quite that way in 7.3,
either; you need RETURN NEXT.  See the documentation.)

> --Heres the result, which comes after 5 min of hdd light thrashing,
> capslock light doesn't respond and gui completely freezes.

On my machine, 7.2 fails with
	ERROR:  Memory exhausted in AllocSetContextCreate(8192)
after about 20 seconds.  There's no obvious loss of responsiveness of
the rest of the machine meanwhile.  I suspect your machine is poorly
configured --- better compare the max-memory-per-process kernel setting
with the actual amount of physical RAM and swap space.  You've evidently
got it set up in a way that allows a runaway process to drive it into
swap hell.

			regards, tom lane

In response to


pgsql-novice by date

Next:From: Michael WeaverDate: 2003-02-24 02:54:28
Subject: Substring & escape Character
Previous:From: glennDate: 2003-02-24 02:06:19
Subject: Why would this crash my server

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group