Re: Dump all the indexes/constraints/roles - Mailing list pgsql-general

From Jeff Janes
Subject Re: Dump all the indexes/constraints/roles
Date
Msg-id CAMkU=1yd9KyVEOKnUBduLAQTeHVyvJ+7MgG40i5qD1E9YiD0FQ@mail.gmail.com
Whole thread Raw
In response to Dump all the indexes/constraints/roles  (Patrick B <patrickbakerbr@gmail.com>)
Responses Re: Dump all the indexes/constraints/roles  (Patrick B <patrickbakerbr@gmail.com>)
List pgsql-general
On Mon, Oct 17, 2016 at 8:32 PM, Patrick B <patrickbakerbr@gmail.com> wrote:
Hi guys,

I need to export an entire database to another server, for testing purpose.

Is there any way to export all indexes and constraints ?
Postgres 9.2
Patrick

By default pg_dump will export the constraints.  It will export the definition of the indexes, but not the physical contents of them, so they have to be recreated upon import.  That can be slow depending on the sizes and types involved.

Or you can clone the whole thing with pg_basebackup.  (If you have multiple databases on the same cluster, this will take all of them.  The only thing you can do about that is drop the ones you don't want.)

pgsql-general by date:

Previous
From: Pavel Stehule
Date:
Subject: Re: Generic way to test input arguments
Next
From: Francisco Olarte
Date:
Subject: Re: tablesample performance