Re: Q: extract database name from directory dump

Поиск
Список
Период
Сортировка
От Karsten Hilbert
Тема Re: Q: extract database name from directory dump
Дата
Msg-id 20160312221359.GJ1688@hermes.hilbert.loc
обсуждение исходный текст
Ответ на Re: Q: extract database name from directory dump  ("David G. Johnston" <david.g.johnston@gmail.com>)
Список pgsql-general
On Sat, Mar 12, 2016 at 02:59:05PM -0700, David G. Johnston wrote:

> And a much more reasonable assumption would have been 9.5 - let the user
> complain if/when the advice doesn't work because they are on an unstated
> older release that doesn't support the feature in question.
>
> I guess the O/S would be needed for syntax purposes but the typical
> responder would simply provide an answer if whatever O/S shell they are
> familiar with and deal with the issue of making it work elsewhere if needed.
>
> It is, however, quite needed to report the version (and usually O/S) when
> posting to the -bugs list.  This here is the -general list and the need to
> do so is generally not all that frequent though is appreciated as it makes
> giving targeted advice a bit easier.

Thanks but no worry. I am myself actually in favor of
providing sufficient information. So I did and took the
possibly (!) ever so slight chiding undertones (?) as a
lesson in humility :-))

Eventually, I went with

    TARGET_DB=`pg_restore -C -s ${BACKUP}.dir | head -n 40 | grep -i "create database gnumed_v" | cut -f 3 -d " "`

which is intended to be used under

    bash:
      Installiert:           4.3-14+b1
      Installationskandidat: 4.3-14+b1
      Versionstabelle:
     *** 4.3-14+b1 0
            990 ftp://ftp.de.debian.org/debian/ stretch/main i386 Packages
            500 ftp://ftp.de.debian.org/debian/ unstable/main i386 Packages
            100 /var/lib/dpkg/status
         4.3-11+b1 0
            500 http://ftp.de.debian.org/debian/ jessie/main i386 Packages

Note that I changed the "head -1" to "head -n 40"

    coreutils:
      Installiert:           8.25-2
      Installationskandidat: 8.25-2
      Versionstabelle:
     *** 8.25-2 0
            990 ftp://ftp.de.debian.org/debian/ stretch/main i386 Packages
            500 ftp://ftp.de.debian.org/debian/ unstable/main i386 Packages
            100 /var/lib/dpkg/status
         8.23-4 0
            500 http://ftp.de.debian.org/debian/ jessie/main i386 Packages

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


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

Предыдущее
От: "Peter J. Holzer"
Дата:
Сообщение: Re: Unable to match same value in field.
Следующее
От: Tom Lane
Дата:
Сообщение: Re: OS X 10.11.3, psql, bus error 10, 9.5.1