Normalize how case sensitivity is handled across database engines

Created on 7 April 2012, over 12 years ago
Updated 20 May 2023, over 1 year ago

Updated: Comment #5

Problem/Motivation

Any string-like field specified in hook_schema as 'binary' => FALSE should compare case insensitively on PostgreSQL and SQLite too. They don't.

Proposed resolution

For SQLite, it is fixed in #2454733: Add a user-space case-insensitive collation to the SQLite driver β†’

For PostgreSQL, we need to require the citext module. It is possible we want to require 9.1.2 but at least 8.4 for sure.

Remaining tasks

The pgsql driver needs to use the citext type when not binary. It is not slower than varchar http://www.depesz.com/2010/03/02/charx-vs-varcharx-vs-varchar-vs-text/ . Also, it needs to check it exists during install requirements. This I do not know how to.

User interface changes

None. Or, who knows... you have a case sensitive sort in Drupal 7? Well, that was a bug!

API changes

None.

Related Issues

#2068655: Entity fields do not support case sensitive queries β†’
#1237252: DB Case Sensitivity: Allow BINARY attribute in MySQL β†’ .

πŸ“Œ Task
Status

Active

Version

10.1 ✨

Component
DatabaseΒ  β†’

Last updated 3 days ago

  • Maintained by
  • πŸ‡³πŸ‡±Netherlands @daffie
Created by

πŸ‡ΈπŸ‡ͺSweden iamEAP

Live updates comments and jobs are added and updated live.
  • Needs issue summary update

    Issue summaries save everyone time if they are kept up-to-date. See Update issue summary task instructions.

  • PostgreSQL

    Particularly affects sites running on the PostgreSQL database.

Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • πŸ‡·πŸ‡ΊRussia Chi

    Any string-like field specified in hook_schema as 'binary' => FALSE should compare case insensitively on PostgreSQL and SQLite too. They don't.

    The issue summary does not explain why it's actually needed. Forcing case insensitivity across different databases has proven to be problematic. What if we just remove this obligation from DB drivers? Services that build SQL queries can take care about case insensitively themselves when needed.

Production build 0.71.5 2024