FATAL 1: Memory exhausted in AllocSetAlloc() - Mailing list pgsql-general

From Gordon P. Oliver
Subject FATAL 1: Memory exhausted in AllocSetAlloc()
Date
Msg-id pan.2002.11.23.23.03.23.977755.4054@pacbel.net
Whole thread Raw
Responses Re: FATAL 1: Memory exhausted in AllocSetAlloc()  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-general
Hi All.
  I have a problem that generates the out of memory error above in a
consistent manner. It doesn't seem to be covered in the faq's. Note that
this same code does _not_ fail in 7.2.1-5, but please don't ask me to
upgrade, it is a production server :-)

Version:
  postgresql-7.0.3-8 (RedHat)

What I am doing:
  BEGIN
  LOCK TABLE a IN EXCLUSIVE MODE;
  ALTER TABLE a RENAME m TO y;
  ALTER TABLE a ADD COLUMN m DATE;
  ALTER TABLE a RENAME n TO z;
  ALTER TABLE a ADD COLUMN n INT;
  UPDATE a SET m = to_date(y, 'MM DD YYYY') WHERE m IS NULL AND y  ~
'^[0-9][0-9][^0-9][0-9][0-9][^0-9][0-9][0-9][0-9][0-9]$';
  UPDATE a SET m = to_date(y, 'MM DD YY') WHERE m IS NULL AND y ~
'^[0-9][0-9][^0-9][0-9][0-9][^0-9][0-9][0-9]$';
  ... more follows ...

What happens:
  Right there, during the second update, I get the out of memory error.

Other information:
  The table has abou 60 columns.
  There are 29 rows in the table.

Output of free: (lots of free memory)
             total       used       free     shared    buffers     cached
Mem:        254504     252348       2156          0      46196      95440
-/+ buffers/cache:     110712     143792
Swap:      1044216       5856    1038360


Output of ulimit: (could it be stack size or pipe size, the error doesn't
seem appropriate)

core file size (blocks)     1000000
data seg size (kbytes)      unlimited
file size (blocks)          unlimited
max locked memory (kbytes)  unlimited
max memory size (kbytes)    unlimited
open files                  1024
pipe size (512 bytes)       8
stack size (kbytes)         8192
cpu time (seconds)          unlimited
max user processes          8157
virtual memory (kbytes)     unlimited

Does anyone have any idea of why this would fail?
Thanks in advance
    -gordo

pgsql-general by date:

Previous
From: cnliou9@fastmail.fm (CN)
Date:
Subject: Firing Order For Referential Integrity Delete
Next
From: "SUFFIAN RAMLI"
Date:
Subject: Insert bytea type into PostgreSQL