It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Setting up Postgresql database for Confluence

Hi,

I'm new to Postgresql and Confluence, and I'm trying to setup the database (I have the on-premise server version) by following this guide:

https://confluence.atlassian.com/doc/database-setup-for-postgresql-173244522.html

At step 2.2, it states that "Collation must also be set to utf8", but how exactly do I do that? I'm assuming it's the LC_COLLATE option, and I've tried 'UTF-8', 'UTF8', 'en_US.utf8', and 'en_US.UTF-8', none of which worked.

Any help is appreciated, thanks!

2 answers

1 accepted

6 votes
Answer accepted
Dave Chevell Atlassian Team Mar 26, 2018

Postgres's default database template should already have these values set correctly, so you should be able to issue a "normal" create DB statement with encoding specified and get the correct collation out of the box:

CREATE DATABASE confluencedb WITH OWNER connie ENCODING 'UTF-8';

 If you need to specify these manually at creatino time, you should be able to specify them like so:

CREATE DATABASE confluencedb WITH OWNER connie ENCODING 'UTF-8' LC_COLLATE='en_US.utf8' LC_CTYPE='en_US.utf8'

However if you're having to specify these and not getting it set "out of the box", my guess is the host system of your Postgres server has its locale information set to something explicitly different.  If you have the locales package installed, running the locale command should tell you what LC_CTYPE and LC_COLLATE are set to by default in your host environment.

Hi Dave,

Thank you for the quick response!

I forgot to mention that I'm using Windows. I just added a tag.

I used 

SHOW LC_COLLATE;

to check the locale, and I got 'English_United States.1252'. I've also tried 'English_United States.utf8' but also got the same error invalid locale name (this is the same error I got for all values listed in OP). In this case, is it ok that I use default LC_COLLATE and LC_CTYPE values? Or is there something wrong with my database setting?

Like huang haizhou likes this

Hello!
The main language of my Confluence is Russian. Most of the content is in Russian, but many English words are also used. It is necessary that the search works correctly with two languages.
Will it work out?
What values ​​should I set to LC_COLLATE = and LC_CTYPE =?
I apologize if I could not understand the previous answers.

1 vote

Weird, 

we have this DB settings:

     Name     |  Owner   | Encoding |   Collate   |    Ctype    |   Access privileges   

--------------+----------+----------+-------------+-------------+-----------------------

 confluencedb | postgres | UTF8     | en_US.utf8  | en_US.utf8  | 

And Confluence says:

The database collation 'en_US.utf8' is not supported by Confluence. You need to use 'utf-8'.

Cheers,

Dirk

I'm having the exact same issue when trying to upgrade confluence.  I'm not new to Confluence and Postgresql, and I think this is somehow incorrect. Confluence won't start saying the collation is incorrect and should be utf-8 and not en_US.utf8. I cannot create a database with that collation. Stuck...

Have you figured it out, Dirk or someone else?

Else I'll submit a ticket.

hmm, already done by someone else: https://jira.atlassian.com/browse/CONFSERVER-58052.  Maybe just move to an older version...

Suggest an answer

Log in or Sign up to answer
Community showcase
Published in Confluence

6 Awesome Ways to Apply Trello, JIRA and Confluence to your Project

I attended  Atlassian Summit 2019  and learned a lot from the presenters, attendees and knowledgeable Atlassian product managers. The presentations I attended focused on applying Agile, pla...

3,827 views 15 37
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you