Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Setting up postgresql 9.3
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Portage & Programming
View previous topic :: View next topic  
Author Message
gorkha
n00b
n00b


Joined: 15 Oct 2004
Posts: 41

PostPosted: Thu Feb 27, 2014 12:39 am    Post subject: Setting up postgresql 9.3 Reply with quote

I tried:
emerge --config dev-db/postgresql-server:9.3

but I get:
Code:

 * Checking system parameters...
 * Checking whether your system supports at least 128 connections...
 * Passed.
 * Creating the data directory ...
 * Initializing the database ...
The files belonging to this database system will be owned by user "postgres".
This user must also own the server process.

The database cluster will be initialized with locale "en_US.utf8".
initdb: "da_DK.UTF8" is not a valid server encoding name
mv: cannot stat '/var/lib/postgresql/9.3/data/*.conf': No such file or directory


I am not exactly sure what I am missing but it has to be able to recognise Danish letters upper and lower case
I don't want any messages in Danish though

What can I do to get the database initialized properly?
Back to top
View user's profile Send private message
baaann
Guru
Guru


Joined: 23 Jan 2006
Posts: 497
Location: uk

PostPosted: Thu Feb 27, 2014 1:55 pm    Post subject: Reply with quote

Its been a while since I set up a PostgreSQL database, but I followed the following guide from Gentoo Wiki

http://wiki.gentoo.org/wiki/PostgreSQL/QuickStart

HTH
Back to top
View user's profile Send private message
limn
l33t
l33t


Joined: 13 May 2005
Posts: 896

PostPosted: Thu Feb 27, 2014 2:25 pm    Post subject: Reply with quote

You should have what you want. Messages will be in US English. By default, postgresql uses UTF8.
Code:
# \encoding
UTF8
# create table test (danish text);
CREATE TABLE
# insert into test values ('Hvad så?');
INSERT 0 1
# select * from test;
  danish 
----------
 Hvad så?
(1 row)
Back to top
View user's profile Send private message
gorkha
n00b
n00b


Joined: 15 Oct 2004
Posts: 41

PostPosted: Thu Feb 27, 2014 3:54 pm    Post subject: Reply with quote

baaann wrote:
Its been a while since I set up a PostgreSQL database, but I followed the following guide from Gentoo Wiki

http://wiki.gentoo.org/wiki/PostgreSQL/QuickStart

HTH


Except that my problem is that emerge --config fails as shown in above code block - The data directory is completely empty
Back to top
View user's profile Send private message
baaann
Guru
Guru


Joined: 23 Jan 2006
Posts: 497
Location: uk

PostPosted: Thu Feb 27, 2014 4:43 pm    Post subject: Reply with quote

From the error message, I would think the problem is with your locale? Is the Danish locale included in your system? Taken from the wiki page
Quote:
A complete list of language and character encodings supported by the server can be found in the documentation, but your system must also support the respective languages and character encodings. Compare the output of locale -a to the encodings in the documentation.
Back to top
View user's profile Send private message
limn
l33t
l33t


Joined: 13 May 2005
Posts: 896

PostPosted: Thu Feb 27, 2014 4:53 pm    Post subject: Reply with quote

What shows
Code:
# locale

and
Code:
grep -v ^# /etc/locale.gen

Did you change the postgresql config file?
I changed my locale to da_DK.UTF-8 on a test box and postgresql created the DB.
Code:
The database cluster will be initialized with locale "da_DK.UTF-8".
Back to top
View user's profile Send private message
gorkha
n00b
n00b


Joined: 15 Oct 2004
Posts: 41

PostPosted: Thu Feb 27, 2014 5:58 pm    Post subject: Reply with quote

Code:

# locale
LANG=en_US.utf8
LC_CTYPE="en_US.utf8"
LC_NUMERIC="en_US.utf8"
LC_TIME="en_US.utf8"
LC_COLLATE="en_US.utf8"
LC_MONETARY="en_US.utf8"
LC_MESSAGES="en_US.utf8"
LC_PAPER="en_US.utf8"
LC_NAME="en_US.utf8"
LC_ADDRESS="en_US.utf8"
LC_TELEPHONE="en_US.utf8"
LC_MEASUREMENT="en_US.utf8"
LC_IDENTIFICATION="en_US.utf8"
LC_ALL=

# grep -v ^# /etc/locale.gen

da_DK UTF-8
da_DK ISO-8859-1
en_US UTF-8
en_US ISO-8859-1

Some places it's utf8 without the dash, other places it is utf-8 and different cases too, does that have any importance?
Back to top
View user's profile Send private message
limn
l33t
l33t


Joined: 13 May 2005
Posts: 896

PostPosted: Thu Feb 27, 2014 6:46 pm    Post subject: Reply with quote

Working with locales can be confusing. I think your system added .utf8. Could be artifact from before some committee said, uppercase, with dash.
/usr/share/i18n/SUPPORTED has supported locales. See top of /etc/locale.gen file. Try changing in /etc/locale.gen
Code:
da_DK UTF-8
en_US UTF-8

to
Code:

en_US.UTF-8 UTF-8
da_DK.UTF-8 UTF-8

Then run locale-gen. Log out and back in to pick up change, and try creating DB.
Back to top
View user's profile Send private message
gorkha
n00b
n00b


Joined: 15 Oct 2004
Posts: 41

PostPosted: Thu Feb 27, 2014 7:22 pm    Post subject: Reply with quote

yes, thanks.

I figured out the rest I think. At least it now initialized with the settings:
PG_INITDB_OPTS="--encoding=UTF-8 --locale=da_DK.UTF-8 --lc-messages=en_US.UTF-8"
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Portage & Programming All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum