Q: extract database name from directory dump

Поиск
Список
Период
Сортировка
От Karsten Hilbert
Тема Q: extract database name from directory dump
Дата
Msg-id 20160312203333.GB1688@hermes.hilbert.loc
обсуждение исходный текст
Ответы Re: Q: extract database name from directory dump  (Karsten Hilbert <Karsten.Hilbert@gmx.net>)
Re: Q: extract database name from directory dump  (John R Pierce <pierce@hogranch.com>)
Список pgsql-general
Hi,

I have been searching but haven't been able to find the
answer to the following question:

How can I (programmatically) find out which database a dump
was taken from given the dump file ?

Constraints of the question:

- existing dump in directory format
- dump was taken of only one particular database

Not-so-nice solutions coming to mind:

- rely on the dump file name
- use pg_restore to create an SQL dump
  with --create and grep the SQL file
  for "create database ..."
- restore and compare psql -l output
  before/after the fact

However, I'd wish for a less fragile solution, letting me
learn the database directly from the directory dump (given
the above assumptions about the dump).

Am I missing options for doing so ?

Karsten
--
GPG key ID E4071346 @ eu.pool.sks-keyservers.net
E167 67FD A291 2BEA 73BD  4537 78B9 A9F9 E407 1346


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

Предыдущее
От: Adrian Klaver
Дата:
Сообщение: Re: Unable to match same value in field.
Следующее
От: Karsten Hilbert
Дата:
Сообщение: Re: Q: extract database name from directory dump