pg_restore -l and schema name

Started by Phil Endecottover 21 years ago2 messagesgeneral
Jump to latest
#1Phil Endecott
spam_from_postgresql_general@chezphil.org

Dear Postgresql people,

For the first time I'm trying to use pg_restore to do a partial restore.
It looks as if it should be easy: pg_restore -l, filter out the
required tables, then pg_restore -L. But unfortunately the listing
generated by pg_resotre doesn't include the schema name! Since my
database consists of lots of almost-identical schemas, I'm a bit stuck.

So this message is really a feature request for "please include the
schema name in the pg_restore -l output". Also, I'd be interested to
hear from anyone who has faced this problem before and can suggest how
to work around it.

Thanks in advance for any help.

Regards,

--Phil.

p.s. I'm logging long-running statements to syslog, and I'd also love to
see schema names there. But that's a less important problem.

#2Tom Lane
tgl@sss.pgh.pa.us
In reply to: Phil Endecott (#1)
Re: pg_restore -l and schema name

Phil Endecott <spam_from_postgresql_general@chezphil.org> writes:

So this message is really a feature request for "please include the
schema name in the pg_restore -l output".

Seems reasonable. I've applied the attached patch to 8.0; you can
probably apply it locally without much trouble (the change is in
PrintTOCSummary() if you can't find the spot easily).

regards, tom lane

*** src/bin/pg_dump/pg_backup_archiver.c.orig	Fri Sep 10 16:05:18 2004
--- src/bin/pg_dump/pg_backup_archiver.c	Fri Oct  8 10:57:37 2004
***************
*** 699,707 ****
  	while (te != AH->toc)
  	{
  		if (_tocEntryRequired(te, ropt, false) != 0)
! 			ahprintf(AH, "%d; %u %u %s %s %s\n", te->dumpId,
  					 te->catalogId.tableoid, te->catalogId.oid,
! 					 te->desc, te->tag, te->owner);
  		te = te->next;
  	}
--- 699,708 ----
  	while (te != AH->toc)
  	{
  		if (_tocEntryRequired(te, ropt, false) != 0)
! 			ahprintf(AH, "%d; %u %u %s %s %s %s\n", te->dumpId,
  					 te->catalogId.tableoid, te->catalogId.oid,
! 					 te->desc, te->namespace ? te->namespace : "-",
! 					 te->tag, te->owner);
  		te = te->next;
  	}