1

I have absolutely two same databases on localhost and webfaction (I'm usin Django). The problem with server database is that it doesn't search case insensitive unicode strings.

I have row name Яблоко

I write Word.objects.filter(name__iregex=r'(яблоко)') and it gives me 0 rows.

On localhost above query works.

I tried to create database with utf8 encoding, but it didn't help. ASCII symbols work well, though.

Also, if row in database is lower-cased, then it works. For example name груша will be returned (on both machines) for Word.objects.filter(name__iregex=r'(груша)')

Any ideas?

Paul R
  • 2,631
  • 3
  • 38
  • 72
  • Enter `locale` at your local machine and on the server; what is the value of `LC_CTYPE` at your local machine and on the server? – Antonis Christofides Dec 05 '16 at 14:45
  • How do I do that? I'm new to postgres. – Paul R Dec 05 '16 at 14:47
  • `locale` is not a PostgreSQL command, it's a GNU/Linux command. What is the operating system in your local machine and the server? If it's Debian or Ubuntu, you can just type `locale` at the prompt. – Antonis Christofides Dec 05 '16 at 14:49
  • Locale on remote machine is LANG=en_US.UTF-8 Same on local. – Paul R Dec 05 '16 at 14:52
  • Please show the contents of the server's `/etc/default/locale` file. – Antonis Christofides Dec 05 '16 at 14:58
  • LANG="en_US.UTF-8" LC_NUMERIC="uk_UA.UTF-8" LC_TIME="uk_UA.UTF-8" LC_MONETARY="uk_UA.UTF-8" LC_PAPER="uk_UA.UTF-8" LC_NAME="uk_UA.UTF-8" LC_ADDRESS="uk_UA.UTF-8" LC_TELEPHONE="uk_UA.UTF-8" LC_MEASUREMENT="uk_UA.UTF-8" LC_IDENTIFICATION="uk_UA.UTF-8" – Paul R Dec 05 '16 at 15:00
  • Let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/129813/discussion-between-antonis-christofides-and-andrew-fount). – Antonis Christofides Dec 05 '16 at 15:02

0 Answers0