source: server/databases/postgresql.xml@ d352a28

10.0 10.1 11.0 11.1 11.2 11.3 12.0 12.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 d352a28 was 6603f8b, checked in by Randy McMurchy <randy@…>, 18 years ago

Standardized the Linux-PAM package and entity names

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