From: | Shreeyansh Dba <shreeyansh2014(at)gmail(dot)com> |
---|---|
To: | hendrik(dot)schenk(at)sieb-meyer(dot)de |
Cc: | pgsql-admin(at)lists(dot)postgresql(dot)org |
Subject: | Re: Batch: DB password with ">" |
Date: | 2018-10-11 15:16:35 |
Message-ID: | CAGDYbUMhAo3vu8Bk4r=2QGwCXRZHbkGCPYZBJyF+nV_AtzMfFw@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-admin |
Hi,
You can use below command to get the desired output.
echo localhost:5432:postgres:postgres:7Ug^\>uAks!{VA > %PGPASSFILE%
or
echo "localhost:5432:postgres:postgres:7Ug^>uAks!{VA" > %PGPASSFILE%
On Thu, Oct 11, 2018 at 6:38 PM Schenk, Hendrik <
hendrik(dot)schenk(at)sieb-meyer(dot)de> wrote:
> 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?
>
From | Date | Subject | |
---|---|---|---|
Next Message | Schenk, Hendrik | 2018-10-12 05:42:47 | AW: Batch: DB password with ">" |
Previous Message | John Scalia | 2018-10-11 14:21:01 | Re: Batch: DB password with ">" |