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

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 (view raw, whole thread or download thread mbox)
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 '
        thiscur  refcursor;
        zz_tmp zz%rowtype ;
        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


pgsql-novice by date

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

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