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

From John R Pierce
Subject Re: Dump all the indexes/constraints/roles
Date
Msg-id 990d5f48-a4a4-3b52-41e0-03e3d4184e0e@hogranch.com
Whole thread Raw
In response to Dump all the indexes/constraints/roles  (Patrick B <patrickbakerbr@gmail.com>)
List pgsql-general
On 10/17/2016 8:32 PM, Patrick B wrote:
> 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

on the existing machine, as the postgres user....

pg_dump -Fc -d databasename -f filename.pgdump

then, on the new machine,

createdb newdatabase -o dbownername
pg_restore -d newdatabase filename.pgdump



--
john r pierce, recycling bits in santa cruz



pgsql-general by date:

Previous
From: Patrick B
Date:
Subject: Dump all the indexes/constraints/roles
Next
From: Adrian Klaver
Date:
Subject: Re: Dump all the indexes/constraints/roles