source: server/databases/postgresql.xml@ 60d0f22

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 60d0f22 was 2a5310e8, checked in by Manuel Canales Esparcia <manuel@…>, 18 years ago

Typo fix. Server.

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