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