Skip to content

Commit 22b6439

Browse files
authored
Merge pull request #88637 from linda33wj/master
Add Azure Database for PostgreSQL as sink in ADF
2 parents d6d5b5c + 275ef80 commit 22b6439

File tree

4 files changed

+56
-10
lines changed

4 files changed

+56
-10
lines changed

articles/data-factory/connector-azure-database-for-mysql.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -190,8 +190,7 @@ To copy data to Azure Database for MySQL, the following properties are supported
190190
| type | The type property of the copy activity sink must be set to: **AzureMySqlSink** | Yes |
191191
| preCopyScript | Specify a SQL query for the copy activity to execute before writing data into Azure Database for MySQL in each run. You can use this property to clean up the preloaded data. | No |
192192
| writeBatchSize | Inserts data into the Azure Database for MySQL table when the buffer size reaches writeBatchSize.<br>Allowed value is integer representing number of rows. | No (default is 10,000) |
193-
| writeBatchTimeout | Wait time for the batch insert operation to complete before it times out.<br>
194-
Allowed values are Timespan. An example is 00:30:00 (30 minutes). | No (default is 00:00:30) |
193+
| writeBatchTimeout | Wait time for the batch insert operation to complete before it times out.<br>Allowed values are Timespan. An example is 00:30:00 (30 minutes). | No (default is 00:00:30) |
195194

196195
**Example:**
197196

articles/data-factory/connector-azure-database-for-postgresql.md

Lines changed: 52 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
2-
title: Copy data from Azure Database for PostgreSQL using Azure Data Factory | Microsoft Docs
3-
description: Learn how to copy data from Azure Database for PostgreSQL to supported sink data stores by using a copy activity in an Azure Data Factory pipeline.
2+
title: Copy data to and from Azure Database for PostgreSQL using Azure Data Factory | Microsoft Docs
3+
description: Learn how to copy data to and from Azure Database for PostgreSQL by using a copy activity in an Azure Data Factory pipeline.
44
services: data-factory
55
documentationcenter: ''
66
author: linda33wj
@@ -12,22 +12,24 @@ ms.workload: data-services
1212
ms.tgt_pltfrm: na
1313

1414
ms.topic: conceptual
15-
ms.date: 02/01/2019
15+
ms.date: 09/16/2019
1616
ms.author: jingwang
1717

1818
---
19-
# Copy data from Azure Database for PostgreSQL using Azure Data Factory
19+
# Copy data to and from Azure Database for PostgreSQL using Azure Data Factory
2020

2121
This article outlines how to use the Copy Activity in Azure Data Factory to copy data from Azure Database for PostgreSQL. It builds on the [copy activity overview](copy-activity-overview.md) article that presents a general overview of copy activity.
2222

23+
This connector is specialized for [Azure Database for PostgreSQL service](../postgresql/overview.md). To copy data from generic PostgreSQL database located on-premises or in the cloud, use [PostgreSQL connector](connector-postgresql.md).
24+
2325
## Supported capabilities
2426

2527
This Azure Database for PostgreSQL connector is supported for the following activities:
2628

2729
- [Copy activity](copy-activity-overview.md) with [supported source matrix](copy-activity-overview.md)
2830
- [Lookup activity](control-flow-lookup-activity.md)
2931

30-
You can copy data from Azure Database for PostgreSQL to any supported sink data store. For a list of data stores that are supported as sources/sinks by the copy activity, see the [Supported data stores](copy-activity-overview.md#supported-data-stores-and-formats) table.
32+
You can copy data from Azure Database for PostgreSQL to any supported sink data store. Or, you can copy data from any supported source data store to Azure Database for PostgreSQL. For a list of data stores that are supported as sources/sinks by the copy activity, see the [Supported data stores](copy-activity-overview.md#supported-data-stores-and-formats) table.
3133

3234
Azure Data Factory provides a built-in driver to enable connectivity, therefore you don't need to manually install any driver using this connector.
3335

@@ -167,6 +169,51 @@ To copy data from Azure Database for PostgreSQL, set the source type in the copy
167169
}
168170
]
169171
```
172+
173+
### Azure Database for PostgreSQL as sink
174+
175+
To copy data to Azure Database for PostgreSQL, the following properties are supported in the copy activity **sink** section:
176+
177+
| Property | Description | Required |
178+
|:--- |:--- |:--- |
179+
| type | The type property of the copy activity sink must be set to: **AzurePostgreSQLSink** | Yes |
180+
| preCopyScript | Specify a SQL query for the copy activity to execute before writing data into Azure Database for PostgreSQL in each run. You can use this property to clean up the preloaded data. | No |
181+
| writeBatchSize | Inserts data into the Azure Database for PostgreSQL table when the buffer size reaches writeBatchSize.<br>Allowed value is integer representing number of rows. | No (default is 10,000) |
182+
| writeBatchTimeout | Wait time for the batch insert operation to complete before it times out.<br>Allowed values are Timespan. An example is 00:30:00 (30 minutes). | No (default is 00:00:30) |
183+
184+
**Example:**
185+
186+
```json
187+
"activities":[
188+
{
189+
"name": "CopyToAzureDatabaseForPostgreSQL",
190+
"type": "Copy",
191+
"inputs": [
192+
{
193+
"referenceName": "<input dataset name>",
194+
"type": "DatasetReference"
195+
}
196+
],
197+
"outputs": [
198+
{
199+
"referenceName": "<Azure PostgreSQL output dataset name>",
200+
"type": "DatasetReference"
201+
}
202+
],
203+
"typeProperties": {
204+
"source": {
205+
"type": "<source type>"
206+
},
207+
"sink": {
208+
"type": "AzurePostgreSQLSink",
209+
"preCopyScript": "<custom SQL script>",
210+
"writeBatchSize": 100000
211+
}
212+
}
213+
}
214+
]
215+
```
216+
170217
## Lookup activity properties
171218

172219
To learn details about the properties, check [Lookup activity](control-flow-lookup-activity.md).

includes/data-factory-v2-connector-overview.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ ms.author: jingwang
1616
| &nbsp; | [Azure Data Lake Storage Gen2](../articles/data-factory/connector-azure-data-lake-storage.md) | ✓/✓ | ✓ <br> <small>Supported Formats: Delimited Text, Parquet</small> ||||
1717
| &nbsp; | [Azure Database for MariaDB](../articles/data-factory/connector-azure-database-for-mariadb.md) | ✓/− | || | |
1818
| &nbsp; | [Azure Database for MySQL](../articles/data-factory/connector-azure-database-for-mysql.md) | ✓/✓ | || | |
19-
| &nbsp; | [Azure Database for PostgreSQL](../articles/data-factory/connector-azure-database-for-postgresql.md) | ✓/ | || | |
19+
| &nbsp; | [Azure Database for PostgreSQL](../articles/data-factory/connector-azure-database-for-postgresql.md) | ✓/ | || | |
2020
| &nbsp; | [Azure File Storage](../articles/data-factory/connector-azure-file-storage.md) | ✓/✓ | ||||
2121
| &nbsp; | [Azure SQL Database](../articles/data-factory/connector-azure-sql-database.md) | ✓/✓ |||| |
2222
| &nbsp; | [Azure SQL Database Managed Instance](../articles/data-factory/connector-azure-sql-database-managed-instance.md) | ✓/✓ | ||| |

includes/data-factory-v2-supported-data-stores.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ services: data-factory
55
author: linda33wj
66
ms.service: data-factory
77
ms.topic: include
8-
ms.date: 08/30/2019
8+
ms.date: 09/16/2019
99
ms.author: jingwang
1010
ms.custom: include file
1111
---
@@ -20,7 +20,7 @@ ms.custom: include file
2020
| &nbsp; |[Azure Data Lake Storage Gen2](../articles/data-factory/connector-azure-data-lake-storage.md) |||||
2121
| &nbsp; |[Azure Database for MariaDB](../articles/data-factory/connector-azure-database-for-mariadb.md) || |||
2222
| &nbsp; |[Azure Database for MySQL](../articles/data-factory/connector-azure-database-for-mysql.md) |||||
23-
| &nbsp; |[Azure Database for PostgreSQL](../articles/data-factory/connector-azure-database-for-postgresql.md) || |||
23+
| &nbsp; |[Azure Database for PostgreSQL](../articles/data-factory/connector-azure-database-for-postgresql.md) || |||
2424
| &nbsp; |[Azure File Storage](../articles/data-factory/connector-azure-file-storage.md) |||||
2525
| &nbsp; |[Azure SQL Database](../articles/data-factory/connector-azure-sql-database.md) |||||
2626
| &nbsp; |[Azure SQL Database Managed Instance](../articles/data-factory/connector-azure-sql-database-managed-instance.md) |||||

0 commit comments

Comments
 (0)