Re: Automating pg_Dump on Windows 2016 Server

Поиск
Список
Период
Сортировка
От Thomas Kellerer
Тема Re: Automating pg_Dump on Windows 2016 Server
Дата
Msg-id d1587115-7566-aad6-050d-50671ed018e7@gmx.net
обсуждение исходный текст
Ответ на Automating pg_Dump on Windows 2016 Server  (Simon White <simonwhite@dciphercomputing.com>)
Список pgsql-admin
Simon White schrieb am 14.11.2018 um 20:49:
> Automating pg_dump seems to be unnecessarily difficult from Windows
> Server 2016.  I have tried using the PGPASSWORD environment variable
> and the PGPASSFILE environment variable all to no avail.  The result
> is that I am always prompted for a password.  Could you not create a
> option to pass the password on the command line or the location of a
> password file to be used. That certainly would make things simpler.
> 
> Since I was using the "postgres" user I tried setting the password
> under the "postgres" user in pgAdmin4 but that did not help either.
> 

I have no problems setting the variable inside a batch file:

   setlocal
   set PGPASSWORD=verysecret
   pg_dump -U myuser -D ....

By default Postgres uses the "Local System" account to run the service. I don't think that is a Windows user for which
youcan define environment variables. So you would need to define the environment variable as a global one.
 

If you don't want to use a batch file, you could create a dedicated Windows user where you set the environment
variablesand then use that user to run the service. But make sure you adjust the privilege on the data directory. Using
abatch file for pg_dump is most probably a lot easier.
 


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

Предыдущее
От: Simon White
Дата:
Сообщение: Automating pg_Dump on Windows 2016 Server
Следующее
От: Andrey Zhidenkov
Дата:
Сообщение: Re: hot_standby_feedback parameter doesn't work