Azure PostgreSQL
On This Page
Azure PostgreSQL Database is a relational database service based on the open-source Postgres database engine. It is a fully-managed, enterprise-ready community PostgreSQL database as a service that can handle mission-critical workloads with predictable performance, security, high availability, and dynamic scalability.
You can ingest data from your Azure PostgreSQL database using Hevo Pipelines and replicate it to a Destination of your choice.
Prerequisites
-
IP address or host name of your PostgreSQL database instance is available.
-
The PostgreSQL version is 9.5 or higher.
-
Log-based incremental replication is enabled, if Pipeline mode is Logical Replication.
-
SELECT, USAGE, and CONNECT privileges are granted to the database user.
-
Database hostname and port number of the Source instance are available.
Perform the following steps to configure your Azure PostgreSQL Source:
Create a Read Replica (Optional)
To use an existing read-replica or connect Hevo to your master database, skip to Set up Log-based Incremental Replication section.
To create a read-replica:
-
Log in to the Azure Portal.
-
Under Recent resources, select the database for which you want to create a read-replica.
-
Under Settings, click Replication, and then, click + Add Replica.
-
In the Server name field, specify a unique name for the replica server and click OK.
A notification is displayed to confirm that the read-replica was created successfully.
Set up Log-based Incremental Replication
Hevo supports data ingestion from PostgreSQL servers via Write Ahead Logs set at the logical level (available on PostgreSQL version 9.4). A Write Ahead Log(WAL) is a collection of log files that record information about data modifications and data object modifications made on a PostgreSQL server instance. Typically WAL is used for data replication and data recovery.
By default, replication method is set to REPLICA. You must change this to LOGICAL.
To do this:
-
Access the Microsoft Azure Portal.
-
Under Settings, click Replication.
-
In the right pane, select replication support as LOGICAL.
-
Click Save.
-
Click YES in the confirmation dialog to restart the Postgres server for the parameter changes to take effect.
-
Confirm under Notifications that your changes have been applied and server has restarted successfully before running the Pipeline, to avoid errors.
Whitelist Hevo’s IP Addresses
You need to whitelist the Hevo IP addresses for your region to enable Hevo to connect to your PostgreSQL database. You can do this by creating firewall rules in your Microsoft Azure database settings as follows:
-
Access the Azure Portal.
-
Under Resources, select the database you want to synchronize with Hevo.
-
Under Settings, click Connection security.
-
Create a Firewall Rule:
-
Specify a firewall rule Name.
-
Specify Hevo’s IP addresses in the Start IP and End IP fields as per your region.
Note: As Hevo has specific IP addresses and not a range, the value in the Start IP and End IP fields is the same.
-
-
Click Save.
-
Repeat this step to add the IP address for each applicable Hevo region.
Create a Database User and Grant Privileges
1. Create a database user (optional)
To create a database user, open your Azure PostgreSQL database in your SQL client tool as a user with CREATE
privilege and enter the following command:
CREATE ROLE hevo WITH LOGIN NOSUPERUSER INHERIT CREATEDB CREATEROLE REPLICATION PASSWORD '<password>';
Note: Replace password
above with a password of your choice.
2. Grant privileges to the user
The database user specified in the Hevo Pipeline must have the following privileges:
-
SELECT
-
USAGE
-
CONNECT
To assign this privileges:
-
Log in to your Microsoft Azure PostgreSQL database as a user with
admin
privilege. -
Enter the following commands to give accesses to the database user:
GRANT CONNECT ON DATABASE <database_name> to hevo; GRANT USAGE ON SCHEMA <schema_name> TO hevo;
-
Alter the schema’s default privileges to grant
SELECT
privileges on tables to the database userALTER DEFAULT PRIVILEGES IN SCHEMA <schema_name> GRANT SELECT ON TABLES to hevo; GRANT SELECT ON ALL TABLES IN SCHEMA <schema_name> TO hevo;
Retrieve the Hostname and Port Number (Optional)
Note: The Azure PostgreSQL hostnames start with your database name and end with azure.com.
For example:
Host : postgres.database.azure.com
Port : 5432
To retrieve the hostname:
-
Log in to the Microsoft Azure Portal.
-
Under Recent resources, select your Azure Database for PostgreSQL server.
-
In the Essentials panel, locate the Server name. Use this Server name as the hostname in Hevo while creating your Pipeline.
The default port is 5432.
Limitations
-
Login using SSL is enabled by default. You can disable it as follows:
-
Under Settings, click Connection security.
-
In SSL Settings on the right, set the toggle option for Enforce SSL connection to DISABLED.
-
Click Save.
-
-
The data type Array in the Source is automatically mapped to Varchar at the Destination. No other mapping is currently supported.
See Also
Revision History
Refer to the following table for the list of key updates made to this page:
Date | Release | Description of Change |
---|---|---|
Jan-24-2022 | 1.80 | Removed from Limitations that Hevo does not support UUID datatype as primary key. |
Sep-09-2021 | 1.71 | Updated the section, Limitations to include information about columns with the UUID data type not being supported as a primary key. |
Sep-06-2021 | NA | Updated the section, Limitations to remove the mention of SSL login not being supported, as it is supported now. |
Feb-22-2021 | 1.57 | Added sections: - Create a Read Replica - Create a User and Grant Privileges - Retrieve the Hostname and Port Number. |