Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to use pg_dump with a connection uri / url?

I can invoke psql like this:

psql postgres://... 

How can I use pg_dump with a connection string in the format postgres://...?
Would be more convenient than breaking URI's into host, post, username, password.

Is there syntax for this?

like image 648
Tronathan Avatar asked Mar 13 '15 18:03

Tronathan


1 Answers

pg_dump postgres://username:password@my_postgres_server:5432/databasename 

I just downloaded a dump using this format. Optionally you can add -f filename to specify a local filename.

like image 55
Jorge Diaz Avatar answered Dec 01 '22 15:12

Jorge Diaz