Script Development / PostgreSQL
The PostgreSQL connector operation object primarily provides methods for operating PostgreSQL. This connector supports the following databases:
- Greenplum Database
- Alibaba Cloud PolarDB MySQL
- Alibaba Cloud AnalyticDB (ADB) PostgreSQL Edition
The parameters for DFF.CONN(...) are as follows:
| Parameter | Type | Required / Default | Description |
|---|---|---|---|
connector_id |
str | Required | Connector ID |
database |
str | None |
Specify database |
.query(...)
Execute SQL statement, parameters are as follows:
| Parameter | Type | Required / Default | Description |
|---|---|---|---|
sql |
str | Required | SQL statement, which can contain parameter placeholders.? indicates a parameter that needs escaping;?? indicates a parameter that does not need escaping |
sql_params |
list | None |
SQL parameters |
| Example | |
|---|---|
1 2 3 | |
Dynamic SQL Statement
query(...) and non_query(...) internally use DFF.SQL(...) to construct SQL statements and support constructing complex dynamic SQL statements.
Such as WHERE IN (...) with an uncertain number of values, or INSERT INTO ... VALUES ... for batch data insertion, etc.
For details, please refer to Script Development / SQL Construction DFF.SQL