Re: pg_restore out of memory - Mailing list pgsql-general

From Tom Lane
Subject Re: pg_restore out of memory
Date
Msg-id 22561.1468588412@sss.pgh.pa.us
Whole thread Raw
In response to pg_restore out of memory  (Miguel Ramos <org.postgresql@miguel.ramos.name>)
List pgsql-general
Miguel Ramos <mail@miguel.ramos.name> writes:
> I see (transcribed by hand from screenshot):
> ...
> pg_restore: processing data for table "inspection.positioned_scan"
> out of memory

> Process returned exit code 1.

Right, so that confirms that the OOM happens while sending data for that
table; but we're still no closer as to why.

> I hadn't yet set log_min_messages to 'notice'. But as client_min_messages is at 'notice', aren't this displayed on a
verbosepg_restore? 

The theory I'd been considering was that NOTICE messages were being sent
by the server during the COPY (and not logged in the postmaster log
because log_min_messages wasn't high enough), but for some reason they
were not immediately processed and printed by pg_restore.  In such a case
they'd accumulate in libpq's input buffer.  After enough such messages
you'd eventually get an OOM failure.  Now the big hole in this theory is
that it's unclear why the server would be sending any notices.  But I
can't think of other good ideas.

> Now I'm repeating the backup (maybe the file is bad) and then I will repeat the restore with log_min_messages to
'notice'.

OK.

> I suppose log_statement to 'all' is no longer necessary?

I agree; we already know which statement is failing.

            regards, tom lane


pgsql-general by date:

Previous
From: Kaixi Luo
Date:
Subject: Re: Slow query on primary server runs fast on hot standby
Next
From: Willy-Bas Loos
Date:
Subject: migrating data from an old postgres version