# Turkish character support in Rails with Postgresql

**URL:** <https://linux-tips.com/t/turkish-character-support-in-rails-with-postgresql/416>\
**Category:** Rails\
**Created:** [October 15, 2016, 7:06pm UTC](https://linux-tips.com/t/turkish-character-support-in-rails-with-postgresql/416 "2016-10-15T19:06:14Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Greg](https://linux-tips.com/letter_avatar_proxy/v4/letter/g/71c47a/32.png) [@Greg](https://linux-tips.com/u/Greg)\
**Post date:** [October 15, 2016, 7:06pm UTC](https://linux-tips.com/t/turkish-character-support-in-rails-with-postgresql/416/1 "2016-10-15T19:06:14Z")

</div>

I’m trying to setup Turkish language support for a Rails project on Postgresql

First of all, following settings added into `config/database.yml` to support Turkish language:

```auto
development:
  ...
  collation: tr_TR.UTF-8
  ctype: tr_TR.UTF-8
  template: template0

```

After that, **tr\_TR.UTF-8** locale generated with `sudo dpkg-reconfigure locales` command.

But I’m getting following error on `rake db:create`:

```auto
PG::WrongObjectType: ERROR: invalid locale name: "tr_TR.UTF-8"

```

How can I correct invalid locale name errors?

---

<div class="post-metadata">

**Author:** ![redsector](https://linux-tips.com/user_avatar/linux-tips.com/redsector/32/71_2.png) [@redsector](https://linux-tips.com/u/redsector)\
**Post date:** [October 15, 2016, 7:22pm UTC](https://linux-tips.com/t/turkish-character-support-in-rails-with-postgresql/416/2 "2016-10-15T19:22:54Z")

</div>

It seems that you did everything correctly but if Postgresql started before the tr\_TR.UTF-8 locale generation, you just need to restart:

```auto
$ sudo service postgresql restart

```

It should work after that.

---

<div class="post-metadata">

**Author:** ![Greg](https://linux-tips.com/letter_avatar_proxy/v4/letter/g/71c47a/32.png) [@Greg](https://linux-tips.com/u/Greg)\
**Post date:** [October 15, 2016, 7:26pm UTC](https://linux-tips.com/t/turkish-character-support-in-rails-with-postgresql/416/3 "2016-10-15T19:26:44Z")

</div>

Thanks for your quick reply, restarting postgresql resolve the problem.
