dbTalk Databases Forums  

[BUGS] psql: no chance to enter password in certain situations

mailing.database.pgsql-bugs mailing.database.pgsql-bugs


Discuss [BUGS] psql: no chance to enter password in certain situations in the mailing.database.pgsql-bugs forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Christoph Becker
 
Posts: n/a

Default [BUGS] psql: no chance to enter password in certain situations - 01-12-2005 , 05:07 PM






OS ist Windows XP Prof, PgSQL version is rc5 via windowsinstaller
When trying to restore a db, psql does not ask for the password but
responds imediately with an erromessage as in the following example:

F:\doka\bak>psql -U postgres template1 < pg_dump_all_2005-01-11.txt
Password:
psql: FATAL: password authentication failed for user "postgres"

However, in the following situation the password can still be entered as
expected :

F:\doka\bak>psql -U postgres template1
Password:
Welcome to psql 8.0.0rc5, the PostgreSQL interactive terminal.
.......

Regards
Christoph Becker


---------------------------(end of broadcast)---------------------------
TIP 5: Have you checked our extensive FAQ?

http://www.postgresql.org/docs/faqs/FAQ.html

Reply With Quote
  #2  
Old   
John R Pierce
 
Posts: n/a

Default Re: [BUGS] psql: no chance to enter password in certain situations - 01-12-2005 , 05:37 PM






Christoph Becker wrote:
Quote:
OS ist Windows XP Prof, PgSQL version is rc5 via windowsinstaller
When trying to restore a db, psql does not ask for the password but
responds imediately with an erromessage as in the following example:

F:\doka\bak>psql -U postgres template1 < pg_dump_all_2005-01-11.txt
Password:
psql: FATAL: password authentication failed for user "postgres"

However, in the following situation the password can still be entered as
expected :

F:\doka\bak>psql -U postgres template1
Password:
Welcome to psql 8.0.0rc5, the PostgreSQL interactive terminal.
......
try -f instead of < like...

psql -U postgres template1 -f pg_dump_all_2005-01-11.txt

btw, personal 'trick', to avoid having to specify template1, I generally
`createdb postgres` right after installing and doing the initdb. this way the
postgres DBA account has his own personal playpen for testing SQL and stuff.


---------------------------(end of broadcast)---------------------------
TIP 8: explain analyze is your friend


Reply With Quote
  #3  
Old   
Tom Lane
 
Posts: n/a

Default Re: [BUGS] psql: no chance to enter password in certain situations - 01-12-2005 , 08:51 PM



Christoph Becker <cgbecker (AT) gmx (DOT) de> writes:
Quote:
OS ist Windows XP Prof, PgSQL version is rc5 via windowsinstaller
When trying to restore a db, psql does not ask for the password but
responds imediately with an erromessage as in the following example:

F:\doka\bak>psql -U postgres template1 < pg_dump_all_2005-01-11.txt
Password:
psql: FATAL: password authentication failed for user "postgres"
I'm not sure that it's possible to fix that. On Unix we read the
password from /dev/tty not stdin, but on Windows that trick (probably)
does not work, and we have to fall back to reading from stdin ...
which you've stuffed with the input file. Better to use -f to source
the input file.

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 3: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to majordomo (AT) postgresql (DOT) org so that your
message can get through to the mailing list cleanly


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.