source: server/databases/postgresql.xml@ 3cb0c57

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 3cb0c57 was 3cb0c57, checked in by Randy McMurchy <randy@…>, 18 years ago

Added the 'User Notes' wiki link to each package page; changed all instances of .[so,a] to .{so,a} (brackets changed to braces); changed all replaceable tags to use angle brackets instead of square brackets to encapsulate the text - commit #9

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

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