Re: pg dump only indexes

From: bricklen <bricklen(at)gmail(dot)com>
To: "Campbell, Lance" <lance(at)illinois(dot)edu>
Cc: "pgsql-admin(at)postgresql(dot)org" <pgsql-admin(at)postgresql(dot)org>
Subject: Re: pg dump only indexes
Date: 2013-12-16 22:51:07
Message-ID: CAGrpgQ_HwbUxzA+aypaT02c=hRd7kZ+tmFf2sh9S4DESK3jSYg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

On Mon, Dec 16, 2013 at 2:42 PM, Campbell, Lance <lance(at)illinois(dot)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';

In response to

Browse pgsql-admin by date

  From Date Subject
Next Message Doom.zhou 2013-12-17 05:29:37 Notice about psql !
Previous Message Vibhor Kumar 2013-12-16 22:48:59 Re: pg dump only indexes