Re: pg dump only indexes - Mailing list pgsql-admin

From bricklen
Subject Re: pg dump only indexes
Date
Msg-id CAGrpgQ_HwbUxzA+aypaT02c=hRd7kZ+tmFf2sh9S4DESK3jSYg@mail.gmail.com
Whole thread Raw
In response to pg dump only indexes  ("Campbell, Lance" <lance@illinois.edu>)
List pgsql-admin
On Mon, Dec 16, 2013 at 2:42 PM, Campbell, Lance <lance@illinois.edu> wrote:

PostgreSQL 9.2

Is there a way to use pg_dump to dump just indexes on a database?

 


I don't think you can do that using pg_dump in 9.2, but you could probably replicate the functionality using a COPY statement.
Eg
COPY (select indexdef||';' as idxdef from pg_indexes where schemaname <> 'pg_catalog' order by 1) TO '/path/to/your/file.sql';

pgsql-admin by date:

Previous
From: Vibhor Kumar
Date:
Subject: Re: pg dump only indexes
Next
From: "Doom.zhou"
Date:
Subject: Notice about psql !