pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
pg dump only indexes
3+ messages / 3 participants
[nested] [flat]

* pg dump only indexes
@ 2013-12-16 22:42  Campbell, Lance <lance@illinois.edu>
  0 siblings, 2 replies; 3+ messages in thread

From: Campbell, Lance @ 2013-12-16 22:42 UTC (permalink / raw)
  To: pgsql-admin

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


Thanks,

Lance Campbell<http://illinois.edu/person/lance;
Software Architect
Web Services at Public Affairs
217-333-0382
[University of Illinois at Urbana-Champaign logo]<http://illinois.edu/;

Attachments:

image003.png (image/png, 5.9K) download view image
^ permalink raw reply [nested|flat] 3+ messages in thread

* Re: pg dump only indexes
@ 2013-12-16 22:48  Vibhor Kumar <vibhor.aim@gmail.com>
  parent: Campbell, Lance <lance@illinois.edu>
  1 sibling, 0 replies; 3+ messages in thread

From: Vibhor Kumar @ 2013-12-16 22:48 UTC (permalink / raw)
  To: Campbell, Lance <lance@illinois.edu>; +Cc: pgsql-admin


On Dec 16, 2013, at 5: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?

You can use --section=post-data and grep the INDEXES.

Or you can use pg_catalog.pg_indexes.indexdef for indexes.
http://www.postgresql.org/docs/9.2/static/view-pg-indexes.html

Thanks & Regards,
Vibhor Kumar
Blogs:http://vibhork.blogspot.com
http://vibhorkumar.wordpress.com



-- 
Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-admin



^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: pg dump only indexes
@ 2013-12-16 22:51  bricklen <bricklen@gmail.com>
  parent: Campbell, Lance <lance@illinois.edu>
  1 sibling, 0 replies; 3+ messages in thread

From: bricklen @ 2013-12-16 22:51 UTC (permalink / raw)
  To: Campbell, Lance <lance@illinois.edu>; +Cc: 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';

^ permalink  raw  reply  [nested|flat] 3+ messages in thread


end of thread, other threads:[~2013-12-16 22:51 UTC | newest]

Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2013-12-16 22:42 pg dump only indexes Campbell, Lance <lance@illinois.edu>
2013-12-16 22:48 ` Vibhor Kumar <vibhor.aim@gmail.com>
2013-12-16 22:51 ` bricklen <bricklen@gmail.com>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox