pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Dump/restore comments only?
2+ messages / 2 participants
[nested] [flat]

* Dump/restore comments only?
@ 2006-02-27 02:56 Bath, David <dave.bath@unix.net>
  2006-02-27 09:04 ` Re: Dump/restore comments only? Ragnar <gnari@hive.is>
  0 siblings, 1 reply; 2+ messages in thread

From: Bath, David @ 2006-02-27 02:56 UTC (permalink / raw)
  To: pgsql-sql

Folks,

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?

(If there are no such options for dump/restore, might these be useful
inclusions in the future?)

Thanks in advance.
-- 
David T. Bath
dave.bath@unix.net




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

* Re: Dump/restore comments only?
  2006-02-27 02:56 Dump/restore comments only? Bath, David <dave.bath@unix.net>
@ 2006-02-27 09:04 ` Ragnar <gnari@hive.is>
  0 siblings, 0 replies; 2+ messages in thread

From: Ragnar @ 2006-02-27 09:04 UTC (permalink / raw)
  To: dave.bath@unix.net; +Cc: pgsql-sql

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





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


end of thread, other threads:[~2006-02-27 09:04 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2006-02-27 02:56 Dump/restore comments only? Bath, David <dave.bath@unix.net>
2006-02-27 09:04 ` Ragnar <gnari@hive.is>

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