PostgresOperator

Postgres

Executes sql code in a specific Postgres database

View Source

Last Updated: May. 7, 2021

Access Instructions

Install the Postgres provider package into your Airflow environment.

Import the module into your DAG file and instantiate it with your desired params.

Parameters

sqlCan receive a str representing a sql statement, a list of str (sql statements), or reference to a template file. Template reference are recognized by str ending in '.sql'the sql code to be executed. (templated)
postgres_conn_idstrreference to a specific postgres database
autocommitboolif True, each command is automatically committed. (default value: False)
parametersdict or iterable(optional) the parameters to render the SQL query with.
databasestrname of database which overwrite defined one in connection

Documentation

Executes sql code in a specific Postgres database

Was this page helpful?