Gentoo Archives: gentoo-user

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

Replies

Subject Author
Re: [gentoo-user] postgresql 9.5.2 versus Gentoo wiki install instructions? "J. Roeleveld" <joost@××××××××.org>
Re: [gentoo-user] postgresql 9.5.2 versus Gentoo wiki install instructions? "J. Roeleveld" <joost@××××××××.org>