Gentoo Archives: gentoo-user

From: "J. Roeleveld" <joost@××××××××.org>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] postgresql 9.5.2 versus Gentoo wiki install instructions?
Date: Sun, 22 May 2016 04:41:59
Message-Id: 4E744AD5-787F-45F2-BD96-73A2836C520C@antarean.org
In Reply to: Re: [gentoo-user] postgresql 9.5.2 versus Gentoo wiki install instructions? by waltdnes@waltdnes.org
1 On May 21, 2016 10:56:18 PM GMT+02:00, waltdnes@××××××××.org wrote:
2 >On Sat, May 21, 2016 at 08:55:39AM +0200, J. Roeleveld wrote
3 >> Longer answer:
4 >>
5 >> On Friday, May 20, 2016 10:36:41 PM waltdnes@××××××××.org wrote:
6 >> > Yes, I did RTFM at
7 >https://wiki.gentoo.org/wiki/PostgreSQL/QuickStart
8 >> > and that's part of my problem. <G> I figured it would be a simple
9 >> > search and replace "9.3" ==> "9.5" in the wiki, but...
10 >>
11 >> A quick scan should indicate that.
12 >> However:
13 >> PG_INITDB_OPTS="--locale=en_US.UTF-8 --lc-messages=sv_SE.UTF-8"
14 >> is wrong. See below.
15 >>
16 >> > 1) The wiki recommends...
17 >> > PG_INITDB_OPTS="--locale=en_US.UTF-8"
18 >>
19 >> Where did you configure this?
20 >>
21 >> I did the following:
22 >> # cat /etc/conf.d/postgresql-9.5 | grep -i utf
23 >> PG_INITDB_OPTS="--encoding=UTF8"
24 >>
25 >>
26 >> Did you run
27 >> emerge --config dev-db/postgresql:9.5
28 >
29 > Yes.
30 >
31 >> succesfully?
32 >
33 > Obviously not. I think I've finally figured it out. I edited
34 >/etc/conf.d/postgresql-9.5 to PG_INITDB_OPTS="--encoding=UTF8" and ran
35 >"emerge --config dev-db/postgresql:9.5". I got an error message about
36 >the data directory not be empty (probably from my first attempt). I
37 >ran
38 >
39 >rm /var/lib/postgresql/9.5/data/*
40 >emerge --config dev-db/postgresql:9.5
41 >
42 >and got a bit further. I did get error messages as follows
43 >
44 >
45 >#######################################################################
46 >The database cluster will be initialized with locale "en_US.iso88591".
47 >initdb: encoding mismatch
48 >The encoding you selected (UTF8) and the encoding that the
49 >selected locale uses (LATIN1) do not match. This would lead to
50 >misbehavior in various character string processing functions.
51 >Rerun initdb and either do not specify an encoding explicitly,
52 >or choose a matching combination.
53 >mv: cannot stat '/var/lib/postgresql/9.5/data/pg_hba.conf': No such
54 >file or directory
55 >mv: cannot stat '/var/lib/postgresql/9.5/data/pg_ident.conf': No such
56 >file or directory
57 >mv: cannot stat '/var/lib/postgresql/9.5/data/postgresql.conf': No such
58 >file or directory
59 >#######################################################################
60 >
61 > I fixed that. In /etc/conf.d/postgresql-9.5 I set
62 >PG_INITDB_OPTS="--encoding=iso88591" and ran
63 >
64 >rm /var/lib/postgresql/9.5/data/*
65 >emerge --config dev-db/postgresql:9.5
66 >
67 >and got the following. Does it look OK? Do I understand correctly...
68 >
69 >config files are located in /etc/postgresql-9.5/
70 >the actual databases are located in /var/lib/postgresql/9.5/data
71 >
72 >#######################################################################
73 >[i3][root][~] emerge --config dev-db/postgresql:9.5
74 >
75 >Configuring pkg...
76 >
77 > * You can modify the paths and options passed to initdb by editing:
78 > * /etc/conf.d/postgresql-9.5
79 > *
80 > * Information on options that can be passed to initdb are found at:
81 > * http://www.postgresql.org/docs/9.5/static/creating-cluster.html
82 > * http://www.postgresql.org/docs/9.5/static/app-initdb.html
83 > *
84 > * PG_INITDB_OPTS is currently set to:
85 > * --encoding=UTF8
86 > *
87 > * Configuration files will be installed to:
88 > * /etc/postgresql-9.5/
89 > *
90 > * The database cluster will be created in:
91 > * /var/lib/postgresql/9.5/data
92 > *
93 > * Are you ready to continue? (y/n)
94 >y
95 > * Creating the data directory ...
96 > * Initializing the database ...
97 >The files belonging to this database system will be owned by user
98 >"postgres".
99 >This user must also own the server process.
100 >
101 >The database cluster will be initialized with locale "en_US.iso88591".
102 >The default text search configuration will be set to "english".
103 >
104 >Data page checksums are disabled.
105 >
106 >fixing permissions on existing directory /var/lib/postgresql/9.5/data
107 >... ok
108 >creating subdirectories ... ok
109 >selecting default max_connections ... 100
110 >selecting default shared_buffers ... 128MB
111 >selecting dynamic shared memory implementation ... posix
112 >creating configuration files ... ok
113 >creating template1 database in /var/lib/postgresql/9.5/data/base/1 ...
114 >ok
115 >initializing pg_authid ... ok
116 >initializing dependencies ... ok
117 >creating system views ... ok
118 >loading system objects' descriptions ... ok
119 >creating collations ... ok
120 >creating conversions ... ok
121 >creating dictionaries ... ok
122 >setting privileges on built-in objects ... ok
123 >creating information schema ... ok
124 >loading PL/pgSQL server-side language ... ok
125 >vacuuming database template1 ... ok
126 >copying template1 to template0 ... ok
127 >copying template1 to postgres ... ok
128 >syncing data to disk ... ok
129 >
130 >WARNING: enabling "trust" authentication for local connections
131 >You can change this by editing pg_hba.conf or using the option -A, or
132 >--auth-local and --auth-host, the next time you run initdb.
133 >
134 >Success. You can now start the database server using:
135 >
136 >/usr/lib64/postgresql-9.5/bin/pg_ctl -D /var/lib/postgresql/9.5/data -l
137 >logfile start
138 >
139 >* The autovacuum function, which was in contrib, has been moved to the
140 >main
141 >* PostgreSQL functions starting with 8.1, and starting with 8.4 is now
142 >enabled
143 > * by default. You can disable it in the cluster's:
144 > * /etc/postgresql-9.5/postgresql.conf
145 > *
146 > * The PostgreSQL server, by default, will log events to:
147 > * /var/lib/postgresql/9.5/data/postmaster.log
148 > *
149 >* You should use the '/etc/init.d/postgresql-9.5' script to run
150 >PostgreSQL
151 > * instead of 'pg_ctl'.
152 >#######################################################################
153 >
154 > There's still one apparent internal contradiction in the output...
155 >
156 >#######################################################################
157 >Success. You can now start the database server using:
158 >
159 >/usr/lib64/postgresql-9.5/bin/pg_ctl -D /var/lib/postgresql/9.5/data -l
160 >logfile start
161 >#######################################################################
162 >
163 >...but it also says...
164 >
165 >#######################################################################
166 >* You should use the '/etc/init.d/postgresql-9.5' script to run
167 >PostgreSQL
168 > * instead of 'pg_ctl'.
169 >#######################################################################
170
171 Quick reply (longer one later)
172 2nd run looks better.
173
174 The output is from the supplied scripts. For Gentoo, use the /etc/init.d script. That will call the other one where necessary.
175
176 About the codepage. What does "eselect locale list" show?
177 In other words, which locale do you actually use?
178
179 --
180 Joost
181 --
182 Sent from my Android device with K-9 Mail. Please excuse my brevity.

Replies