From: Erik Wienhold <ewie@ewie.name>
To: Andrus <kobruleht2@hot.ee>
To: depesz@depesz.com
Cc: pgsql-general <pgsql-general@postgresql.org>
Subject: Re: How to create directory format backup
Date: Wed, 8 Feb 2023 23:45:04 +0100 (CET)
Message-ID: <1169630167.178680.1675896304462@office.mailbox.org> (raw)
In-Reply-To: <6422167c-c725-d305-5ee5-d16f310e7fc7@hot.ee>
References: <b27a73f5-e6e6-4076-eee6-e002528d942c@hot.ee>
<Y+Pi/vWMeo6d6uJ8@depesz.com>
<6da54c55-6752-ca53-cdc8-2342b2c75258@hot.ee>
<531831758.189866.1675891078338@office.mailbox.org>
<6422167c-c725-d305-5ee5-d16f310e7fc7@hot.ee>
> On 08/02/2023 22:37 CET Andrus <kobruleht2@hot.ee> wrote:
>
> > > How to create backup in format from which tables can selectively
> > > restored?
> > >
> > Dump as custom-format archive (-F custom) and use that with pg_restore
> > and options --table or --list/--use-list to select what should be
> > restored.
> >
> How to select tables interactively like pgAdmin allows to select when
> directory format is used ?
>
> Database contains hundreds of schemas. I need to restore public and other
> other schema.
>
> Whole backup file is scanned to restore only two schemas. It takes lot of
> time.
pg_dump also accepts options --table and --schema to only dump what you need.
> Also directory format allows to use all cores with --jobs=32 parameter.
> Dump and partial restore using custom format are much slower.
Run multiple pg_dump processes in parallel where each processes a subset of
tables with the options mentioned above.
--
Erik
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: ewie@ewie.name, kobruleht2@hot.ee, depesz@depesz.com
Subject: Re: How to create directory format backup
In-Reply-To: <1169630167.178680.1675896304462@office.mailbox.org>
References: <b27a73f5-e6e6-4076-eee6-e002528d942c@hot.ee> <Y+Pi/vWMeo6d6uJ8@depesz.com> <6da54c55-6752-ca53-cdc8-2342b2c75258@hot.ee> <531831758.189866.1675891078338@office.mailbox.org> <6422167c-c725-d305-5ee5-d16f310e7fc7@hot.ee> <1169630167.178680.1675896304462@office.mailbox.org>
* 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