Re: Q: extract database name from directory dump

Поиск
Список
Период
Сортировка
От Karsten Hilbert
Тема Re: Q: extract database name from directory dump
Дата
Msg-id 20160312212806.GH1688@hermes.hilbert.loc
обсуждение исходный текст
Ответ на Re: Q: extract database name from directory dump  (Melvin Davidson <melvin6925@gmail.com>)
Список pgsql-general
On Sat, Mar 12, 2016 at 04:17:07PM -0500, Melvin Davidson wrote:

> BTW, other than the obvious of including the name in path or file, if you
> are referring to previous/existing dumps

I do.

> grep -i some_dump_file 'CREATE DATABASE'

That will not work (directly) because the dump is in
directory format.

> If nothing is found, then the dump can be applied to ANY database.

Since one can create an SQL dump from the directory dump the
above becomes possible by appropriate use of

    pg_restore -C ... | grep CREATE DATABASE

This is, indeed, the option (after pg_restore -l | grep ...)
I consider least fragile.

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


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

Предыдущее
От: Karsten Hilbert
Дата:
Сообщение: Re: Q: extract database name from directory dump
Следующее
От: Chris Ruprecht
Дата:
Сообщение: Re: OS X 10.11.3, psql, bus error 10, 9.5.1