Replies: 2 comments
-
We store the email with the provided case on purpose. While generally, mails are case insensitive, things are not always that simple with emails: https://stackoverflow.com/questions/9807909/are-email-addresses-case-sensitive So the choice we made here is to store the email as if (in case it actually matters for the recipient server), but have a lowercase lookup to avoid duplicates. Regarding performance, I'm not convinced it's a big issue for most applications. If it is, PostgreSQL supports functional indices, which can easily be created if needed: https://www.postgresql.org/docs/current/indexes-expressional.html |
Beta Was this translation helpful? Give feedback.
-
I was bringing this up in case this was not by design. That being said, i would suggest creating a functional index just for the sake of clean code. Just my 2 cents. |
Beta Was this translation helpful? Give feedback.
-
Hi All,
I'd like to kick off a discussion about how get_by_email is querying the db (postgres in my case), specifically the part where lower() is applied to the email column. Code Snippet
As long as the email gets stored in lower case, a possible fix would be:
Opinions?
Beta Was this translation helpful? Give feedback.
All reactions