EnterpriseDB: The Enterprise Postgres Company Postgres Plus Forums: The PostgreSQL Open Source Database from EnterpriseDB
  [Search] Search   [Recent Topics] Recent Topics   [Hottest Topics] Hottest Topics   [Members]  Member Listing   [Groups] Back to home page 

Can't get pgpass.conf to work on my WinXP SP2 laptop  XML

Forum Index » Standard Server
Author Message
Aashish_Rathod

New member

Joined: 11 Jan 2010 19:09:48
Messages: 8
Offline

PostgreSQL 8.4 Standard Server

i can't get pgpass.conf to work on my WinXP SP2 laptop.

contents of pg_hba.conf
# IPv4 local connections:
host all all 127.0.0.1/32 md5
# IPv6 local connections:
host all all ::1/128 md5

contents of pgpass.conf
localhost:5432:postgres:postgres0stgres

location of pgpass.conf
C:\Documents and Settings\rathoa1\Application Data\postgresql AND
C:\Documents and Settings\postgres\Application Data\postgresql

is this a bug?

This message was edited 1 time. Last update was at 11 Jan 2010 19:14:56

Vibhor_K

Senior member
[Avatar]

Joined: 3 Jul 2009 09:46:15
Messages: 444
Offline

It should work. Tested on Windows XP for PostgreSQL 8.4

Please try to connect through psql to verify.

Thanks & Regards,
Vibhor Kumar
Blog:http://vibhork.blogspot.com
[Email] [WWW]
Aashish_Rathod

New member

Joined: 11 Jan 2010 19:09:48
Messages: 8
Offline

i tried through the psql console and this is what i got.

i put it in the attachments
 Filename psql_warning_msg.doc [Disk] Download
 Description
 Filesize 34 Kbytes
 Downloaded:  281 time(s)

This message was edited 1 time. Last update was at 12 Jan 2010 12:18:48

Aashish_Rathod

New member

Joined: 11 Jan 2010 19:09:48
Messages: 8
Offline

i think pgpass is working in the PSQL window but it does not seem to work in pgAdmin.

In pgAdmin, it seems to run forever as if the pgpass file does not exist.
Vibhor_K

Senior member
[Avatar]

Joined: 3 Jul 2009 09:46:15
Messages: 444
Offline

i think pgpass is working in the PSQL window but it does not seem to work in pgAdmin


Do you mean that for Connecting to Database through pgAdmin3, pgAdmin ask password every time? If this is a case you can save database password in pgAdmin by checking "store password" when, pgAdmin prompt for Password.

If you are talking about plugins tab option of "psql", then please go to "File" tab of pgAdmin and click on "open .pgpass" to check the entry for user.


Thanks & Regards,
Vibhor Kumar
Blog:http://vibhork.blogspot.com
[Email] [WWW]
Aashish_Rathod

New member

Joined: 11 Jan 2010 19:09:48
Messages: 8
Offline

Storing the password is a security risk because it is stored in clear text.

pgpass.conf has the correct values in it.

pgpass.conf is working with the psql console but not with the pgagent within the pgAdmin.

if i look at pg_dump and pg_dumpall in the task manager, they are running forever.



Vibhor_K

Senior member
[Avatar]

Joined: 3 Jul 2009 09:46:15
Messages: 444
Offline

Storing the password is a security risk because it is stored in clear text.

pgpass.conf file also stored password as normal text.

pgpass.conf is working with the psql console but not with the pgagent within the pgAdmin


Please check the eventlog, since psql is able to access the pgpass.conf file, then pgagent should also.

if i look at pg_dump and pg_dumpall in the task manager, they are running forever.


How have you scheduled the backups? Is it running as user, which has pgpass.conf file in its %APPDATA%\postgresql directory.

This message was edited 1 time. Last update was at 14 Jan 2010 17:54:11


Thanks & Regards,
Vibhor Kumar
Blog:http://vibhork.blogspot.com
[Email] [WWW]
Aashish_Rathod

New member

Joined: 11 Jan 2010 19:09:48
Messages: 8
Offline

the pgpass.conf file is stored in the user's home directory and so is in a fairly secure location.

Besides, this is the way that the POSTGRESQL developers specify is the best practice. They do not recommend storing the password in the manner you described.

The eventlog does not have any entries for the event. i know this because i scheduled backups at 10, 11, 12, 13, 14, 15, 16, and 17 o clock.

pg_dump and pg_dumpall are running in the task manager but they are not doing anything.

if i specify the trust option in the pg_hba file, then there is no problem.

Can i ask you if it is working on your laptop? i understand that it 'should' work but it is not working as advertised on my laptop. furthermore, it seems that other users have had this problem in the past.
Aashish_Rathod

New member

Joined: 11 Jan 2010 19:09:48
Messages: 8
Offline

as for scheduling the backups, it is running under the local postgre account. if i use pg_hba and specify trust rather than md5, there is no problem.
Vibhor_K

Senior member
[Avatar]

Joined: 3 Jul 2009 09:46:15
Messages: 444
Offline

Besides, this is the way that the POSTGRESQL developers specify is the best practice.

True. Best Practice is keeping pgpass.
They do not recommend storing the password in the manner you described.

It's an option (not recommendation).
I thought laptop is personal and login-password is with the the person who is owner.
Can i ask you if it is working on your laptop?

It is working fine on my windows XP.

This message was edited 1 time. Last update was at 14 Jan 2010 20:01:44


Thanks & Regards,
Vibhor Kumar
Blog:http://vibhork.blogspot.com
[Email] [WWW]
Aashish_Rathod

New member

Joined: 11 Jan 2010 19:09:48
Messages: 8
Offline

i don't know what to tell you except it is not working out of box and following instructions that they provide.

can i give you any other information?
Vibhor_K

Senior member
[Avatar]

Joined: 3 Jul 2009 09:46:15
Messages: 444
Offline

Summarizing the steps of pageant schedule:

1. Login to system as test_user (On your machine you can use your user):

Please create a pgpass.conf file in test_user %APPDATA%\postgresql directory:

entry for pgpass.conf should be as given below:
hostname:port:database:username:password

2. Connect to database as given below:
C:\”Program Files”\PostgresPlus\8.4\bin\psql.exe -U postgres
(Above command will also verify that pgpass.conf is used by the psql command or not)
3. After connecting to database, create plpgsql language as given below:
CREATE LANGUAGE plpgsql;
4. Now, run the pgagent.sql file.

5. Create pgAgent service, as given below:
pgagent.exe INSTALL pgAgent -u test_user -p test hostaddr=<host> dbname=<dbname> user=<username>

3. Start the created service using following command:
net start pgAgent

4. While Creating job, Please keep the output of following command in “Host Agent” field of “pgAgent Job” window:

select jagstation from pgagent.pga_jobagent;

Above steps are tested on My machine and working fine and I hope this would help.

Thanks & Regards,
Vibhor Kumar
Blog:http://vibhork.blogspot.com
[Email] [WWW]
Aashish_Rathod

New member

Joined: 11 Jan 2010 19:09:48
Messages: 8
Offline

sorry, i can't get this to work. really disappointed as it makes me wonder what else does not work and as such can't recommend it to others.

i'll just switch the pg_hba file to trust mode.
 
Forum Index » Standard Server
Go to:   
Powered by JForum 2.1.8 © JForum Team