source: content/databases/postgresql.xml@ 78d0e3c

10.0 10.1 11.0 11.1 11.2 11.3 12.0 12.1 6.0 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 78d0e3c was 78d0e3c, checked in by Randy McMurchy <randy@…>, 20 years ago

Added optional dependencies to PostgreSQL and Qt; added additional configuration information to Qt

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

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