How to use pg_dump with a connection uri / url?

痴心易碎 提交于 2020-02-21 07:14:25

问题


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?


回答1:


Apparently it's as simple as this:

pg_dump postgres://username:password@ec2-00-00-100-100.eu-west-1.compute.amazonaws.com:5432/databasename

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



来源:https://stackoverflow.com/questions/29039437/how-to-use-pg-dump-with-a-connection-uri-url

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!