source: server/databases/postgresql.xml@ 4f2c94fc

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 4f2c94fc was 4f2c94fc, checked in by Bruce Dubbs <bdubbs@…>, 12 years ago

Update to PostgreSQL-9.2.1

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

  • Property mode set to 100644
File size: 21.9 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 " ">
8 <!ENTITY postgresql-download-ftp "ftp://ftp5.us.postgresql.org/pub/PostgreSQL/source/v&postgresql-version;/postgresql-&postgresql-version;.tar.bz2">
9 <!ENTITY postgresql-md5sum "ic0b4799ea9850eae3ead14f0a60e9418">
10 <!ENTITY postgresql-size "15.4 MB">
11 <!ENTITY postgresql-buildsize "294 MB (additional 146 MB to run the testsuite)">
12 <!ENTITY postgresql-time "1.7 SBU (additional 0.2 SBU to run the testsuite)">
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 <para>There may be a more recent release available from the
37 <application>PostgreSQL</application> home page. You can check
38 <ulink url="http://www.postgresql.org/"/> and probably use the
39 existing BLFS instructions. Note that versions other than the one shown
40 in the download URLs have not been tested in a BLFS environment.</para>
41
42 &lfs72_checked;
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="python2"/>,
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 <xref linkend="mitkrb"/> and
77 <ulink url="http://developer.apple.com/networking/bonjour/">Bonjour</ulink></para>
78
79 <bridgehead renderas="sect4">Optional (To Regenerate Documentation)</bridgehead>
80 <para role="optional"><xref linkend="sgml-dtd"/>,
81 <xref linkend="docbook-dsssl"/>,
82 <xref linkend="openjade"/>, and
83 <xref linkend="perl-sgmlspm"/></para>
84
85 <para condition="html" role="usernotes">User Notes:
86 <ulink url="&blfs-wiki;/postgresql"/></para>
87
88 </sect2>
89
90 <sect2 role="installation">
91 <title>Installation of PostgreSQL</title>
92
93 <para>Install <application>PostgreSQL</application> with the
94 following commands: </para>
95
96 <para>Now configure and build the package:</para>
97
98<screen><userinput>./configure --prefix=/usr \
99 --enable-thread-safety \
100 --docdir=/usr/share/doc/postgresql-&postgresql-version; &amp;&amp;
101make</userinput></screen>
102
103 <para>To test the results, issue: <command>make check</command>.</para>
104
105 <para>Now, as the <systemitem class="username">root</systemitem> user:</para>
106
107<screen role="root"><userinput>make install &amp;&amp;
108make install-docs</userinput></screen>
109
110 <!-- 'Upgrading' seems to only ever exist in the docs for *previous* version -->
111 <note>
112 <para>If you are upgrading an existing system and are going to install
113 the new files over the old ones, then you should back up your data, shut
114 down the old server and follow the instructions in <ulink
115 url="http://www.postgresql.org/docs/9.0/static/install-upgrading.html">the
116 official <application>PostgreSQL</application> documentation</ulink>.</para>
117 </note>
118
119 <para>Initialize a database cluster with the following commands issued by the
120 <systemitem class="username">root</systemitem> user:</para>
121
122<screen role="root"><userinput>install -v -m700 -d /srv/pgsql/data &amp;&amp;
123groupadd -g 41 postgres &amp;&amp;
124useradd -c "PostgreSQL Server" -g postgres -d /srv/pgsql/data \
125 -u 41 postgres &amp;&amp;
126chown -v postgres /srv/pgsql/data &amp;&amp;
127su - postgres -c '/usr/bin/initdb -D /srv/pgsql/data'</userinput></screen>
128
129 <para>As the <systemitem class="username">root</systemitem> user, start the
130 database server with the following command:</para>
131
132<screen role="root"><userinput>su - postgres -c '/usr/bin/postmaster -D /srv/pgsql/data > \
133 /srv/pgsql/data/logfile 2&gt;&amp;1 &amp;'</userinput></screen>
134
135 <para>Still as user <systemitem class="username">root</systemitem>, create
136 a database and verify the installation:</para>
137
138<screen role="root"><userinput>su - postgres -c '/usr/bin/createdb test' &amp;&amp;
139echo "create table t1 ( name varchar(20), state_province varchar(20) );" \
140 | (su - postgres -c '/usr/bin/psql test ') &amp;&amp;
141echo "insert into t1 values ('Billy', 'NewYork');" \
142 | (su - postgres -c '/usr/bin/psql test ') &amp;&amp;
143echo "insert into t1 values ('Evanidus', 'Quebec');" \
144 | (su - postgres -c '/usr/bin/psql test ') &amp;&amp;
145echo "insert into t1 values ('Jesse', 'Ontario');" \
146 | (su - postgres -c '/usr/bin/psql test ') &amp;&amp;
147echo "select * from t1;" | (su - postgres -c '/usr/bin/psql test')</userinput></screen>
148
149 </sect2>
150
151 <sect2 role="commands">
152 <title>Command Explanations</title>
153
154 <para><parameter>--docdir=/usr/share/doc/postgresql-&postgresql-version;</parameter>:
155 This switch puts the documentation in a versioned directory.</para>
156
157 <para><parameter>--enable-thread-safety</parameter>: This switch makes the
158 client libraries thread-safe by allowing concurrent threads in
159 <filename class='libraryfile'>libpq</filename> and ECPG programs to safely
160 control their private connection handles.</para>
161
162 <para><option>--with-openssl</option>: build with support for
163 <application>OpenSSL</application> encrypted connections.</para>
164
165 <para><option>--with-perl</option>: build the PL/Perl server-side language.
166 </para>
167
168 <para><option>--with-python</option>: build the PL/Python server-side
169 language.</para>
170
171 <para><option>--with-tcl</option>: build the PL/Tcl server-side language.</para>
172
173 <para><command>groupadd ...</command>; <command>useradd ...</command>:
174 These commands add an unprivileged user and group to run the database
175 server.</para>
176
177 <para><command>createdb test; create table t1; insert into t1 values...;
178 select * from t1</command>: Create a database, add a table to it, insert
179 some rows into the table and select them to verify that the installation
180 is working properly.</para>
181
182 </sect2>
183
184 <sect2 role="configuration">
185 <title>Configuring PostgreSQL</title>
186
187 <sect3 id="postgresql-config">
188 <title>Config Files</title>
189
190 <para><filename>$PGDATA/pg_ident.con</filename>,
191 <filename>$PGDATA/pg_hba.conf</filename> and
192 <filename>$PGDATA/postgresql.conf</filename></para>
193
194 <indexterm zone="postgresql postgresql-config">
195 <primary sortas="e-A.PGDATA-pg_ident.con">$PGDATA/pg_indent.con</primary>
196 </indexterm>
197
198 <indexterm zone="postgresql postgresql-config">
199 <primary sortas="e-A.PGDATA-pg_hba.conf">$PGDATA/pg_hba_conf</primary>
200 </indexterm>
201
202 <indexterm zone="postgresql postgresql-config">
203 <primary sortas="e-A.PGDATA-postgresql.conf">$PGDATA/postgresql.conf</primary>
204 </indexterm>
205
206 <para>The <envar>PGDATA</envar> environment variable is used to
207 distinguish database clusters from one another by setting it to
208 the value of the directory which contains the cluster desired.
209 The three configuration files exist in every <filename
210 class="directory">PGDATA/</filename> directory. Details on the
211 format of the files and the options that can be set in each can
212 be found in <ulink
213 url="file:///usr/share/doc/postgresql-&postgresql-version;/html/index.html"/>.</para>
214
215 </sect3>
216
217 <sect3 id="postgresql-init">
218 <title>Boot Script</title>
219
220 <para>Install the <filename>/etc/rc.d/init.d/postgresql</filename>
221 init script included in the
222 <xref linkend="bootscripts"/> package.</para>
223
224 <indexterm zone="postgresql postgresql-init">
225 <primary sortas="f-postgresql">postgresql</primary>
226 </indexterm>
227
228<screen role="root"><userinput>make install-postgresql</userinput></screen>
229
230 </sect3>
231
232 </sect2>
233
234 <sect2 role="content">
235 <title>Contents</title>
236
237 <segmentedlist>
238 <segtitle>Installed Programs</segtitle>
239 <segtitle>Installed Libraries</segtitle>
240 <segtitle>Installed Directories</segtitle>
241
242 <seglistitem>
243 <seg>clusterdb, createdb, createlang, createuser, dropdb, droplang,
244 dropuser, ecpg, initdb, pg_basebackup, pg_config, pg_controldata, pg_ctl,
245 pg_dump, pg_dumpall, pg_resetxlog, pg_restore, pltcl_delmod,
246 pltcl_listmod, pltcl_loadmod, postgres, postmaster, psql,
247 reindexdb, and vacuumdb</seg>
248 <seg>libecpg.{so,a}, libecpg_compat.{so,a}, libpgport.a, libpgtypes.{so,a},
249 libpq.{so,a}, and various charset (and optionally, programming language)
250 modules.</seg>
251 <seg>/srv/pgsql, /usr/include/libpq, /usr/include/postgresql,
252 /usr/lib/postgresql, /usr/share/doc/postgresql-&postgresql-version;, 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="pg_basebackup">
359 <term><command>pg_basebackup</command></term>
360 <listitem>
361 <para>takes base backups of a running
362 <application>PostgreSQL</application> cluster.</para>
363 <indexterm zone="postgresql pg_basebackup">
364 <primary sortas="b-pg_basebackup">pg_basebackup</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>(a symlink to <command>postgres</command>) is a multi-user
503 database daemon.</para>
504 <indexterm zone="postgresql postmaster">
505 <primary sortas="b-postmaster">postmaster</primary>
506 </indexterm>
507 </listitem>
508 </varlistentry>
509
510 <varlistentry id="psql">
511 <term><command>psql</command></term>
512 <listitem>
513 <para>is a console based database shell.</para>
514 <indexterm zone="postgresql psql">
515 <primary sortas="b-psql">psql</primary>
516 </indexterm>
517 </listitem>
518 </varlistentry>
519
520 <varlistentry id="reindexdb">
521 <term><command>reindexdb</command></term>
522 <listitem>
523 <para>is a utility for rebuilding indexes in a database.</para>
524 <indexterm zone="postgresql reindexdb">
525 <primary sortas="b-reindexdb">reindexdb</primary>
526 </indexterm>
527 </listitem>
528 </varlistentry>
529
530 <varlistentry id="vacuumdb">
531 <term><command>vacuumdb</command></term>
532 <listitem>
533 <para>compacts databases and generates statistics for the query
534 analyzer.</para>
535 <indexterm zone="postgresql vacuumdb">
536 <primary sortas="b-vacuumdb">vacuumdb</primary>
537 </indexterm>
538 </listitem>
539 </varlistentry>
540
541 <varlistentry id="libecpg">
542 <term><filename class='libraryfile'>libecpg.{so,a}</filename></term>
543 <listitem>
544 <para>contains functions to support embedded SQL in C programs.</para>
545 <indexterm zone="postgresql libecpg">
546 <primary sortas="c-libecpg">libecpg.{so,a}</primary>
547 </indexterm>
548 </listitem>
549 </varlistentry>
550
551 <varlistentry id="libecpg_compat">
552 <term><filename class='libraryfile'>libecpg_compat.{so,a}</filename></term>
553 <listitem>
554 <para>is the ecpg compatability library.</para>
555 <indexterm zone="postgresql libecpg_compat">
556 <primary sortas="c-libecpg_compat">libecpg_compat.{so,a}</primary>
557 </indexterm>
558 </listitem>
559 </varlistentry>
560
561 <varlistentry id="libgport">
562 <term><filename class='libraryfile'>libgport.a</filename></term>
563 <listitem>
564 <para>is the port-specific subsystem of the Postgres backend.</para>
565 <indexterm zone="postgresql libgport">
566 <primary sortas="c-libgport">libgport.a</primary>
567 </indexterm>
568 </listitem>
569 </varlistentry>
570
571 <varlistentry id="libpgtypes">
572 <term><filename class='libraryfile'>libpgtypes.{so,a}</filename></term>
573 <listitem>
574 <para>contains functions for dealing with Postgres data types.</para>
575 <indexterm zone="postgresql libpgtypes">
576 <primary sortas="c-libpgtypes">libpgtypes.{so,a}</primary>
577 </indexterm>
578 </listitem>
579 </varlistentry>
580
581 <varlistentry id="libpq">
582 <term><filename class='libraryfile'>libpq.{so,a}</filename></term>
583 <listitem>
584 <para>is the C programmer's API to Postgres.</para>
585 <indexterm zone="postgresql libpq">
586 <primary sortas="c-libpq">libpq.{so,a}</primary>
587 </indexterm>
588 </listitem>
589 </varlistentry>
590
591 </variablelist>
592
593 </sect2>
594
595</sect1>
Note: See TracBrowser for help on using the repository browser.