Skip to content

Postgres Sink: support for ON CONFLICT DO NOTHING #1010

@francoishornoy

Description

@francoishornoy

Is your feature request related to a problem? Please describe.
It would be useful to have a ON CONFLICT ... DO NOTHING option. Right now we only have 2 options: upsert or fail on collisions. It's hard to recover when we expect some duplicates once in a while, and rely on a unique constraint on database-side to reject duplicates.

Describe the solution you'd like
A new arg that allows to perform the INSERT with on conflict do nothing. The param could be a str in order to support the various usecases: f"ON CONFLICT {on_conflict_target} DO NOTHING".
Examples

  • ON CONFLICT (pk_col1, pk_col2) DO NOTHING
  • ON CONFLICT ON CONSTRAINT unique_constraint_name DO NOTHING
  • ON CONFLICT DO NOTHING

@gwaramadze @tim-quix FYR.

Metadata

Metadata

Assignees

No one assigned

    Labels

    connectorIssues updating Sinks or SourcesfeatureNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions