Re: pg_dump with 1100 schemas being a bit slow - Mailing list pgsql-general

From Tom Lane
Subject Re: pg_dump with 1100 schemas being a bit slow
Date
Msg-id 9020.1254925428@sss.pgh.pa.us
Whole thread Raw
In response to pg_dump with 1100 schemas being a bit slow  ("Loic d'Anterroches" <diaeresis@gmail.com>)
Responses Re: pg_dump with 1100 schemas being a bit slow
List pgsql-general
"Loic d'Anterroches" <diaeresis@gmail.com> writes:
> Each night I am running:
> pg_dump --blobs --schema=%s --no-acl -U postgres indefero | gzip >
> /path/to/backups/%s/%s-%s.sql.gz
> this for each installation, so 1100 times. Substitution strings are to
> timestamp and get the right schema.

This seems like a pretty dumb way to go at it.  Why don't you just do
one -Fc dump for the whole database?  If you ever actually need to
restore a single schema, there's a pg_restore switch for that.

> I think that pg_dump, when looking at the objects to dump, also it is
> limited to a given schema, is scanning the complete database in one
> those calls:

Yes, it has to examine all database objects in order to trace
dependencies properly.

> Is there an option: "I know what I am doing, do not look outside of
> the schema" available which can help in my case?

No.

            regards, tom lane

pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: Need help in spi_prepare errors
Next
From: Alvaro Herrera
Date:
Subject: Re: Need help in spi_prepare errors