Changes between Initial Version and Version 1 of Ticket #35329


Ignore:
Timestamp:
Mar 25, 2024, 3:08:31 PM (3 months ago)
Author:
Simon Charette
Comment:

Thank you for your report Lucas!

Marking as a release blocker since nulls_distinct is a new feature introduced in Django 5.0.

The Postgres docs clearly point that NULLS DISTINCT should come before WHERE, sorry for missing that.

Would you be interested in submitting a PR with the proposed changes? Adding a test should be as simple as taking inspiration from the ones introduced when the feature was added.

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #35329

    • Property Cc Simon Charette added
    • Property Component Error reportingDatabase layer (models, ORM)
    • Property Keywords UniqueConstraint added; UniqueConstrain removed
    • Property Owner set to nobody
    • Property Severity NormalRelease blocker
    • Property Triage Stage UnreviewedAccepted
  • Ticket #35329 – Description

    initial v1  
    55Screenshot 2024-03-25 at 10.47.59.png
    66
    7 When django generate SQL to create a check constraint the result is "... WHERE <condition> NULLS NOT DISTINCT".
     7When django generate SQL to create a check constraint the result is `... WHERE <condition> NULLS NOT DISTINCT`.
    88It raise an exception on Postgresql.
    99
     
    1111
    1212Today:
     13
     14{{{#!python
    1315    sql_create_unique_index = (
    1416        "CREATE UNIQUE INDEX %(name)s ON %(table)s "
    1517        "(%(columns)s)%(include)s%(condition)s%(nulls_distinct)s"
    1618    )
     19}}}
    1720
    1821To:
     22{{{#!python
    1923    sql_create_unique_index = (
    2024        "CREATE UNIQUE INDEX %(name)s ON %(table)s "
    2125        "(%(columns)s)%(include)s%(nulls_distinct)s%(condition)s"
    2226    )
     27}}}
    2328
    2429Regards,
Back to Top