-
Notifications
You must be signed in to change notification settings - Fork 28
Fix usernames being case sensitive #123
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Fix usernames being case sensitive #123
Conversation
Signed-off-by: Mitch Gaffigan <mitch.gaffigan@comcast.net>
So, John.doe and john.doe are same person? |
@david-labs-ca, there's discussion on the original ticket. I think the world at large usually assumes usernames to be case-insensitive. It's also just plum broken on several case-insensitive database engines in main, so if the decision were to make them case sensitive, a change would still be required. |
I get angry any time I encounter a system with case-sensitive usernames. I expect to always be able to type my username in all lowercase, regardless of how the admin added it to the system. |
suggestion: don't assume anything about which charset, collation, or locale are in use I think it would be a good idea to use |
…into feature/case-insensitive-username
Signed-off-by: Mitch Gaffigan <mitch.gaffigan@comcast.net>
@tonygermano Re: existing users, I've added a fallback to match case-sensitive if multiple users match. Adding a new user with a different casing fails with |
@mgaffigan I don't think the PERSON table is expected to get very large where a scan would be a problem, and this seems evident because there isn't an index on USERNAME. In this case, I think it's better to be safe and use the standard SQL function without making assumptions about the environment rather than going for performance. LOWER should work across all databases respecting their current collation, character encoding, and locale. This is completely up to you, but if you want to address this issue, too, it's related nextgenhealthcare/connect#3386 |
Closes #122 / original #5569 by:
Implementation Notes:
LOWER()
in pgsql instead of collation to avoid having to rely upon system defaults or database defined collation. Presumably table is not so large that sargability is a concern (since we're loading the full table to the client on each login)LOWER()