source: content/databases/postgresql.xml@ a0f03b0

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 a0f03b0 was a0f03b0, checked in by Archaic <archaic@…>, 20 years ago

Inserting sect1info

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

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