Script Development / PostgreSQL
The PostgreSQL connector operation object mainly provides some methods for operating PostgreSQL. This connector supports the following databases:
- Greenplum Database
- Alibaba Cloud PolarDB MySQL
- Alibaba Cloud AnalyticDB (ADB) PostgreSQL Edition
DFF.CONN(...)
parameters are as follows:
Parameter | Type | Required / Default Value | Description |
---|---|---|---|
connector_id |
str | Required | Connector ID |
database |
str | None |
Specified database |
.query(...)
Executes an SQL statement, with parameters as follows:
Parameter | Type | Required / Default Value | Description |
---|---|---|---|
sql |
str | Required | SQL statement, may include parameter placeholders.? indicates an escaped parameter;?? indicates a non-escaped parameter |
sql_params |
list | None |
SQL parameters |
Example | |
---|---|
1 2 3 |
|
Dynamic SQL Statement
query(...)
and non_query(...)
use DFF.SQL(...)
internally to construct SQL statements and support building complex dynamic SQL statements.
For example, when there is an uncertain number of values in WHERE IN (...)
, or performing bulk data insertion using INSERT INTO ... VALUES ...
.
For more details, please refer to Script Development / SQL Construction DFF.SQL