I have two solutions that might help.
PHP:
system("echo -n -e \"".$password."\n\" | pg_dump -W --host=".$host."
-U ".$user." ".$database." > ".$backup_file,$output);
Try replacing pg_dump command with "psql -d database -U user"
BASH:
PGDATABASE=database
PGUSER=user
PGPASSWORD=password
export PGUSER PGPASSWORD
HTH,
Burak
On 2/14/07, Neil Aggarwal <neil@jammconsulting.com> wrote:
> Hello:
>
> I have several scripts I would like to run against a database.
>
> With mysql, I can pass the password to the database in
> the command line call to the terminal client.
>
> Is there a way to do that with psql?
>
> There is no corresponding user account for
> the database user account.
>
> Thanks,
> Neil
>
>
> --
> Neil Aggarwal, (214)986-3533, www.JAMMConsulting.com
> FREE! Eliminate junk email and reclaim your inbox.
> Visit http://www.spammilter.com for details.
>
>
> ---------------------------(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
>