source: content/databases/postgresql.xml@ 7f76b96

10.0 10.1 11.0 11.1 11.2 11.3 12.0 12.1 6.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 7f76b96 was 7f76b96, checked in by Manuel Canales Esparcia <manuel@…>, 19 years ago

Reverted the DTD change. That don't be done untiltomorrow.

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

  • Property mode set to 100644
File size: 12.6 KB
Line 
1<?xml version="1.0" encoding="ISO-8859-1"?>
2<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN"
3 "http://www.oasis-open.org/docbook/xml/4.3/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 "f0ea2b372a7bdaf2613e92176ebf5e0f">
10 <!ENTITY postgresql-size "10.2 MB">
11 <!ENTITY postgresql-buildsize "236 MB">
12 <!ENTITY postgresql-time "1.21 SBU">
13]>
14
15<sect1 id="postgresql" xreflabel="PostgreSQL-&postgresql-version;">
16<sect1info>
17<othername>$LastChangedBy$</othername>
18<date>$Date$</date>
19</sect1info>
20<?dbhtml filename="postgresql.html"?>
21<title>Postgre<acronym>SQL</acronym>-&postgresql-version;</title>
22
23<sect2>
24<title>Introduction to <application>Postgre<acronym>SQL</acronym></application>
25</title>
26
27<para><application>Postgre<acronym>SQL</acronym></application> is an advanced
28object-relational database management system (<acronym>ORDBMS</acronym>),
29derived from the Berkeley Postgres database management system.</para>
30
31<sect3><title>Package information</title>
32<itemizedlist spacing='compact'>
33<listitem><para>Download (HTTP):
34<ulink url="&postgresql-download-http;"/></para></listitem>
35<listitem><para>Download (FTP):
36<ulink url="&postgresql-download-ftp;"/></para></listitem>
37<listitem><para>Download MD5 sum: &postgresql-md5sum;</para></listitem>
38<listitem><para>Download size: &postgresql-size;</para></listitem>
39<listitem><para>Estimated disk space required:
40&postgresql-buildsize;</para></listitem>
41<listitem><para>Estimated build time:
42&postgresql-time;</para></listitem></itemizedlist>
43</sect3>
44
45<sect3><title>Additional downloads</title>
46<itemizedlist spacing='compact'>
47<listitem><para>Required patch: <ulink
48url="&patch-root;/postgresql-&postgresql-version;-dsssl_fix-1.patch"/></para>
49</listitem></itemizedlist>
50</sect3>
51
52<sect3><title><application>Postgre<acronym>SQL</acronym></application>
53dependencies</title>
54<sect4><title>Optional</title>
55<para><xref linkend="python"/>,
56<xref linkend="tcl"/>,
57<xref linkend="tk"/>,
58<xref linkend="openssl"/>,
59<xref linkend="Linux_PAM"/>,
60<xref linkend="sgml-dtd-3"/>,
61<xref linkend="docbook-dsssl"/>,
62<xref linkend="openjade"/>,
63<xref linkend="perl-modules"/>: SGMLSpm-&SGMLSpm-version;,
64<ulink url="http://www.pdc.kth.se/kth-krb/">krb4</ulink>,
65<xref linkend="mitkrb"/> or <xref linkend="heimdal"/>,
66<xref linkend="apache-ant"/> and
67<ulink url="http://rendezvous.sourceforge.net/">Rendezvous</ulink></para>
68</sect4>
69</sect3>
70
71</sect2>
72
73<sect2>
74<title>Installation of <application>Postgre<acronym>SQL</acronym></application>
75</title>
76
77<para>In order for <command>configure</command> to properly discover
78<application>Docbook <acronym>SGML</acronym>
79<acronym>DTD</acronym></application> (v3.1), you may need to remove
80<application>OpenSP</application> catalog definitions from the system
81<acronym>SGML</acronym> catalogs. Use the following command before building
82the package to accomplish this:</para>
83
84<screen><userinput><command>sed -i.orig \
85 -e "/CATALOG \/etc\/sgml\/OpenSP-1.5.1.cat/d" \
86 /etc/sgml/catalog \
87 /etc/sgml/sgml-docbook.cat</command></userinput></screen>
88
89<para>Install <application>Postgre<acronym>SQL</acronym></application> with the
90following commands: </para>
91
92<screen><userinput><command>patch -Np1 -i ../postgresql-&postgresql-version;-dsssl_fix-1.patch &amp;&amp;
93./configure --prefix=/usr --enable-thread-safety &amp;&amp;
94make &amp;&amp;
95make install &amp;&amp;
96chown -R root:root /usr/share/doc/postgresql/html</command></userinput></screen>
97
98<para>The standard installation provides only the header files needed
99for client application development. Server-side applications require
100the entire <application>Postgre<acronym>SQL</acronym></application>
101include tree which can be installed using the following command:</para>
102
103<screen><userinput><command>make install-all-headers</command></userinput></screen>
104
105<note><para>If you are upgrading an existing system and are going to
106install the new files over the old ones, then you should
107back up your data, shut down the old server and follow the
108instructions in <ulink
109url="http://www.postgresql.org/docs/7.4/static/install-upgrading.html">the
110official <application>Postgre<acronym>SQL</acronym></application>
111documentation</ulink>.</para></note>
112
113<para>Initialize a database cluster with the following commands:</para>
114
115<screen><userinput><command>mkdir -p /srv/pgsql/data &amp;&amp;
116useradd -d /srv/pgsql/data postgres &amp;&amp;
117chown postgres /srv/pgsql/data &amp;&amp;
118su - postgres -c '/usr/bin/initdb -D /srv/pgsql/data'</command></userinput></screen>
119
120<para>Start the database server with the following command:</para>
121
122<screen><userinput><command>su - postgres -c '/usr/bin/postmaster -D /srv/pgsql/data > \
123 /srv/pgsql/data/logfile 2&gt;&amp;1 &amp;'</command></userinput></screen>
124
125<para>Create a database and verify the installation:</para>
126
127<screen><userinput><command>su - postgres -c '/usr/bin/createdb test' &amp;&amp;
128echo "create table t1 ( name varchar(20), state_province varchar(20) );" \
129 | (su - postgres -c '/usr/bin/psql test ') &amp;&amp;
130echo "insert into t1 values ('Billy', 'NewYork');" \
131 | (su - postgres -c '/usr/bin/psql test ') &amp;&amp;
132echo "insert into t1 values ('Evanidus', 'Quebec');" \
133 | (su - postgres -c '/usr/bin/psql test ') &amp;&amp;
134echo "insert into t1 values ('Jesse', 'Ontario');" \
135 | (su - postgres -c '/usr/bin/psql test ') &amp;&amp;
136echo "select * from t1;" | (su - postgres -c '/usr/bin/psql test')</command></userinput></screen>
137
138</sect2>
139
140<sect2>
141<title>Command explanations</title>
142
143<para><parameter>--enable-thread-safety</parameter>: This switch makes the
144client libraries thread-safe by allowing concurrent threads in
145<filename class='libraryfile'>libpq</filename> and <acronym>ECPG</acronym>
146programs to safely control their private connection handles.</para>
147
148<para><command>chown -R root:root /usr/share/doc/postgresql/html</command>:
149This command corrects the improper ownership of some documentation
150files.</para>
151
152<para><command>useradd -d /srv/pgsql/data postgres</command>: Add an
153unprivileged user to run the database server.</para>
154
155<para><command>createdb test, create table t1 , insert into t1 values...,
156select * from t1</command>: Create a database, add a table to it, insert some
157rows into the table and select them to verify that the installation is working
158properly.</para>
159
160</sect2>
161
162<sect2>
163<title>Configuring <application>Postgre<acronym>SQL</acronym></application>
164</title>
165
166<sect3>
167<title>Config files</title>
168
169<para><filename>$PGDATA/pg_ident.con</filename>,
170<filename>$PGDATA/pg_hba.conf</filename> and
171<filename>$PGDATA/postgresql.conf</filename></para>
172
173<para>The <envar>PGDATA</envar> environment variable is used to distinguish
174database clusters from one another by setting it to the value of the directory
175which contains the cluster desired. The three configuration files
176exist in every <filename class="directory">PGDATA/</filename> directory.
177Details on the format of the files and the options that can be set in
178each can be found in <ulink
179url="file:///usr/share/doc/postgresql/html/index.html"/>.</para>
180
181<para>Install the <filename>/etc/rc.d/init.d/postgresql</filename>
182init script included in the <xref linkend="intro-important-bootscripts"/>
183package.</para>
184
185<screen><userinput><command>make install-postgresql</command></userinput></screen>
186
187</sect3>
188
189</sect2>
190
191<sect2>
192<title>Contents</title>
193
194<para>The <application>Postgre<acronym>SQL</acronym></application> package
195contains <command>clusterdb</command>,
196<command>createdb</command>,
197<command>createlang</command>,
198<command>createuser</command>,
199<command>dropdb</command>,
200<command>droplang</command>,
201<command>dropuser</command>,
202<command>ecpg</command>,
203<command>initdb</command>,
204<command>initlocation</command>,
205<command>ipcclean</command>,
206<command>pg_config</command>,
207<command>pg_controldata</command>,
208<command>pg_ctl</command>,
209<command>pg_dump</command>,
210<command>pg_dumpall</command>,
211<command>pg_encoding</command>,
212<command>pg_id</command>,
213<command>pg_resetxlog</command>,
214<command>pg_restore</command>,
215<command>pgtclsh</command>,
216<command>pgtksh</command>,
217<command>pltcl_delmod</command>,
218<command>pltcl_listmod</command>,
219<command>pltcl_loadmod</command>,
220<command>postgres</command>,
221<command>postmaster</command>,
222<command>psql</command>,
223<command>vacuumdb</command>,
224<filename class="libraryfile">libecpg</filename>,
225<filename class="libraryfile">libpgtcl</filename>,
226<filename class="libraryfile">libpgtypes</filename>,
227<filename class="libraryfile">libpq</filename> and various charset
228modules.</para>
229
230</sect2>
231
232<sect2><title>Description</title>
233
234<sect3><title>clusterdb</title>
235<para><command>clusterdb</command> is a utility for reclustering tables
236in a <application>Postgre<acronym>SQL</acronym></application>
237database.</para></sect3>
238
239<sect3><title>createdb</title>
240<para><command>createdb</command> creates a new
241<application>Postgre<acronym>SQL</acronym></application> database.</para>
242</sect3>
243
244<sect3><title>createlang</title>
245<para><command>createlang</command> defines a new
246<application>Postgre<acronym>SQL</acronym></application> procedural
247language.</para></sect3>
248
249<sect3><title>createuser</title>
250<para><command>createuser</command> defines a new
251<application>Postgre<acronym>SQL</acronym></application> user account.</para>
252</sect3>
253
254<sect3><title>dropdb</title>
255<para><command>dropdb</command> removes a
256<application>Postgre<acronym>SQL</acronym></application> database.</para>
257</sect3>
258
259<sect3><title>droplang</title>
260<para><command>droplang</command> removes a
261<application>Postgre<acronym>SQL</acronym></application> procedural
262language.</para></sect3>
263
264<sect3><title>dropuser</title>
265<para><command>dropuser</command> removes a
266<application>Postgre<acronym>SQL</acronym></application> user account.</para>
267</sect3>
268
269<sect3><title>ecpg</title>
270<para><command>ecpg</command> is the embedded <acronym>SQL</acronym>
271preprocessor.</para></sect3>
272
273<sect3><title>initdb</title>
274<para><command>initdb</command> create a new database cluster.</para></sect3>
275
276<sect3><title>initlocation</title>
277<para><command>initlocation</command> creates a secondary database storage
278area.</para></sect3>
279
280<sect3><title>ipcclean</title>
281<para><command>ipcclean</command> removes shared memory and semaphores left
282over by an aborted database server.</para></sect3>
283
284<sect3><title>pg_config</title>
285<para><command>pg_config</command> retrieves
286<application>Postgre<acronym>SQL</acronym></application> version
287information.</para></sect3>
288
289<sect3><title>pg_controldata</title>
290<para><command>pg_controldata</command> returns information initialized during
291<command>initdb</command>, such as the catalog version and server
292locale.</para></sect3>
293
294<sect3><title>pg_ctl</title>
295<para><command>pg_ctl</command> controls stopping and starting the database
296server.</para></sect3>
297
298<sect3><title>pg_dump</title>
299<para><command>pg_dump</command> dumps database data and metadata into scripts
300which are used to recreate the database.</para></sect3>
301
302<sect3><title>pg_dumpall</title>
303<para><command>pg_dumpall</command> recursively calls
304<command>pg_dump</command> for each database in a
305cluster.</para></sect3>
306
307<sect3><title>pg_resetxlog</title>
308<para><command>pg_resetxlog</command> clears the write-ahead log and optionally
309resets some fields in the <filename>pg_control</filename> file.</para></sect3>
310
311<sect3><title>pg_restore</title>
312<para><command>pg_restore</command> creates databases from dump files created by
313<command>pg_dump</command>.</para></sect3>
314
315<sect3><title>pgtclsh</title>
316<para><command>pgtclsh</command> is a <application>Tcl</application>
317shell interface extended with
318<application>Postgre<acronym>SQL</acronym></application> database access
319functions.</para></sect3>
320
321<sect3><title>pgtksh</title>
322<para><command>pgtksh</command> is a
323<application>Tcl</application>/<application>Tk</application> shell
324interface extended with
325<application>Postgre<acronym>SQL</acronym></application> database access
326functions.</para></sect3>
327
328<sect3><title>postgres</title>
329<para><command>postgres</command> is a single user database server, generally
330used for debugging.</para></sect3>
331
332<sect3><title>postmaster</title>
333<para><command>postmaster</command> is the multi-user database daemon.</para>
334</sect3>
335
336<sect3><title>psql</title>
337<para><command>psql</command> is a console based database shell.</para></sect3>
338
339<sect3><title>vacuumdb</title>
340<para><command>vacuumdb</command> compacts databases and generates statistics
341for the query analyzer.</para></sect3>
342
343</sect2>
344
345</sect1>
Note: See TracBrowser for help on using the repository browser.