Fix case sensitivity problem on sort for postgres