vBulletin Search Engine Optimization
| |||||||
| Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| Hello, I'm trying to run pg_dump programmatically, and I'm wondering how I can send it a password. I'm running it with a system() call in a child process, and sending the password in from the parent process on stdin, but somehow pg_dump always finds out how to ask my terminal for a password. How do I fool it? (I need this to work in linux... in python would be preferable too.) Thanks for any advice. - Shaun -- View this message in context: http://www.nabble.com/send-password-....html#a8473174 Sent from the PostgreSQL - hackers mailing list archive at Nabble.com. ---------------------------(end of broadcast)--------------------------- TIP 9: In versions below 8.0, the planner will ignore your desire to choose an index scan if your joining column's datatypes do not match |
| ||||
| shaunc wrote: > Hello, > > I'm trying to run pg_dump programmatically, and I'm wondering how I can send > it a password. > > I'm running it with a system() call in a child process, and sending the > password in from the parent process on stdin, but somehow pg_dump always > finds out how to ask my terminal for a password. How do I fool it? > > (I need this to work in linux... in python would be preferable too.) > > > 1. this is the wrong forum for this question - here we discuss postgresql developments, not usage 2. use a pgpass file, possibly with a PGPASSFILE environment setting as well - see the docs for details. This works on all platforms and should work with anything at all calling pg_dump. 3. In general, the only way to "fool" programs properly this way is to use expect or some equivalent that uses ptys. In this case, it would be overkill. cheers andrew ---------------------------(end of broadcast)--------------------------- TIP 5: don't forget to increase your free space map settings |