pg_restore: show object schema name in verbose output

Поиск
Список
Период
Сортировка
От Ian Lawrence Barwick
Тема pg_restore: show object schema name in verbose output
Дата
Msg-id CAB8KJ=iKZud+icOGkiSCJ+t9A1TACLYhxXugwWtRif_xryTfSQ@mail.gmail.com
обсуждение исходный текст
Ответы Re: pg_restore: show object schema name in verbose output
Список pgsql-hackers
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

Вложения

В списке pgsql-hackers по дате отправления:

Предыдущее
От: Kevin Grittner
Дата:
Сообщение: Re: Need help to begin contribution in PostgreSQL Development - Specifically XML module
Следующее
От: "Erik Rijkers"
Дата:
Сообщение: Re: pg_restore: show object schema name in verbose output