aspose file tools*
The moose likes Ant, Maven and Other Build Tools and the fly likes Doing a pg_dump in Postgres using Ant - password poblem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Engineering » Ant, Maven and Other Build Tools
Bookmark "Doing a pg_dump in Postgres using Ant - password poblem" Watch "Doing a pg_dump in Postgres using Ant - password poblem" New topic
Author

Doing a pg_dump in Postgres using Ant - password poblem

Paul Smiley
Ranch Hand

Joined: Jun 02, 2000
Posts: 244
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

Joined: Jun 25, 2001
Posts: 16019
    
  20

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.


Customer surveys are for companies who didn't pay proper attention to begin with.
Paul Smiley
Ranch Hand

Joined: Jun 02, 2000
Posts: 244
Thank you - yes, the inputstring attribute did it. I missed that one for some reason.
Paul
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Doing a pg_dump in Postgres using Ant - password poblem