Skip to content

question reg usage of functional index as a on_conflict target #248

@AlekseiKhatkevich

Description

@AlekseiKhatkevich

Hi
I have a functional index, like for example:

models.UniqueConstraint(fields=('field1', 'field2', Coalesce(F('field_3'), -1),
                                    name='uniq_index_name),

How can i use it as a targed for on_conflict clause?

AS 4 now it throws an exception
django.core.exceptions.SuspiciousOperation: Coalesce(F(field_3), Value(-1)) is not a valid conflict target, specify a list of column names, or tuples with column names and hstore key.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions