Using psql, pg_dump, pg_restore in a script
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
- Subject: Using psql, pg_dump, pg_restore in a script
- From: John Scalia <jayknowsunix@xxxxxxxxx>
- Date: Mon, 16 Jun 2014 14:53:20 -0400
- User-agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:24.0) Gecko/20100101 Thunderbird/24.6.0
Hi all,
My latest task requires me to script extracting the latest data from a partitioned table and put it into another database on a different machine on an hourly basis. To do this, the
script uses a psql command to determine which partition to grab, a pg_dump to get it, and pg_restore to put into the other Db. My issue is that I'd like to make this script very
portable but it seems that whenever you pass a "-h <somehost> -U <someuser>" to these commands, they will ask for a password whether "someuser" actually has a password or not. I've
currently set a password for the user the script uses and I'm using .pgpass to make this work, but was there some reason that an option was not given to enter a password as an
argument to the command? Maybe something like --password <somepassword>? I know this could potentially be a security problem, but so is having a password in the .pgpass file in
clear text.
--
Jay
[Index of Archives]
[KVM ARM]
[KVM ia64]
[KVM ppc]
[Virtualization Tools]
[Spice Development]
[Libvirt]
[Libvirt Users]
[Linux USB Devel]
[Linux Audio Users]
[Yosemite Questions]
[Linux Kernel]
[Linux SCSI]
[XFree86]