Re: pg_dump

From: David Saracini <dsaracini(at)yahoo(dot)com>
To: Josh Kupershmidt <schmiddy(at)gmail(dot)com>
Cc: pgsql novice forum <pgsql-novice(at)postgresql(dot)org>
Subject: Re: pg_dump
Date: 2009-08-27 01:48:24
Message-ID: 787237.34430.qm@web180308.mail.gq1.yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

Josh,

Thank you for the reply... I appreciate it.

I should have noted below that I am on Windows.

Yes; the topic has been discussed several times and in several places. And I think that I have read almost all of it (at least a major portion).

What I would like to avoid is having the password in plain text on the disk (via a batch file, pgpass.conf, etc.). Plus, from the documentation, using a system variable is deprecated and has security issues. (Just a note, I never got this method to work anyway via C# and the Process class).

And yes, I do understand that if I put it in my source code, it is still on the disk. But, that is going to be on a server (harder to get to...) and also, I can keep it in an encrypted resource and just unencrypt in memory when I need it.

BTW, I do get that this is not totally secure either. Any security measure can be broken once the user has the exe/dll and control of the box that code is running on. But, IMHO, it would certainly be better than that having it unencrypted on disk - or making my end user try to protect the password via Windows' file/directory security.

I guess what I'm wishing for is that pg_dumb was changed to where the password could be sent via the command line. I've seen this requested multiple times and it's always been just rejected. I'm not sure why. Anyone know? If so, could you reply? It *seems* like a minor change. At least it would be in my code and in C#, but... I don't know about pg_dump/pgsql. It might be much, much more difficult. (???)

So, to recap, what I'm learning is that the best way to do this is to dynamically create a batch file, then exec it and get the exitcode via %errorlevel%. Then *try* to make sure I delete it.

Correct?

Thanks again for the help.

David

________________________________
From: Josh Kupershmidt <schmiddy(at)gmail(dot)com>
To: David Saracini <dsaracini(at)yahoo(dot)com>
Cc: pgsql novice forum <pgsql-novice(at)postgresql(dot)org>
Sent: Tuesday, August 25, 2009 6:46:27 AM
Subject: Re: [NOVICE] pg_dump

On Fri, Aug 21, 2009 at 12:58 AM, David Saracini<dsaracini(at)yahoo(dot)com> wrote:
> Ultimately, what I would like is to have my app server kick off every night
> at a configurable time and save a backup to a configurable location. Any
> advice on how to accomplish this and do it without writing the password to
> disk?

Depends on what you mean by "without writing the password to disk" (do you not
want the password hardcoded into your source code, do you not want a
.pgpass file,
do you not want it in a crontab or .bat file -- you'll have to have
the password
*somewhere*), and on what platform you're on. If you're on Windows,
see the backup
guide here:
http://wiki.postgresql.org/wiki/Automated_Backup_on_Windows

This topic has also been discussed in numerous other places, e.g.
http://archives.postgresql.org/pgsql-php/2005-04/msg00007.php
http://almosteffortless.com/2008/10/29/postgresql-backup-tips-for-n00bz/

- Josh

In response to

  • Re: pg_dump at 2009-08-25 13:46:27 from Josh Kupershmidt

Responses

Browse pgsql-novice by date

  From Date Subject
Next Message Tom Lane 2009-08-27 01:52:37 Re: pg_dump
Previous Message Shane Ambler 2009-08-26 19:53:03 Re: Install new perl test function in PostgreSQL