airflow-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Rafael (JIRA)" <>
Subject [jira] [Created] (AIRFLOW-139) Executing VACUUM with PostgresOperator
Date Thu, 19 May 2016 11:30:13 GMT
Rafael created AIRFLOW-139:

             Summary: Executing VACUUM with PostgresOperator
                 Key: AIRFLOW-139
             Project: Apache Airflow
          Issue Type: Bug
    Affects Versions: Airflow 1.7.0
            Reporter: Rafael

Dear Airflow Maintainers,

### Environment

* Airflow version: *v1.7.0*
* Airflow components: *PostgresOperator*
* Python Version: *Python 3.5.1*
* Operating System: *15.4.0 Darwin*

### Description of Issue

I am trying to execute a `VACUUM` command as part of DAG with the `PostgresOperator`, which
fails with the following error:

[2016-05-14 16:14:01,849] {} INFO - Using executor SequentialExecutor
Traceback (most recent call last):
  File "/usr/local/bin/airflow", line 15, in <module>
  File "/usr/local/Cellar/python3/3.5.1/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/airflow/bin/",
line 203, in run
  File "/usr/local/Cellar/python3/3.5.1/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/airflow/",
line 1067, in run
    result = task_copy.execute(context=context)
  File "/usr/local/lib/python3.5/site-packages/airflow/operators/", line
39, in execute, self.autocommit, parameters=self.parameters)
  File "/usr/local/Cellar/python3/3.5.1/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/airflow/hooks/",
line 109, in run
psycopg2.InternalError: VACUUM cannot run inside a transaction block

I could create a small python script that performs the operation, as explained in [this stackoverflow
However, I would like to know first if the `VACUUM` command should be supported by the `PostgresOperator`.

### Reproducing the Issue

The operator can be declared as follows:

conn = ('postgres_default')
t4 = PostgresOperator(
    sql=("VACUUM public.table"),

This message was sent by Atlassian JIRA

View raw message