source: server/databases/postgresql.xml@ a14ff766

10.0 10.1 11.0 11.1 11.2 11.3 12.0 12.1 6.1 6.2 6.2.0 6.2.0-rc1 6.2.0-rc2 6.3 6.3-rc1 6.3-rc2 6.3-rc3 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 a14ff766 was a14ff766, checked in by David Jensen <djensen@…>, 19 years ago

PostgreSQL testsuite size added in parenthesis

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

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