I just noticed that pg_restore executing in "verbose" mode displays the
name of the object being restored, but not its schema.

I'd like to be able to see the fully-qualified object name because
if pg_restore spits out a warning like this:

  $ pg_restore -d somedb  /path/to/dumpfile.pgd
  pg_restore: WARNING:  column "session_id" has type "unknown"
  DETAIL:  Proceeding with relation creation anyway.
  $

verbose mode is useful to identify which object is at issue, e.g.:

  $ pg_restore -v -d somedb /path/to/dumpfile.pgd
  pg_restore: connecting to database for restore
(...)
  pg_restore: creating VIEW someview
  pg_restore: WARNING:  column "session_id" has type "unknown"
  DETAIL:  Proceeding with relation creation anyway.
(...)
  $

but only shows the bare object name. In the case I recently encountered,
objects with the same name existed in multiple schemas, which meant it
took longer to track down the offending object than it could have done.

The attached patch changes the output to print the schema name too, e.g.:

  $ pg_restore -v -d somedb /path/to/dumpfile.pgd
  pg_restore: connecting to database for restore
(...)
  pg_restore: creating VIEW schema94.someview
  pg_restore: WARNING:  column "session_id" has type "unknown"
  DETAIL:  Proceeding with relation creation anyway.
(...)
  $

which is more useful, IMHO.

Regards


Ian Barwick

Attachment: pg-restore-verbose-output-schema-2013-08-03.patch
Description: Binary data

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

Reply via email to