source: server/databases/postgresql.xml@ 5254d12

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

Standardized the id tag name of the Bootscripts package

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

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