Re: pg_dumpall from a script

Поиск
Список
Период
Сортировка
От Adrian Klaver
Тема Re: pg_dumpall from a script
Дата
Msg-id 52668301.9020407@gmail.com
обсуждение исходный текст
Ответ на Re: pg_dumpall from a script  (Luca Ferrari <fluca1978@infinito.it>)
Список pgsql-general
On 10/21/2013 11:41 PM, Luca Ferrari wrote:
> On Tue, Oct 22, 2013 at 7:20 AM, James Sewell <james.sewell@lisasoft.com> wrote:
>
>> I need a way to backup either from SQL in PSQL (possibly \!) or from a PG/PLSQL function to a file with a name set
froma :variable. 
>
> Could it be something like this:
>
> # \setenv myFile 'filename'
> # \! pg_dump > $myFile
>
> Unfortunately there seems to be no unsetenv command to remove the
> variable within the script.

Call it again without the variable value:

http://www.postgresql.org/docs/9.3/interactive/app-psql.html

\setenv [ name [ value ] ]
Sets the environment variable name to value, or if the value is not
supplied, unsets the environment variable

\setenv myFile

>
>
> Luca
>
>


--
Adrian Klaver
adrian.klaver@gmail.com


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

Предыдущее
От: Merlin Moncure
Дата:
Сообщение: Re: Count of records in a row
Следующее
От: Amit Langote
Дата:
Сообщение: Re: A client and server encoding question