Why PostgreSQL and not MySQL ?

Try this (if username is a text column):

CREATE INDEX test_index ON test_table (username text_pattern_ops);