pg_dump password

From: "Erick Ruiz" <erick(at)upn(dot)mx>
To: <pgsql-admin(at)postgresql(dot)org>
Subject: pg_dump password
Date: 2008-01-15 22:56:15
Message-ID: 009301c857c9$d578b5c0$806a2140$@mx
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

I didn't understand how to insert a password into pg_dump command line.

So I write this steps for insert password on pg_dump.

1) Connect to postgres user
[root(at)]# su - postgres

2) Create a .pgpass file
Bash$ vi .pgpass
( it contains a single line like
http://www.postgresql.org/docs/8.2/interactive/libpq-pgpass.html mention it)
*:5432:database:username:password

Bash$ chmod 600 .pgpass
(also I change this file to being used by postgres, with chown
postgres.postgres .pgpass, I don't know if it works with root)

3) The postgres dump command line
Bash$ /usr/bin/pg_dump database > /var/lib/pgsql/backups/bkup.sql

For finish the test, I will put the line into a crontab or script.

But is the same for pg_dumpall? Or I need to create another line into
.pgpass file? I'll try.

Thanks

Lic. Erick Ruiz Rojas


-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (MingW32)

iD8DBQFHjToOkrJZgd43jJ4RAt7CAKDKyUYI24U+U99XzEKjPgbqJGF6JwCfTsMm
BfGPBXqwcEzsUW4venBVe0c=
=wPGs
-----END PGP SIGNATURE-----

Attachment Content-Type Size
PGPexch.htm text/html 6.1 KB

Browse pgsql-admin by date

  From Date Subject
Next Message Tom Lane 2008-01-15 23:49:34 Re: backup WAL files,
Previous Message Tom Davies 2008-01-15 22:48:45 Re: backup WAL files,