Why would this crash my server

From: glenn <vmstech(at)tpg(dot)com(dot)au>
To: "pgsql-novice(at)postgresql(dot)org" <pgsql-novice(at)postgresql(dot)org>
Subject: Why would this crash my server
Date: 2003-02-24 02:06:19
Message-ID: 1046052378.3417.25.camel@thor.valhalla
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

Hi all
I've been playing round for a week or so now trying to master the
elusive secrets of passing sets of records around in postgres. Having
made a little progress, I thought I'd try using cursors - I didn't get
very far, but I did bring my machine to its knees and kill the postgres
server (on the same machine). Here's what I did, I'm wondering what
needs changing:

-- Here is my table
glenn=# select * from zz;
a | b
---+---
1 | 0
2 | 0
3 | 0
4 | 2
5 | 2
6 | 1
7 | 4
8 | 4
9 | 7
(9 rows)

-- 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';

--Heres the result, which comes after 5 min of hdd light thrashing,
capslock light doesn't respond and gui completely freezes. Interesting
thing is that after this executes, the gnome resources panel shows that
the amount of physical memory in use has halved. i.e. first time
95%->47%, 2nd time 47%->21%

thanks for _any_ help
Glenn

Responses

Browse pgsql-novice by date

  From Date Subject
Next Message Tom Lane 2003-02-24 02:46:48 Re: Why would this crash my server
Previous Message Robert Prather 2003-02-24 01:23:08 Re: User Problem In PostgreSQL on Mac OS X