Received: from localhost (unknown [200.46.204.182]) by postgresql.org (Postfix) with ESMTP id 547FF2E309B for ; Tue, 15 Jan 2008 18:56:39 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.182]) (amavisd-maia, port 10024) with ESMTP id 93408-01-2 for ; Tue, 15 Jan 2008 18:56:21 -0400 (AST) Received: from mail.ajusco.upn.mx (mail.ajusco.upn.mx [200.23.113.91]) by postgresql.org (Postfix) with ESMTP id 198AB2E3A06 for ; Tue, 15 Jan 2008 18:56:23 -0400 (AST) Received: from lapredes (v18m58.ajusco.upn.mx [10.20.18.58]) by mail.ajusco.upn.mx (8.13.8/8.13.7) with ESMTP id m0FMuJ4V028537; Tue, 15 Jan 2008 16:56:20 -0600 From: "Erick Ruiz" To: Subject: pg_dump password Date: Tue, 15 Jan 2008 16:56:15 -0600 Message-ID: <009301c857c9$d578b5c0$806a2140$@mx> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_NextPart_000_0094_01C85797.8ADE45C0" X-Mailer: Microsoft Office Outlook 12.0 Thread-index: AchXydCX3++siA2GS9+KNA5nQfn3Xg== Content-Language: es-mx gpgol-version: 0.9.91 X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200801/170 X-Sequence-Number: 27944 Este es un mensaje con varias partes en formato MIME. ------=_NextPart_000_0094_01C85797.8ADE45C0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit -----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@]# 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----- ------=_NextPart_000_0094_01C85797.8ADE45C0 Content-Type: text/html; name="PGPexch.htm" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="PGPexch.htm"

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@]# su – = postgres

 

2)      Create a .pgpass file = (into postgres session)

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

 

 

------=_NextPart_000_0094_01C85797.8ADE45C0 Content-Type: application/pgp-signature; name="PGPexch.htm.asc" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="PGPexch.htm.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.5 (MingW32) iD8DBQBHjToOkrJZgd43jJ4RAmX0AKCmZ1es4BsPlTo6/DC0XsmGRZXZNgCfVjs/ 4EXpLvSwhOzpCIRVWapLlN4= =iPmx -----END PGP SIGNATURE----- ------=_NextPart_000_0094_01C85797.8ADE45C0--