[prev in list] [next in list] [prev in thread] [next in thread]
List: postgresql-admin
Subject: Re: [ADMIN] pg dump only indexes
From: bricklen <bricklen () gmail ! com>
Date: 2013-12-16 22:51:07
Message-ID: CAGrpgQ_HwbUxzA+aypaT02c=hRd7kZ+tmFf2sh9S4DESK3jSYg () mail ! gmail ! com
[Download RAW message or body]
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';
[Attachment #3 (text/html)]
<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Mon, Dec 16, 2013 \
at 2:42 PM, Campbell, Lance <span dir="ltr"><<a href="mailto:lance@illinois.edu" \
target="_blank">lance@illinois.edu</a>></span> wrote:<br> <blockquote \
class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid \
rgb(204,204,204);padding-left:1ex">
<div link="blue" vlink="purple" lang="EN-US">
<div>
<p class="MsoNormal">PostgreSQL 9.2<u></u><u></u></p>
<p class="MsoNormal">Is there a way to use pg_dump to dump just indexes on a \
database?<u></u><u></u></p> <p class="MsoNormal"> \
</p></div></div></blockquote></div><br></div><div class="gmail_extra">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.<br> Eg<br>COPY (select indexdef||';' as \
idxdef from pg_indexes where schemaname <> 'pg_catalog' order by 1) TO \
'/path/to/your/file.sql';<br></div></div>
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic