From: Adrian Klaver <adrian.klaver@aklaver.com>
To: Cherio <cherio@gmail.com>
To: pgsql-general@lists.postgresql.org
Subject: Re: pg_restore fails when psql succeeds
Date: Sat, 12 Dec 2020 12:18:05 -0800
Message-ID: <dcdcc07e-d9c6-8879-38b7-c6fee74d1af8@aklaver.com> (raw)
In-Reply-To: <CAKHqFkJykaVF8Gado-UWCu5=HDdPfihQu-X6qkNfY7jsUTDy=g@mail.gmail.com>
References: <CAKHqFkJykaVF8Gado-UWCu5=HDdPfihQu-X6qkNfY7jsUTDy=g@mail.gmail.com>
On 12/12/20 12:10 PM, Cherio wrote:
> I am facing a consistent issue with pg_restore when moving databases
> with large tables from PostgreSQL 10 to 13. pg_restore fails to restore
> indexes on some large tables (anything over 20 million records).
>
> pg_restore: error: could not execute query: ERROR: out of memory
> DETAIL: Failed on request of size 214728704 in memory context
> "TupleSort sort".
> CONTEXT: parallel worker
> Command was: CREATE INDEX some_index_idx ON schema1.table1 USING btree
> (some_field);
>
> This happens when a database is exported with formats "custom" or
> "directory". No errors occur when the same databases are exported as
> plain text and imported with psql.
>
> Initially I was importing with --jobs in several threads, but reducing
> threads to 1 made no difference. I tried exporting with pg_dump versions
> 13 and 10. It made no difference either - restore succeeds with plain
> text + psql and fails with the other formats + pg_restore.
>
> The same doesn't happen when I import from 10 into 12. I am a bit lost
> and concerned at this point about moving on with conversion to version 13.
>
> Any guidance would be greatly appreciated!
Exact Postgres 13 version?
Hardware specifications for machine?
Changes in this
section(https://www.postgresql.org/docs/13/runtime-config-resource.html)
of postgresql.conf?
Relevant information from system logs?
--
Adrian Klaver
adrian.klaver@aklaver.com
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-general@postgresql.org
Cc: adrian.klaver@aklaver.com, cherio@gmail.com
Subject: Re: pg_restore fails when psql succeeds
In-Reply-To: <dcdcc07e-d9c6-8879-38b7-c6fee74d1af8@aklaver.com>
References: <CAKHqFkJykaVF8Gado-UWCu5=HDdPfihQu-X6qkNfY7jsUTDy=g@mail.gmail.com> <dcdcc07e-d9c6-8879-38b7-c6fee74d1af8@aklaver.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox