You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "William Tran (JIRA)" <ji...@apache.org> on 2019/06/04 23:15:00 UTC

[jira] [Created] (AIRFLOW-4734) Upsert functionality for PostgresHook.insert_rows()

William Tran created AIRFLOW-4734:
-------------------------------------

             Summary: Upsert functionality for PostgresHook.insert_rows()
                 Key: AIRFLOW-4734
                 URL: https://issues.apache.org/jira/browse/AIRFLOW-4734
             Project: Apache Airflow
          Issue Type: Improvement
          Components: hooks
    Affects Versions: 1.10.3
            Reporter: William Tran
            Assignee: William Tran
             Fix For: 1.10.4


PostgresHook's parent class, DbApiHook, implements upsert in its insert_rows() method with the replace=True flag. However, the underlying generated SQL is specific to MySQL's "REPLACE INTO" syntax and is not applicable to Postgres.

I'd like to override this method in PostgresHook to implement the "INSERT ... ON CONFLICT DO UPDATE" syntax (new since Postgres 9.5)



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)