source: server/databases/postgresql.xml@ a1813d08

10.0 10.1 11.0 11.1 11.2 11.3 12.0 12.1 7.10 7.4 7.5 7.6 7.6-blfs 7.6-systemd 7.7 7.8 7.9 8.0 8.1 8.2 8.3 8.4 9.0 9.1 basic bdubbs/svn elogind gnome kde5-13430 kde5-14269 kde5-14686 kea ken/TL2024 ken/inkscape-core-mods ken/tuningfonts krejzi/svn lazarus lxqt nosym perl-modules plabs/newcss plabs/python-mods python3.11 qt5new rahul/power-profiles-daemon renodr/vulkan-addition systemd-11177 systemd-13485 trunk upgradedb xry111/intltool xry111/llvm18 xry111/soup3 xry111/test-20220226 xry111/xf86-video-removal
Last change on this file since a1813d08 was a1813d08, checked in by Ken Moffat <ken@…>, 13 years ago

Bring forward the openssl-1.0.0 upgrade because of the security fix in 1.0.0b (also in 0.9.8p). This will break the versions of mutt, heimdal, postgresql (probably) and ruby currently in the book if used (it's optional for all of them) - added temporary explanatory para to each of those packages. For openssl itself, bc is no longer required by the testsuite, without it there is a brief whinge hidden in the output, but it still reports that all tests succeedded.

git-svn-id: svn://svn.linuxfromscratch.org/BLFS/trunk/BOOK@8697 af4574ff-66df-0310-9fd7-8a98e5e911e0

  • Property mode set to 100644
File size: 20.6 KB
Line 
1<?xml version="1.0" encoding="ISO-8859-1"?>
2<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
3 "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
4 <!ENTITY % general-entities SYSTEM "../../general.ent">
5 %general-entities;
6
7 <!ENTITY postgresql-download-http "http://gd.tuwien.ac.at/db/postgresql/source/v&postgresql-version;/postgresql-&postgresql-version;.tar.bz2">
8 <!ENTITY postgresql-download-ftp "ftp://ftp5.us.postgresql.org/pub/PostgreSQL/source/v&postgresql-version;/postgresql-&postgresql-version;.tar.bz2">
9 <!-- <!ENTITY postgresql-download-http "&sources-anduin-http;/p/postgresql-&postgresql-version;.tar.bz2">
10 <!ENTITY postgresql-download-ftp "&sources-anduin-ftp;/p/postgresql-&postgresql-version;.tar.bz2"> -->
11 <!ENTITY postgresql-md5sum "315118130e1800a87f0effe69b947810">
12 <!ENTITY postgresql-size "14.1 MB">
13 <!ENTITY postgresql-buildsize "180 MB (additional 125 MB to run the testsuite)">
14 <!ENTITY postgresql-time "2.1 SBU">
15]>
16
17<sect1 id="postgresql" xreflabel="PostgreSQL-&postgresql-version;">
18 <?dbhtml filename="postgresql.html"?>
19
20 <sect1info>
21 <othername>$LastChangedBy$</othername>
22 <date>$Date$</date>
23 </sect1info>
24
25 <title>PostgreSQL-&postgresql-version;</title>
26
27 <indexterm zone="postgresql">
28 <primary sortas="a-PostgreSQL">PostgreSQL</primary>
29 </indexterm>
30
31 <sect2 role="package">
32 <title>Introduction to PostgreSQL</title>
33
34 <para><application>PostgreSQL</application> is an advanced
35 object-relational database management system (ORDBMS), derived
36 from the Berkeley Postgres database management system.</para>
37
38 <para>There may be a more recent release available from the
39 <application>PostgreSQL</application> home page. You can check
40 <ulink url="http://www.postgresql.org/"/> and probably use the
41 existing BLFS instructions. Note that versions other than the one shown
42 in the download URLs have not been tested in a BLFS environment.</para>
43
44 <!-- FIXME -->
45 <para>If you intend to link this application to <xref linkend="openssl"/>
46 you will need to move to a newer version of <application>PostgreSQL</application>,
47 1.9.0.1 is known to build.</para>
48
49 <bridgehead renderas="sect3">Package Information</bridgehead>
50 <itemizedlist spacing="compact">
51 <listitem>
52 <para>Download (HTTP): <ulink url="&postgresql-download-http;"/></para>
53 </listitem>
54 <listitem>
55 <para>Download (FTP): <ulink url="&postgresql-download-ftp;"/></para>
56 </listitem>
57 <listitem>
58 <para>Download MD5 sum: &postgresql-md5sum;</para>
59 </listitem>
60 <listitem>
61 <para>Download size: &postgresql-size;</para>
62 </listitem>
63 <listitem>
64 <para>Estimated disk space required: &postgresql-buildsize;</para>
65 </listitem>
66 <listitem>
67 <para>Estimated build time: &postgresql-time;</para>
68 </listitem>
69 </itemizedlist>
70
71 <bridgehead renderas="sect3">PostgreSQL Dependencies</bridgehead>
72
73 <bridgehead renderas="sect4">Optional</bridgehead>
74 <para role="optional"><xref linkend="python"/>,
75 <xref linkend="tcl"/>,
76 <xref linkend="openssl"/>,
77 <xref linkend="libxml2"/>,
78 <xref linkend="libxslt"/>,
79 <xref linkend="openldap"/>,
80 <xref linkend="linux-pam"/>,
81 <ulink url="http://www.pdc.kth.se/kth-krb/">krb4</ulink>,
82 <xref linkend="mitkrb"/> or <xref linkend="heimdal"/>, and
83 <ulink url="http://developer.apple.com/networking/bonjour/">Bonjour</ulink></para>
84
85 <bridgehead renderas="sect4">Optional (To Regenerate Documentation)</bridgehead>
86 <para role="optional"><xref linkend="sgml-dtd"/>,
87 <xref linkend="docbook-dsssl"/>,
88 <xref linkend="openjade"/>, and
89 <xref linkend="perl-sgmlspm"/></para>
90
91 <para condition="html" role="usernotes">User Notes:
92 <ulink url="&blfs-wiki;/postgresql"/></para>
93
94 </sect2>
95
96 <sect2 role="installation">
97 <title>Installation of PostgreSQL</title>
98
99 <para>Install <application>PostgreSQL</application> with the
100 following commands: </para>
101
102<screen><userinput>sed -i "s|dsssl-stylesheets|&amp; \\\\\n sgml/docbook/&amp;-&docbook-dsssl-version;|" \
103 configure &amp;&amp;
104./configure --prefix=/usr --enable-thread-safety &amp;&amp;
105make</userinput></screen>
106
107 <para>To test the results, issue: <command>make check</command>.</para>
108
109 <para>Now, as the <systemitem class="username">root</systemitem> user:</para>
110
111<screen role="root"><userinput>make install &amp;&amp;
112chown -v root:root /usr/share/doc/postgresql/html/* &amp;&amp;
113
114install -v -m755 -d /usr/share/doc/postgresql/{FAQ/html,TODO.detail} &amp;&amp;
115install -v -m644 doc/TODO \
116 /usr/share/doc/postgresql &amp;&amp;
117install -v -m644 doc/FAQ* \
118 /usr/share/doc/postgresql/FAQ &amp;&amp;
119install -v -m644 doc/src/FAQ/* \
120 /usr/share/doc/postgresql/FAQ/html &amp;&amp;
121install -v -m644 doc/TODO.detail/* \
122 /usr/share/doc/postgresql/TODO.detail</userinput></screen>
123
124 <note>
125 <para>If you are upgrading an existing system and are going to install
126 the new files over the old ones, then you should back up your data, shut
127 down the old server and follow the instructions in <ulink
128 url="http://www.postgresql.org/docs/8.1/static/install-upgrading.html">the
129 official <application>PostgreSQL</application> documentation</ulink>.</para>
130 </note>
131
132 <para>Initialize a database cluster with the following commands issued by the
133 <systemitem class="username">root</systemitem> user:</para>
134
135<screen role="root"><userinput>install -v -m700 -d /srv/pgsql/data &amp;&amp;
136groupadd -g 41 postgres &amp;&amp;
137useradd -c "PostgreSQL Server" -g postgres -d /srv/pgsql/data \
138 -u 41 postgres &amp;&amp;
139chown -v postgres /srv/pgsql/data &amp;&amp;
140su - postgres -c '/usr/bin/initdb -D /srv/pgsql/data'</userinput></screen>
141
142 <para>As the <systemitem class="username">root</systemitem> user, start the
143 database server with the following command:</para>
144
145<screen role="root"><userinput>su - postgres -c '/usr/bin/postmaster -D /srv/pgsql/data > \
146 /srv/pgsql/data/logfile 2&gt;&amp;1 &amp;'</userinput></screen>
147
148 <para>Still as user <systemitem class="username">root</systemitem>, create
149 a database and verify the installation:</para>
150
151<screen role="root"><userinput>su - postgres -c '/usr/bin/createdb test' &amp;&amp;
152echo "create table t1 ( name varchar(20), state_province varchar(20) );" \
153 | (su - postgres -c '/usr/bin/psql test ') &amp;&amp;
154echo "insert into t1 values ('Billy', 'NewYork');" \
155 | (su - postgres -c '/usr/bin/psql test ') &amp;&amp;
156echo "insert into t1 values ('Evanidus', 'Quebec');" \
157 | (su - postgres -c '/usr/bin/psql test ') &amp;&amp;
158echo "insert into t1 values ('Jesse', 'Ontario');" \
159 | (su - postgres -c '/usr/bin/psql test ') &amp;&amp;
160echo "select * from t1;" | (su - postgres -c '/usr/bin/psql test')</userinput></screen>
161
162 </sect2>
163
164 <sect2 role="commands">
165 <title>Command Explanations</title>
166
167 <para><command>sed -i "s|dsssl-stylesheets|..."</command>: This command
168 puts an extra line in the <command>configure</command> script so that the
169 BLFS installed version of the DSSSL stylesheets are discovered.</para>
170
171 <para><parameter>--enable-thread-safety</parameter>: This switch makes the
172 client libraries thread-safe by allowing concurrent threads in
173 <filename class='libraryfile'>libpq</filename> and ECPG programs to safely
174 control their private connection handles.</para>
175
176 <para><command>chown -R root:root /usr/share/doc/postgresql/html/*</command>:
177 This command corrects the improper ownership of documentation files.</para>
178
179 <para><command>groupadd ...</command>; <command>useradd ...</command>:
180 These commands add an unprivileged user and group to run the database
181 server.</para>
182
183 <para><command>createdb test; create table t1; insert into t1 values...;
184 select * from t1</command>: Create a database, add a table to it, insert
185 some rows into the table and select them to verify that the installation
186 is working properly.</para>
187
188 </sect2>
189
190 <sect2 role="configuration">
191 <title>Configuring PostgreSQL</title>
192
193 <sect3 id="postgresql-config">
194 <title>Config Files</title>
195
196 <para><filename>$PGDATA/pg_ident.con</filename>,
197 <filename>$PGDATA/pg_hba.conf</filename> and
198 <filename>$PGDATA/postgresql.conf</filename></para>
199
200 <indexterm zone="postgresql postgresql-config">
201 <primary sortas="e-A.PGDATA-pg_ident.con">$PGDATA/pg_indent.con</primary>
202 </indexterm>
203
204 <indexterm zone="postgresql postgresql-config">
205 <primary sortas="e-A.PGDATA-pg_hba.conf">$PGDATA/pg_hba_conf</primary>
206 </indexterm>
207
208 <indexterm zone="postgresql postgresql-config">
209 <primary sortas="e-A.PGDATA-postgresql.conf">$PGDATA/postgresql.conf</primary>
210 </indexterm>
211
212 <para>The <envar>PGDATA</envar> environment variable is used to
213 distinguish database clusters from one another by setting it to
214 the value of the directory which contains the cluster desired.
215 The three configuration files exist in every <filename
216 class="directory">PGDATA/</filename> directory. Details on the
217 format of the files and the options that can be set in each can
218 be found in <ulink
219 url="file:///usr/share/doc/postgresql/html/index.html"/>.</para>
220
221 </sect3>
222
223 <sect3 id="postgresql-init">
224 <title>Boot Script</title>
225
226 <para>Install the <filename>/etc/rc.d/init.d/postgresql</filename>
227 init script included in the
228 <xref linkend="bootscripts"/> package.</para>
229
230 <indexterm zone="postgresql postgresql-init">
231 <primary sortas="f-postgresql">postgresql</primary>
232 </indexterm>
233
234<screen role="root"><userinput>make install-postgresql</userinput></screen>
235
236 </sect3>
237
238 </sect2>
239
240 <sect2 role="content">
241 <title>Contents</title>
242
243 <segmentedlist>
244 <segtitle>Installed Programs</segtitle>
245 <segtitle>Installed Libraries</segtitle>
246 <segtitle>Installed Directories</segtitle>
247
248 <seglistitem>
249 <seg>clusterdb, createdb, createlang, createuser, dropdb, droplang,
250 dropuser, ecpg, initdb, ipcclean, pg_config, pg_controldata, pg_ctl,
251 pg_dump, pg_dumpall, pg_resetxlog, pg_restore, pltcl_delmod,
252 pltcl_listmod, pltcl_loadmod, postgres, postmaster, psql,
253 reindexdb, and vacuumdb</seg>
254 <seg>libecpg.{so,a}, libecpg_compat.{so,a}, libpgport.a, libpgtypes.{so,a},
255 libpq.{so,a}, and various charset modules.</seg>
256 <seg>/srv/pgsql, /usr/include/libpq, /usr/include/postgresql,
257 /usr/lib/postgresql, /usr/share/doc/postgresql, and
258 /usr/share/postgresql</seg>
259 </seglistitem>
260 </segmentedlist>
261
262 <variablelist>
263 <bridgehead renderas="sect3">Short Descriptions</bridgehead>
264 <?dbfo list-presentation="list"?>
265 <?dbhtml list-presentation="table"?>
266
267 <varlistentry id="clusterdb">
268 <term><command>clusterdb</command></term>
269 <listitem>
270 <para>is a utility for reclustering tables in a
271 <application>PostgreSQL</application> database.</para>
272 <indexterm zone="postgresql clusterdb">
273 <primary sortas="b-clusterdb">clusterdb</primary>
274 </indexterm>
275 </listitem>
276 </varlistentry>
277
278 <varlistentry id="createdb">
279 <term><command>createdb</command></term>
280 <listitem>
281 <para> creates a new <application>PostgreSQL</application>
282 database.</para>
283 <indexterm zone="postgresql createdb">
284 <primary sortas="b-createdb">createdb</primary>
285 </indexterm>
286 </listitem>
287 </varlistentry>
288
289 <varlistentry id="createlang">
290 <term><command>createlang</command></term>
291 <listitem>
292 <para>defines a new <application>PostgreSQL</application> procedural
293 language.</para>
294 <indexterm zone="postgresql createlang">
295 <primary sortas="b-createlang">createlang</primary>
296 </indexterm>
297 </listitem>
298 </varlistentry>
299
300 <varlistentry id="createuser">
301 <term><command>createuser</command></term>
302 <listitem>
303 <para>defines a new <application>PostgreSQL</application>
304 user account.</para>
305 <indexterm zone="postgresql createuser">
306 <primary sortas="b-createuser">createuser</primary>
307 </indexterm>
308 </listitem>
309 </varlistentry>
310
311 <varlistentry id="dropdb">
312 <term><command>dropdb</command></term>
313 <listitem>
314 <para>removes a <application>PostgreSQL</application> database.</para>
315 <indexterm zone="postgresql dropdb">
316 <primary sortas="b-dropdb">dropdb</primary>
317 </indexterm>
318 </listitem>
319 </varlistentry>
320
321 <varlistentry id="droplang">
322 <term><command>droplang</command></term>
323 <listitem>
324 <para>removes a <application>PostgreSQL</application> procedural
325 language.</para>
326 <indexterm zone="postgresql droplang">
327 <primary sortas="b-droplang">droplang</primary>
328 </indexterm>
329 </listitem>
330 </varlistentry>
331
332 <varlistentry id="dropuser">
333 <term><command>dropuser</command></term>
334 <listitem>
335 <para>removes a <application>PostgreSQL</application>
336 user account.</para>
337 <indexterm zone="postgresql dropuser">
338 <primary sortas="b-dropuser">dropuser</primary>
339 </indexterm>
340 </listitem>
341 </varlistentry>
342
343 <varlistentry id="ecpg">
344 <term><command>ecpg</command></term>
345 <listitem>
346 <para>is the embedded SQL preprocessor.</para>
347 <indexterm zone="postgresql ecpg">
348 <primary sortas="b-ecpg">ecpg</primary>
349 </indexterm>
350 </listitem>
351 </varlistentry>
352
353 <varlistentry id="initdb">
354 <term><command>initdb</command></term>
355 <listitem>
356 <para>creates a new database cluster.</para>
357 <indexterm zone="postgresql initdb">
358 <primary sortas="b-initdb">initdb</primary>
359 </indexterm>
360 </listitem>
361 </varlistentry>
362
363 <varlistentry id="ipcclean">
364 <term><command>ipcclean</command></term>
365 <listitem>
366 <para>removes shared memory and semaphores left over by an aborted
367 database server.</para>
368 <indexterm zone="postgresql ipcclean">
369 <primary sortas="b-ipcclean">ipcclean</primary>
370 </indexterm>
371 </listitem>
372 </varlistentry>
373
374 <varlistentry id="pg_config">
375 <term><command>pg_config</command></term>
376 <listitem>
377 <para>retrieves <application>PostgreSQL</application> version
378 information.</para>
379 <indexterm zone="postgresql pg_config">
380 <primary sortas="b-pg_config">pg_config</primary>
381 </indexterm>
382 </listitem>
383 </varlistentry>
384
385 <varlistentry id="pg_controldata">
386 <term><command>pg_controldata</command></term>
387 <listitem>
388 <para>returns information initialized during
389 <command>initdb</command>, such as the catalog version and server
390 locale.</para>
391 <indexterm zone="postgresql pg_controldata">
392 <primary sortas="b-pg_controldata">pg_controldata</primary>
393 </indexterm>
394 </listitem>
395 </varlistentry>
396
397 <varlistentry id="pg_ctl">
398 <term><command>pg_ctl</command></term>
399 <listitem>
400 <para>controls stopping and starting the database server.</para>
401 <indexterm zone="postgresql pg_ctl">
402 <primary sortas="b-pg_ctl">pg_ctl</primary>
403 </indexterm>
404 </listitem>
405 </varlistentry>
406
407 <varlistentry id="pg_dump">
408 <term><command>pg_dump</command></term>
409 <listitem>
410 <para>dumps database data and metadata into scripts which are used
411 to recreate the database.</para>
412 <indexterm zone="postgresql pg_dump">
413 <primary sortas="b-pg_dump">pg_dump</primary>
414 </indexterm>
415 </listitem>
416 </varlistentry>
417
418 <varlistentry id="pg_dumpall">
419 <term><command>pg_dumpall</command></term>
420 <listitem>
421 <para>recursively calls <command>pg_dump</command> for each
422 database in a cluster.</para>
423 <indexterm zone="postgresql pg_dumpall">
424 <primary sortas="b-pg_dumpall">pg_dumpall</primary>
425 </indexterm>
426 </listitem>
427 </varlistentry>
428
429 <varlistentry id="pg_resetxlog">
430 <term><command>pg_resetxlog</command></term>
431 <listitem>
432 <para>clears the write-ahead log and optionally resets some
433 fields in the <filename>pg_control</filename> file.</para>
434 <indexterm zone="postgresql pg_resetxlog">
435 <primary sortas="b-pg_resetxlog">pg_resetxlog</primary>
436 </indexterm>
437 </listitem>
438 </varlistentry>
439
440 <varlistentry id="pg_restore">
441 <term><command>pg_restore</command></term>
442 <listitem>
443 <para>creates databases from dump files created by
444 <command>pg_dump</command>.</para>
445 <indexterm zone="postgresql pg_restore">
446 <primary sortas="b-pg_restore">pg_restore</primary>
447 </indexterm>
448 </listitem>
449 </varlistentry>
450
451 <varlistentry id="pltcl_delmod">
452 <term><command>pltcl_delmod</command></term>
453 <listitem>
454 <para>is a support script used to delete a module from a
455 PL/<application>Tcl</application> table. The command
456 requires the <ulink
457 url="http://gborg.postgresql.org/project/pgtcl/">Pgtcl</ulink>
458 package to be installed also.</para>
459 <indexterm zone="postgresql pltcl_delmod">
460 <primary sortas="b-pltcl_delmod">pltcl_delmod</primary>
461 </indexterm>
462 </listitem>
463 </varlistentry>
464
465 <varlistentry id="pltcl_listmod">
466 <term><command>pltcl_listmod</command></term>
467 <listitem>
468 <para>is a support script used to list the modules in a
469 PL/<application>Tcl</application> table. The command
470 requires the <ulink
471 url="http://gborg.postgresql.org/project/pgtcl/">Pgtcl</ulink>
472 package to be installed also.</para>
473 <indexterm zone="postgresql pltcl_listmod">
474 <primary sortas="b-pltcl_listmod">pltcl_listmod</primary>
475 </indexterm>
476 </listitem>
477 </varlistentry>
478
479 <varlistentry id="pltcl_loadmod">
480 <term><command>pltcl_loadmod</command></term>
481 <listitem>
482 <para>is a support script used to load a module into a
483 PL/<application>Tcl</application> table. The command
484 requires the <ulink
485 url="http://gborg.postgresql.org/project/pgtcl/">Pgtcl</ulink>
486 package to be installed also.</para>
487 <indexterm zone="postgresql pltcl_loadmod">
488 <primary sortas="b-pltcl_loadmod">pltcl_loadmod</primary>
489 </indexterm>
490 </listitem>
491 </varlistentry>
492
493 <varlistentry id="postgres">
494 <term><command>postgres</command></term>
495 <listitem>
496 <para>is a single user database server, generally used for
497 debugging.</para>
498 <indexterm zone="postgresql postgres">
499 <primary sortas="b-postgres">postgres</primary>
500 </indexterm>
501 </listitem>
502 </varlistentry>
503
504 <varlistentry id="postmaster">
505 <term><command>postmaster</command></term>
506 <listitem>
507 <para>is a multi-user database daemon.</para>
508 <indexterm zone="postgresql postmaster">
509 <primary sortas="b-postmaster">postmaster</primary>
510 </indexterm>
511 </listitem>
512 </varlistentry>
513
514 <varlistentry id="psql">
515 <term><command>psql</command></term>
516 <listitem>
517 <para>is a console based database shell.</para>
518 <indexterm zone="postgresql psql">
519 <primary sortas="b-psql">psql</primary>
520 </indexterm>
521 </listitem>
522 </varlistentry>
523
524 <varlistentry id="reindexdb">
525 <term><command>reindexdb</command></term>
526 <listitem>
527 <para>is a utility for rebuilding indexes in a database.</para>
528 <indexterm zone="postgresql reindexdb">
529 <primary sortas="b-reindexdb">reindexdb</primary>
530 </indexterm>
531 </listitem>
532 </varlistentry>
533
534 <varlistentry id="vacuumdb">
535 <term><command>vacuumdb</command></term>
536 <listitem>
537 <para>compacts databases and generates statistics for the query
538 analyzer.</para>
539 <indexterm zone="postgresql vacuumdb">
540 <primary sortas="b-vacuumdb">vacuumdb</primary>
541 </indexterm>
542 </listitem>
543 </varlistentry>
544
545 </variablelist>
546
547 </sect2>
548
549</sect1>
Note: See TracBrowser for help on using the repository browser.