Module Contents



Executes sql code in a specific Postgres database.

class airflow.providers.postgres.operators.postgres.PostgresOperator(*, postgres_conn_id='postgres_default', database=None, runtime_parameters=None, **kwargs)[source]

Bases: airflow.providers.common.sql.operators.sql.SQLExecuteQueryOperator

Executes sql code in a specific Postgres database.

This class is deprecated.

Please use airflow.providers.common.sql.operators.sql.SQLExecuteQueryOperator.

  • sql – the SQL code to be executed as a single string, or a list of str (sql statements), or a reference to a template file. Template references are recognized by str ending in ‘.sql’

  • postgres_conn_id (str) – The postgres conn id reference to a specific postgres database.

  • autocommit – if True, each command is automatically committed. (default value: False)

  • parameters – (optional) the parameters to render the SQL query with.

  • database (str | None) – name of database which overwrite defined one in connection

  • runtime_parameters (Mapping | None) – a mapping of runtime params added to the final sql being executed. For example, you could set the schema via {“search_path”: “CUSTOM_SCHEMA”}. Deprecated - use hook_params={‘options’: ‘-c <connection_options>’} instead.

ui_color = '#ededed'[source]

Was this entry helpful?