David Parsonson
David Parsonson

Reputation: 575

pg_dump from azure hosted postgres server

Is it possible to remotely run a pg_dump on an azure hosted postgresql server. The microsoft documentation around this is specifically for running pg_restore after creating a backup of a local db (https://learn.microsoft.com/en-us/azure/postgresql/howto-migrate-using-dump-and-restore) When I initially attempted to run the script like so:

pg_dump -Fc -v --host=test.postgress.database.azure.com --port=5432 --username=test@test --dbname=test > testdmp.sql

The following error was returned:

pg_dump: [archiver (db)] connection to database "test" failed: could not translate host name "test.postgress.database.azure.com" to address: Unknown host

Wondering where I might be going wrong here or if this is something that is possible.

Upvotes: 4

Views: 5091

Answers (1)

Mike Ubezzi
Mike Ubezzi

Reputation: 1027

For your Azure Databases for PostgreSQL, you need to explicitly allow connections from specific IP Addresses in the Firewall rules settings:

Navigate to 'Instance Name' - Connection security under the SETTINGS menu:

enter image description here

And then add the client host IP address for the client host you are attempting to run the pg_dump command from, in the Firewall rules:

enter image description here

Upvotes: 4

Related Questions