PostgreSQL Dump

S

Saravanan Krishnan

Hi all,

I'm using following command to take dump from my sql database.

pg_dump -h localhost -U postgres dbname > dump.sql

Whenever i trying to run this command in command prompt, it always
asking password.

Here my query is,

if i write this command in a separate ruby file how can i give password
in that command.

in my sql, we can use
mysqldump -h #{host} -u #{user} -p#{pwd} dbname > dump.sql
if use like that it wont ask password anymore. but how is it possible in
postgres.


Thanks in Advance
Saravanan K
 
S

Saravanan Krishnan

Saravanan said:
Hi all,

I'm using following command to take dump from my sql database.

pg_dump -h localhost -U postgres dbname > dump.sql

Whenever i trying to run this command in command prompt, it always
asking password.

Here my query is,

if i write this command in a separate ruby file how can i give password
in that command.

in my sql, we can use
mysqldump -h #{host} -u #{user} -p#{pwd} dbname > dump.sql
if use like that it wont ask password anymore. but how is it possible in
postgres.


Thanks in Advance
Saravanan K


Hi folks,,

I fixed that issue thanks
refered link
http://www.postgresql.org/docs/8.1/static/libpq-pgpass.html

Thanks
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,482
Members
44,901
Latest member
Noble71S45

Latest Threads

Top