source: server/databases/postgresql.xml@ 9f12e36

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

Removed 'keywordset' blocks and extra spaces from the XML files (note this was by accident as I meant to do just in the gnome directory but I was in the root of BOOK when I ran the script, but this was going to happen anyway so I don't think it is a big deal)

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

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