3 ms·
> when I started working on a postgres project, I was shocked at some of the ways it was lacking (how am I supposed to store email addresses in a database witho
by robertlagrant 4y ago
> when I started working on a postgres project, I was shocked at some of the ways it was lacking (how am I supposed to store email addresses in a database without collations?)
How long ago was this? :)
- TehShrike 4y ago3 years ago. From this comment thread https://news.ycombinator.com/item?id=35908169 https://news.ycombinator.com/item?id=35908169 I infer that Postgres still doesn't support collations.
- robertlagrant 4y agoOh - is this ci collations, not collations in general?
- TehShrike 4y agoA lot of the collations are useful in different circumstances – but the CI ones probably come up the most often, and are necessary to store email addresses in a way where you store the case information that the user typed in, but can do case-insensitive lookups against in the future.
- funcDropShadow 4y agoAccording to the documentation of Postgres 12 [1] it is possible to use so called non-deterministic collations, which may express case-insensitivity. If that is what you need. The documentation of Postgres 11 [2] states that this was not possible: Note that while this system allows creating collations that “ignore case” or “ignore accents” or similar (using the ks key), PostgreSQL does not at the moment allow such collations to act in a truly case- or accent-insensitive manner. Any strings that compare equal according to the collation but are not byte-wise equal will be sorted according to their byte values. [1]: https://www.postgresql.org/docs/12/collation.html https://www.postgresql.org/docs/12/collation.html [2]: https://www.postgresql.org/docs/11/collation.html https://www.postgresql.org/docs/11/collation.html