In a previous blog post I was trying to store username/email in a case
insensitive way in
postgres.
A few folks commented that the citext
postgres extension actually did this in
a very easy and straightforward way. So, I went back to my code and ripped out
the unnecessary complexity and here is what I ended up with:
1 | defmodule SF.Repo.Migrations.EnableCitextExtension do |
So, the way citext works is similar to our previous approach. If you want to get into all the gory details about how citext is implemented you can check out the code on GitHub at: https://github.com/postgres/postgres/blob/6dd86c269d5b9a176f6c9f67ea61cc17fef9d860/contrib/citext/citext.c
I am currently working on LiveForm which makes
setting up contact forms on your website a breeze.