Guest User

Untitled

a guest
Jun 24th, 2018
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.40 KB | None | 0 0
  1. create unique index some_name on users (lower(username));
  2.  
  3. create unique index some_name on users (lower(username)) where is_active = true;
  4.  
  5. select * from users where lower(username) = '...'
  6.  
  7. select * from users where lower(username) like '...'
  8.  
  9. select * from users where username ilike '...'
  10.  
  11. CREATE UNIQUE INDEX
  12. example_unique_idx
  13. ON
  14. example_table ((LOWER(case_insensitive_field)));
Add Comment
Please, Sign In to add comment