pg.ddx.io pgsql-admin@postgresql.org mailing list archive
help / color / mirror / Atom feedBatch: DB password with ">"
4+ messages / 4 participants
[nested] [flat]
* Batch: DB password with ">"
@ 2018-10-11 13:07 Schenk, Hendrik <hendrik.schenk@sieb-meyer.de>
2018-10-11 13:45 ` Re: Batch: DB password with ">" David G. Johnston <david.g.johnston@gmail.com>
2018-10-11 15:16 ` Re: Batch: DB password with ">" Shreeyansh Dba <shreeyansh2014@gmail.com>
0 siblings, 2 replies; 4+ messages in thread
From: Schenk, Hendrik @ 2018-10-11 13:07 UTC (permalink / raw)
To: pgsql-admin@lists.postgresql.org <pgsql-admin@lists.postgresql.org>
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?
^ permalink raw reply [nested|flat] 4+ messages in thread
* Re: Batch: DB password with ">"
2018-10-11 13:07 Batch: DB password with ">" Schenk, Hendrik <hendrik.schenk@sieb-meyer.de>
@ 2018-10-11 13:45 ` David G. Johnston <david.g.johnston@gmail.com>
2018-10-11 14:21 ` Re: Batch: DB password with ">" John Scalia <jayknowsunix@gmail.com>
1 sibling, 1 reply; 4+ messages in thread
From: David G. Johnston @ 2018-10-11 13:45 UTC (permalink / raw)
To: Schenk, Hendrik <hendrik.schenk@sieb-meyer.de>; +Cc: pgsql-admin@lists.postgresql.org <pgsql-admin@lists.postgresql.org>
On Thursday, October 11, 2018, Schenk, Hendrik <hendrik.schenk@sieb-meyer.de>
wrote:
>
> How can I use this with a password like this?
>
>
Maybe use single quotes to prevent the shell from seeing its special symbol?
David J.
^ permalink raw reply [nested|flat] 4+ messages in thread
* Re: Batch: DB password with ">"
2018-10-11 13:07 Batch: DB password with ">" Schenk, Hendrik <hendrik.schenk@sieb-meyer.de>
2018-10-11 13:45 ` Re: Batch: DB password with ">" David G. Johnston <david.g.johnston@gmail.com>
@ 2018-10-11 14:21 ` John Scalia <jayknowsunix@gmail.com>
0 siblings, 0 replies; 4+ messages in thread
From: John Scalia @ 2018-10-11 14:21 UTC (permalink / raw)
To: David G. Johnston <david.g.johnston@gmail.com>; +Cc: Schenk, Hendrik <hendrik.schenk@sieb-meyer.de>; pgsql-admin@lists.postgresql.org <pgsql-admin@lists.postgresql.org>
And you may need to escape it with a preceding \ character.
—
Jay
Sent from my iPhone
> On Oct 11, 2018, at 9:45 AM, David G. Johnston <david.g.johnston@gmail.com> wrote:
>
>> On Thursday, October 11, 2018, Schenk, Hendrik <hendrik.schenk@sieb-meyer.de> wrote:
>> How can I use this with a password like this?
>>
>
> Maybe use single quotes to prevent the shell from seeing its special symbol?
>
> David J.
^ permalink raw reply [nested|flat] 4+ messages in thread
* Re: Batch: DB password with ">"
2018-10-11 13:07 Batch: DB password with ">" Schenk, Hendrik <hendrik.schenk@sieb-meyer.de>
@ 2018-10-11 15:16 ` Shreeyansh Dba <shreeyansh2014@gmail.com>
1 sibling, 0 replies; 4+ messages in thread
From: Shreeyansh Dba @ 2018-10-11 15:16 UTC (permalink / raw)
To: hendrik.schenk@sieb-meyer.de; +Cc: pgsql-admin@lists.postgresql.org
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%
<http://www.shreeyansh.com;
On Thu, Oct 11, 2018 at 6:38 PM Schenk, Hendrik <
hendrik.schenk@sieb-meyer.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?
>
^ permalink raw reply [nested|flat] 4+ messages in thread
end of thread, other threads:[~2018-10-11 15:16 UTC | newest]
Thread overview: 4+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2018-10-11 13:07 Batch: DB password with ">" Schenk, Hendrik <hendrik.schenk@sieb-meyer.de>
2018-10-11 13:45 ` David G. Johnston <david.g.johnston@gmail.com>
2018-10-11 14:21 ` John Scalia <jayknowsunix@gmail.com>
2018-10-11 15:16 ` Shreeyansh Dba <shreeyansh2014@gmail.com>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox