Batch: DB password with ">"

Поиск
Список
Период
Сортировка
От Schenk, Hendrik
Тема Batch: DB password with ">"
Дата
Msg-id 5a251002104944a2955bdf4dbaea3a42@sieb-meyer.de
обсуждение исходный текст
Ответы Re: Batch: DB password with ">"  ("David G. Johnston" <david.g.johnston@gmail.com>)
Re: Batch: DB password with ">"  (Shreeyansh Dba <shreeyansh2014@gmail.com>)
Список pgsql-admin

Hi,

 

i want to modiy the adatabse via batch script. The user has a password that contains symbols like that “g>uAks!”. The problem here is the “greater than”-symbol.

 

call set PGPASSFILE=%TEMP%\pgpass.conf

echo localhost:5432:postgres:postgres:7Ug^>uAks!{VA > %PGPASSFILE%

 

"C:\Program Files\PostgreSQL\10\bin\psql" -U postgres

 

psql will always fail with FATAL: User-Athentification failed. The password was read from ..\Local\Temp\pgpass.conf

 

 

 

 

If I set a Enviromentvariable and “echo” it, it will not work, because of the >-symbol.

 

 

C:\Users\hschenk>set PGPASSWORD=lalal>lala

 

C:\Users\hschenk>echo %PGPASSWORD%

Lalal

 

How can I use this with a password like this?

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

Предыдущее
От: pavan95
Дата:
Сообщение: Re: Null value returned by function pg_last_wal_receive_lsn()inLogical Replication
Следующее
От: "David G. Johnston"
Дата:
Сообщение: Re: Batch: DB password with ">"