source: server/databases/postgresql.xml@ 6732c094

10.0 10.1 11.0 11.1 11.2 11.3 12.0 12.1 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 6732c094 was 6732c094, checked in by Randy McMurchy <randy@…>, 17 years ago

Updated all the XML files (and the one stylesheet) to use the 4.5 version of DocBook XML DTD

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

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