Uploaded image for project: 'Apache Airflow'
  1. Apache Airflow
  2. AIRFLOW-4734

Upsert functionality for PostgresHook.insert_rows()

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Minor
    • Resolution: Implemented
    • 1.10.3
    • 2.0.0
    • hooks

    Description

      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)

      Attachments

        Activity

          People

            oxymor0n William Tran
            oxymor0n William Tran
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Time Tracking

                Estimated:
                Original Estimate - 48h
                48h
                Remaining:
                Remaining Estimate - 48h
                48h
                Logged:
                Time Spent - Not Specified
                Not Specified