N
N
Neuro2019-06-26 15:06:20
PostgreSQL
Neuro, 2019-06-26 15:06:20

How to dump a remote postgresql database?

There is a remote database, I know the address where it is located, username and userpassword, how can I copy this database and transfer it to my local database?
I am writing this dump

pg_dump -h 193.122.1.173:34426 -U postgres -F p -f /test/dumploc test-qa

but it gives me the following response
pg_dump: [archiver (db)] connection to database "test-qa" failed: could not translate host name "193.122.1.173:34426" to address: nodename nor servname provided, or not known

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
Dmitry Shitskov, 2019-06-26
@Riveran

pg_dump -h 193.122.1.173 -p 34426 -U postgres -F p -f /test/dumploc test-qa

P
Pavel Mezhuev, 2019-06-26
@mezhuev

man pg_dump:

-h host
--host=host
Specifies the host name of the machine on which the server is running. If the value begins with a slash, it is used as the directory for the Unix domain socket. The default is taken from the PGHOST environment variable, if set, else a Unix domain socket connection is attempted.
-p port
--port=port
Specifies the TCP port or local Unix domain socket file extension on which the server is listening for connections. Defaults to the PGPORT environment variable, if set, or a compiled-in default.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question