问题
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