source: server/databases/postgresql.xml@ 904f4c45

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 904f4c45 was 904f4c45, checked in by Randy McMurchy <randy@…>, 14 years ago

Updated to PostgreSQL-8.3.10

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

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