Skip to content

Holistic approach to database collations #19866

Closed
Closed

Description

@ajcvickers

Differences in string comparison semantics in C#/.NET verses different databases has always been a a usability issue.

We decided some time ago that string comparisons that don't specify any StringComparison value will use the database semantics. This results in the most expected (and fast) queries for code written in the most common way.

One thing we want to avoid is a slow, index-missing query being generated without any explicit opt-in to this.

However, if we know the database collation, then we can potentially translate more queries with acceptable fidelity and perf, while at the same time throwing very specific messages for things we can't translate. See thread here: #1222 (comment)

This needs to involve migrations and model building as well as queries, so this issue is tracking a more holistic approach to this which covers all aspects.

Related:

Activity

  1. ajcvickers commented on Feb 10, 2020

    @ajcvickers
    ContributorAuthor

    Also see high-level collations issue #19866

  2. roji commented on Feb 10, 2020

    @roji
    Member
  3. smitpatel commented on Feb 10, 2020

    @smitpatel
    Contributor

    Circular references.

  4. ajcvickers commented on Feb 10, 2020

    @ajcvickers
    ContributorAuthor

    Stack overflow.

  5. added this to the Backlog milestone on Feb 14, 2020
  6. roji commented on Mar 27, 2020

    @roji
    Member

    Here are the docs for PostgreSQL collations. tl;dr a collation can be specified at the database level, at the column level (when creating it), or explicitly in the query on. See also this note for why handling collation as part of the type mapping doesn't seem to make sense (for PostgreSQL).

  7. roji commented on Apr 8, 2020

    @roji
    Member

    Following our design discussion, here's what we plan to do for 5.0:

    At the moment, we don't plan to translate any string equality/comparison which accept the StringComparison enum (#1222) - see #1222 (comment).

  8. roji commented on May 1, 2020

    @roji
    Member

    @ajcvickers I think we've done everything here that we want to do for 5.0 - the issues that remain are in the backlog and I'm not sure we need this issue to track them.

    We may also consider closing #673 as we don't intend to do it (instead the decision was to point at the docs).

  9. removed this from the Backlog milestone on May 1, 2020
  10. added this to the 5.0.0 milestone on May 4, 2020
  11. modified the milestones: 5.0.0, on May 11, 2020
  12. removed their assignment
    on Jul 26, 2020
  13. modified the milestones: , 5.0.0 on Nov 7, 2020
  14. added theissue type on Jun 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions