pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Ragnar <gnari@hive.is>
To: dave.bath@unix.net
Cc: pgsql-sql@postgresql.org
Subject: Re: Dump/restore comments only?
Date: Mon, 27 Feb 2006 09:04:32 +0000
Message-ID: <1141031072.8396.5.camel@localhost.localdomain> (raw)
In-Reply-To: <200602271356.18537.dave.bath@unix.net>
References: <200602271356.18537.dave.bath@unix.net>

On mán, 2006-02-27 at 13:56 +1100, Bath, David wrote:

> There have been a number of times when I've wanted to ignore everything
> in a dump file apart from comments.  I am interested not just in comments
> for tables/views/columns but constraints, indices and functions as well.
> 
> Many of my comments are multi-line and often resemble manpages, so a
> simple grep for '^COMMENT ON' will not work for me.
> 
> Has anyone got a script/view in SQL that will generate fully-qualified
> COMMENT ON statements from the pg_catalog/information_schema, a
> sed|awk|perl script to munge the ascii file produced by pg_dump,
> or even pg_dump undocumented options that might help me?

You might find it simpler to do this if you use the 
custom format. Something like :

pg_dump -Fc mydat > mydat.dump
pg_restore -l mydat.dump > mydat.toc
grep COMMENT mydat.toc > mydat.comments.toc
pgrestore -L mydat.comments.toc mydat.dump


gnari





view thread (2+ messages)

Message-ID: <1141031072.8396.5.camel@localhost.localdomain>
Permalink:  ../1141031072.8396.5.camel@localhost.localdomain/
Also on:    postgresql.org/message-id/1141031072.8396.5.camel@localhost.localdomain

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: gnari@hive.is, dave.bath@unix.net
  Subject: Re: Dump/restore comments only?
  In-Reply-To: <1141031072.8396.5.camel@localhost.localdomain>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

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