Thread: pg_dump: ERROR: Memory exhausted in AllocSetAlloc(875574064)
Is there any solution to this other than adding memory, or am I mis-understanding the error? pg_dump: ERROR: Memory exhausted in AllocSetAlloc(875574064) pg_dump: lost synchronization with server, resetting connection pg_dump: SQL command to dump the contents of table "table_name" failed: PQendcopy() failed. pg_dump: Error message from server: pg_dump: The command was: COPY "table_name" TO stdout; v7.2.3 on RHAT 7.3 linux with 128MB RAM. Thanks, reid
Hi everybody, I'm a PG newbie, and I'm trying to write a function that returns a set of records. These records come from 2 or more tables (joined). When I have only 1 table, the return type of the function can be SETOF mytable. When I have 2 tables or more, am I obliged to create a type (CREATE TYPE) so that my function can return a SETOF mytype? This works fine, but I'm trying to avoid building a specific type for each row returning function. Is there any other solution (SQL or PLPGSQL)? TIA, -- Hervé Inisan.
"Reid Thompson" <Reid.Thompson@ateb.com> writes: > Is there any solution to this other than adding memory, or am I > mis-understanding the error? > pg_dump: ERROR: Memory exhausted in AllocSetAlloc(875574064) > pg_dump: lost synchronization with server, resetting connection My bet is that this is actually a corrupt-data problem ... unless you actually have any 875MB fields in your table. The implication is that the length word of a variable-width field contains garbage. More than likely, the whole tuple is garbaged, but this happens to be the first visible symptom. There is plenty of discussion of recovering from data corruption in the archives, so go have a look. > v7.2.3 on RHAT 7.3 linux with 128MB RAM. Might want to think about an update sometime, too ;-) regards, tom lane
Hi Hervé, You should perhaps use record instead of a particular type. ... RETURNS SETOF record AS ... Otto ----- Original Message ----- From: "Hervé Inisan" <typo3@self-access.com> To: <pgsql-general@postgresql.org> Sent: Thursday, May 12, 2005 8:31 PM Subject: [GENERAL] About Types Hi everybody, I'm a PG newbie, and I'm trying to write a function that returns a set of records. These records come from 2 or more tables (joined). When I have only 1 table, the return type of the function can be SETOF mytable. When I have 2 tables or more, am I obliged to create a type (CREATE TYPE) so that my function can return a SETOF mytype? This works fine, but I'm trying to avoid building a specific type for each row returning function. Is there any other solution (SQL or PLPGSQL)? TIA, -- Hervé Inisan. ---------------------------(end of broadcast)--------------------------- TIP 6: Have you searched our list archives? http://archives.postgresql.org
On Thu, May 12, 2005 at 02:56:35PM -0400, Tom Lane wrote: > "Reid Thompson" <Reid.Thompson@ateb.com> writes: > > Is there any solution to this other than adding memory, or am I > > mis-understanding the error? > > > pg_dump: ERROR: Memory exhausted in AllocSetAlloc(875574064) > > pg_dump: lost synchronization with server, resetting connection > > My bet is that this is actually a corrupt-data problem ... unless you > actually have any 875MB fields in your table. The implication is that > the length word of a variable-width field contains garbage. More than > likely, the whole tuple is garbaged, but this happens to be the first > visible symptom. Just for curiosity sake: 875574064 base 10 = 34303330 base 16 Looks like the ASCII string "4030" Definitly corrupted tuple... -- Martijn van Oosterhout <kleptog@svana.org> http://svana.org/kleptog/ > Patent. n. Genius is 5% inspiration and 95% perspiration. A patent is a > tool for doing 5% of the work and then sitting around waiting for someone > else to do the other 95% so you can sue them.