source: server/databases/postgresql.xml@ 4d3e5f1

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

Fixed broken download URLs in various package instructions

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

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