• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Doing a pg_dump in Postgres using Ant - password poblem

 
Paul Smiley
Ranch Hand
Posts: 245
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,
I'm trying to write an Ant target for Postgres to do a backup using the pg_dump exe command - however, it prompts for a password and I see no option for passing in a password. I don't want to have to put 'trust' into the .conf file - is there another way to pass in a password?

Thanks,
Paul

This works fine for mySql:

<exec executable="mysqldump" vmlauncher="false"
output="${db.backup.dir}/${backup.name}">
<arg line="-B ${database.name}"/>
<arg line="-u${db.username}"/>
<arg line="-p${db.password}"/>
<arg value="--all"/>
</exec>
[ July 25, 2006: Message edited by: Paul Smiley ]
 
Tim Holloway
Saloon Keeper
Pie
Posts: 18277
56
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I've got a feeling there's either a missing "-w" in the documentation or something, because unless they're being paranoid (and PostgreSQL often is), I'd expect to see this option.

However, you can probably put the -W option on and set the password to come in via the Ant inputstring attribute.
 
Paul Smiley
Ranch Hand
Posts: 245
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you - yes, the inputstring attribute did it. I missed that one for some reason.
Paul
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic