On Mon, Dec 16, 2013 at 2:42 PM, Campbell, Lance <lance@xxxxxxxxxxxx> 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';
Eg
COPY (select indexdef||';' as idxdef from pg_indexes where schemaname <> 'pg_catalog' order by 1) TO '/path/to/your/file.sql';