Thread: ~/pgpass
I tried the password file and could not get it to work on both Windows XP and Fedora Core 4. ~/pgpass permission is 0600 on Fedora and I tested using psql and pg_dump commands. The two commands prompted for password and target database which I expected should not be. Please, I seek for clarification under what context is the ~/pgpass or pgpass.conf file used? Thanks Tope Akinniyi Lagos Nigeria.
On Sun, Aug 14, 2005 at 08:36:17PM +0100, Oluwatope Akinniyi wrote: > I tried the password file and could not get it to work on both Windows > XP and Fedora Core 4. > > ~/pgpass permission is 0600 on Fedora and I tested using psql and > pg_dump commands. The two commands prompted for password and target > database which I expected should not be. It's ~/.pgpass the dot is important... -- Martijn van Oosterhout <kleptog@svana.org> http://svana.org/kleptog/ > Patent. n. Genius is 5% inspiration and 95% perspiration. A patent is a > tool for doing 5% of the work and then sitting around waiting for someone > else to do the other 95% so you can sue them.
Attachment
Martijn van Oosterhout <kleptog@svana.org> wrote: >> It's ~/.pgpass the dot is important. > > Thanks. Just a typo error in the mail. I did put the dot in the file name. The file on Fedora is ~/.pgpass and on Windows it is in %APPDATA%/postgresql as pgpass.conf. It did not work in Windows and Fedora. Tope Akinniyi
Oluwatope Akinniyi <tope.akinniyi@shepherdhill.biz> schrieb: > Martijn van Oosterhout <kleptog@svana.org> wrote: > > >> It's ~/.pgpass the dot is important. > > > > > > Thanks. Just a typo error in the mail. > > I did put the dot in the file name. The file on Fedora is ~/.pgpass and on > Windows it is in %APPDATA%/postgresql as pgpass.conf. > > It did not work in Windows and Fedora. On Fedora: wrong file permissions? Btw.: ~/.pgpass is only supported in 7.3 and later. Andreas -- Diese Message wurde erstellt mit freundlicher Unterstützung eines freilau- fenden Pinguins aus artgerechter Freilandhaltung. Er ist garantiert frei von Micro$oft'schen Viren. (#97922 http://counter.li.org) GPG 7F4584DA Was, Sie wissen nicht, wo Kaufbach ist? Hier: N 51.05082°, E 13.56889° ;-)
Andreas wrote: > On Fedora: wrong file permissions? > Btw.: ~/.pgpass is only supported in 7.3 and later. Thanks. The permission is 0600 on Fedora. But must the file (~/.pgpass) be owned by postgres? Also what could explain the reasonwhy it is not working on Windows XP where permission is not checked! I am running version 8.0.3 that is shipped with Fedora Core 4. The content of both ~/.pgpass and pgpass.conf is: 192.168.0.253:5432:hms:xxxxxx Best regards. Tope Akinniyi Lagos.
> > On Fedora: wrong file permissions? > > Btw.: ~/.pgpass is only supported in 7.3 and later. > > Thanks. > > The permission is 0600 on Fedora. But must the file > (~/.pgpass) be owned by postgres? Also what could explain the > reason why it is not working on Windows XP where permission > is not checked! > > I am running version 8.0.3 that is shipped with Fedora Core 4. > > The content of both ~/.pgpass and pgpass.conf is: > > 192.168.0.253:5432:hms:xxxxxx That's not the correct format. See http://www.postgresql.org/docs/8.0/static/libpq-pgpass.html: hostname:port:database:username:password You are either missing database or userid, depending on what "hms" is. //Magnus
> > >>> > On Fedora: wrong file permissions? >>> > Btw.: ~/.pgpass is only supported in 7.3 and later. >> >> >> >> Thanks. >> >> The permission is 0600 on Fedora. But must the file >> (~/.pgpass) be owned by postgres? Also what could explain the >> reason why it is not working on Windows XP where permission >> is not checked! >> >> I am running version 8.0.3 that is shipped with Fedora Core 4. >> >> The content of both ~/.pgpass and pgpass.conf is: >> >> 192.168.0.253:5432:hms:xxxxxx > > > That's not the correct format. See > http://www.postgresql.org/docs/8.0/static/libpq-pgpass.html: > hostname:port:database:username:password > You are either missing database or userid, depending on what "hms" is. Thank you Sir. Actually I have it on Windows as: shepherd1:5432:hms:sysdba:xxxxx where hms is the database and sysdba the username; On Fedora as: 192.168.0.253:5432:hms:sysdba:xxxxx where hms is the database and sysdba the username; I have a the ~/.pgpass inside the home of user tope (i.e. /home/tope). I tried with $ psql and expected that I will not be prompted for database and password, but it did and I wondered under what context is the Password File used! Thanks for your assistance. Tope Akinniyi Lagos.
On Tue, Aug 16, 2005 at 04:54:15PM +0100, Oluwatope Akinniyi wrote: > On Fedora as: > 192.168.0.253:5432:hms:sysdba:xxxxx > where hms is the database and sysdba the username; > > I have a the ~/.pgpass inside the home of user tope (i.e. /home/tope). > I tried with > > $ psql I wonder if you should be using 127.0.0.1:5432:hms:sysdba:xxxxx instead ... Or rather, change your psql line to be $ psql -h 192.168.0.253 -- Alvaro Herrera (<alvherre[a]alvh.no-ip.org>) "At least to kernel hackers, who really are human, despite occasional rumors to the contrary" (LWN.net)