source: server/databases/postgresql.xml@ 3f1fb0a

lazarus trunk
Last change on this file since 3f1fb0a was c68a26c, checked in by Douglas R. Reno <renodr@…>, 9 days ago

PostgreSQL: The --enable-thread-safety option is no longer valid.

According to the log it seems to have been dropped in this version
(17.0).

  • Property mode set to 100644
File size: 35.1 KB
RevLine 
[ab4fdfc]1<?xml version="1.0" encoding="UTF-8"?>
[6732c094]2<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
3 "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
[08254fc]4 <!ENTITY % general-entities SYSTEM "../../general.ent">
5 %general-entities;
6
[c6b192c]7 <!ENTITY postgresql-download-http "https://ftp.postgresql.org/pub/source/v&postgresql-version;/postgresql-&postgresql-version;.tar.bz2">
[af33199]8 <!ENTITY postgresql-download-ftp " ">
[60a43269]9 <!ENTITY postgresql-md5sum "97601aa2d849252d51c1022960b0abfa">
10 <!ENTITY postgresql-size "20 MB">
11 <!ENTITY postgresql-buildsize "247 MB (add 86 MB for tests)">
12 <!ENTITY postgresql-time "0.8 SBU (with parallelism=4, add 0.1 SBU for tests)">
[08254fc]13]>
14
[458342f]15<sect1 id="postgresql" xreflabel="PostgreSQL-&postgresql-version;">
[4ab91cd]16 <?dbhtml filename="postgresql.html"?>
17
18
19 <title>PostgreSQL-&postgresql-version;</title>
20
21 <indexterm zone="postgresql">
22 <primary sortas="a-PostgreSQL">PostgreSQL</primary>
23 </indexterm>
24
25 <sect2 role="package">
26 <title>Introduction to PostgreSQL</title>
27
[4472e923]28 <para>
29 <application>PostgreSQL</application> is an advanced
30 object-relational database management system (ORDBMS), derived
31 from the Berkeley Postgres database management system.
32 </para>
[4ab91cd]33
[41a882a]34 &lfs122_checked;
[a1813d08]35
[4ab91cd]36 <bridgehead renderas="sect3">Package Information</bridgehead>
37 <itemizedlist spacing="compact">
38 <listitem>
[4472e923]39 <para>
40 Download (HTTP): <ulink url="&postgresql-download-http;"/>
41 </para>
[4ab91cd]42 </listitem>
43 <listitem>
[4472e923]44 <para>
45 Download (FTP): <ulink url="&postgresql-download-ftp;"/>
46 </para>
[4ab91cd]47 </listitem>
48 <listitem>
[4472e923]49 <para>
50 Download MD5 sum: &postgresql-md5sum;
51 </para>
[4ab91cd]52 </listitem>
53 <listitem>
[4472e923]54 <para>
55 Download size: &postgresql-size;
56 </para>
[4ab91cd]57 </listitem>
58 <listitem>
[4472e923]59 <para>
60 Estimated disk space required: &postgresql-buildsize;
61 </para>
[4ab91cd]62 </listitem>
63 <listitem>
[4472e923]64 <para>
65 Estimated build time: &postgresql-time;
66 </para>
[4ab91cd]67 </listitem>
68 </itemizedlist>
69
70 <bridgehead renderas="sect3">PostgreSQL Dependencies</bridgehead>
71
72 <bridgehead renderas="sect4">Optional</bridgehead>
[a7ff037]73 <para role="optional">
[eee261a]74 <xref linkend="icu"/>,
[a7ff037]75 <xref linkend="libxml2"/>,
76 <xref linkend="libxslt"/>,
77 <xref linkend="openldap"/>,
78 <xref linkend="linux-pam"/>,
79 <xref linkend="mitkrb"/> and
[88057a1]80 <ulink url="https://developer.apple.com/bonjour/">Bonjour</ulink>
[a7ff037]81 </para>
[5aa1d3dd]82
83 <bridgehead renderas="sect4">Optional (To Regenerate Documentation)</bridgehead>
[a7ff037]84 <para role="optional">
[af1a5b1]85 <xref linkend="fop"/>,
[a7ff037]86 <xref linkend="sgml-dtd"/>,
87 <xref linkend="docbook-dsssl"/>,
[af1a5b1]88 <xref linkend="docbook-utils"/>,
[a7ff037]89 <xref linkend="openjade"/>, and
[4392a40]90 <xref linkend="perl-sgmlspm"/>
[a7ff037]91 </para>
[4ab91cd]92
[42ddc30]93 <para condition="html" role="usernotes">Editor Notes:
[3cb0c57]94 <ulink url="&blfs-wiki;/postgresql"/></para>
95
[4ab91cd]96 </sect2>
97
98 <sect2 role="installation">
99 <title>Installation of PostgreSQL</title>
100
[8753831e]101 <para>
102 For enhanced security, it is better to have a dedicated group and user
103 for running the PostgreSQL server. First, issue as the
104 <systemitem class="username">root</systemitem> user:
105 </para>
106
107<screen role="root"><userinput>groupadd -g 41 postgres &amp;&amp;
108useradd -c "PostgreSQL Server" -g postgres -d /srv/pgsql/data \
109 -u 41 postgres</userinput></screen>
110
[4472e923]111 <note>
112 <para>
113 There are several configuration items that add additional
114 functionality with optional packages to
115 <application>PostgreSQL</application>. Use <command>./configure
116 --help</command> to see a list.
117 </para>
118 </note>
[9b98149]119
[4472e923]120 <para>
121 Install <application>PostgreSQL</application> with the
122 following commands:
123 </para>
[08254fc]124
[62a6a73]125<screen><userinput>sed -i '/DEFAULT_PGSOCKET_DIR/s@/tmp@/run/postgresql@' src/include/pg_config_manual.h &amp;&amp;
[5be5fc08]126
[c68a26c]127./configure --prefix=/usr \
[e0cafc9]128 --docdir=/usr/share/doc/postgresql-&postgresql-version; &amp;&amp;
[4ab91cd]129make</userinput></screen>
[44e4099]130
[4472e923]131 <para>
132 There are a number of programs in the
133 <filename class="directory">contrib/</filename> directory. If you are
134 going to run this installation as a server and wish to build some of
135 them, enter <command>make -C contrib</command> or <command>make -C
136 contrib/<replaceable>&lt;SUBDIR-NAME&gt;</replaceable></command> for
137 each subdirectory.
[782bf3d0]138 </para>
139
[4472e923]140 <para>
141 Tests must be run as an unprivileged user because they need to start a
142 temporary server and this is prevented as the root user. For the same
143 reason, you need to stop all PostgreSQL servers if any are running. If a
144 previous version of PostgreSQL is installed, it may be necessary to use
145 <command>--disable-rpath</command> with <command>configure</command> to
146 avoid failures, but <emphasis>installing the binaries created using this
147 switch is not recommended</emphasis>. To test the results, issue:
148 <command>make check</command>.
149 </para>
[49a38a1]150
[bcdfc53]151 <note>
[7a9a7b26]152 <para>If you are installing <application>PostgreSQL</application> to
[60351e5b]153 upgrade an existing installation, there are important steps that you need
154 to follow. If the major version of the new build is greater than the
155 previous version, there is a chance that the data file format has changed.
[e3cde1fc]156 New software cannot use the existing data files. In this case, the
[60351e5b]157 server will not start because the old programs have been overwritten, so
158 the data is unavailable until it's file format has been converted.</para>
[a38fe9f]159
160 <para>
[60351e5b]161 Before upgrading an existing installation of PostgreSQL, check
162 the documentation for any considerations that you must keep in mind
[7a9a7b26]163 during the upgrade. Note that new major versions might use a different
[60351e5b]164 binary format in the data objects, causing potential incompatibilities.
[e3cde1fc]165 For more information, please review upstream's documentation about
166 upgrading PostgreSQL here:
[a38fe9f]167 <ulink url="https://www.postgresql.org/docs/current/upgrading.html"/>.
168 </para>
169
[60351e5b]170 <para>At this point, you may have both the old and the new binaries
[7a9a7b26]171 installed on your filesystem. These binaries can be used to perform an
172 upgrade of your existing database files. For the following instructions
[60351e5b]173 it is assumed that
[bcdfc53]174 <itemizedlist>
175 <listitem><para>The actual data files are stored in
176 <filename class="directory">/srv/pgsql/data</filename></para>
177 </listitem>
178 <listitem><para>The upgraded data files will be stored in
179 <filename class="directory">/srv/pgsql/newdata</filename></para>
180 </listitem>
181 <listitem><para>There is enough disk space to hold the actual
182 data files twice. The upgrade is not an inline upgrade but
183 it will copy the data to new database files.</para>
184 </listitem>
185 </itemizedlist>
186 </para>
187
[228248e]188 <para>First, do a temporary install which makes access to the new
[60351e5b]189 binaries much easier:</para>
[bc9c5251]190<screen role="nodump"><userinput>make DESTDIR=$(pwd)/DESTDIR install</userinput></screen>
[bcdfc53]191
[60351e5b]192 <para>Next, create a directory which is writable by the
193 <systemitem class="username">postgres</systemitem> user, as the
[bcdfc53]194 <systemitem class="username">root</systemitem> user:</para>
[7a9a7b26]195
[27abacc]196<screen role="nodump"><userinput>install -d -o postgres $(pwd)/DESTDIR/tmp</userinput></screen>
[7a9a7b26]197
[bcdfc53]198 <para>Now, stop the existing instance of <application>PostgreSQL</application>
199 and start the upgrade process as the
200 <systemitem class="username">root</systemitem> user:</para>
[7a9a7b26]201
[bc9c5251]202<screen revision="sysv" role="nodump"><userinput>pushd $(pwd)/DESTDIR/tmp
[bcdfc53]203/etc/rc.d/init.d/postgresql stop
204su postgres -c "../usr/bin/initdb -D /srv/pgsql/newdata"
[e99a437]205su postgres -c "../usr/bin/pg_upgrade \
206 -d /srv/pgsql/data -b /usr/bin \
207 -D /srv/pgsql/newdata -B ../usr/bin"
[bcdfc53]208popd</userinput></screen>
[60351e5b]209
[9532fa4]210<screen revision="systemd" role="nodump"><userinput>pushd $(pwd)/DESTDIR/tmp
[60351e5b]211systemctl stop postgresql
212su postgres -c "../usr/bin/initdb -D /srv/pgsql/newdata"
213su postgres -c "../usr/bin/pg_upgrade \
214 -d /srv/pgsql/data -b /usr/bin \
215 -D /srv/pgsql/newdata -B ../usr/bin"
216popd</userinput></screen>
217
[228248e]218 <para>At this point, your database files are available in two locations on
[7a9a7b26]219 disk. The old data is located in
[60351e5b]220 <filename class="directory">/srv/pgsql/data</filename>, and the new data
221 is in <filename class="directory">/srv/pgsql/newdata</filename>.
[e3cde1fc]222 Backing up the old database files is recommended before continuing.</para>
[7a9a7b26]223
224 <para>Next, remove the old database files, and rename the new data
[bcdfc53]225 directory as the <systemitem class="username">root</systemitem> user:</para>
[7a9a7b26]226
[bc9c5251]227<screen role="nodump"><userinput>rm -rf /srv/pgsql/data
[bcdfc53]228mv /srv/pgsql/newdata /srv/pgsql/data</userinput></screen>
229
230 </note>
[7a9a7b26]231
[4472e923]232 <para>
233 Now, as the <systemitem class="username">root</systemitem> user:
234 </para>
[44e4099]235
[e0cafc9]236<screen role="root"><userinput>make install &amp;&amp;
[4f2c94fc]237make install-docs</userinput></screen>
[11404f5]238
[4472e923]239 <para>
240 If you made any of the <filename class="directory">contrib/</filename>
241 programs, as the <systemitem class="username">root</systemitem> user:
242 </para>
[782bf3d0]243
[ca8c3c05]244<screen role="nodump"><userinput>make -C contrib/<replaceable>&lt;SUBDIR-NAME&gt;</replaceable> install</userinput></screen>
[782bf3d0]245
[4472e923]246 <tip>
247 <para>
248 If you only intend to use <application>PostgreSQL</application> as a
249 client to connect to a server on another machine, your installation is
250 complete and you should not run the remaining commands.
251 </para>
252 </tip>
[08254fc]253
[bcdfc53]254 <para>
255 If you have upgraded an existing database, skip the rest of the
256 commands because your database is ready to use. If this is the
257 first time you install <application>PostgreSQL</application>,
258 continue with the initialization.
259 </para>
260
[4472e923]261 <para>
262 Initialize a database cluster with the following commands issued by the
263 <systemitem class="username">root</systemitem> user:
264 </para>
[08254fc]265
[faf325d]266<screen role="root"><userinput>install -v -dm700 /srv/pgsql/data &amp;&amp;
267install -v -dm755 /run/postgresql &amp;&amp;
[fcafd3d]268chown -Rv postgres:postgres /srv/pgsql /run/postgresql</userinput></screen>
269
[4472e923]270 <para>
271 Now, initialize the database as the <systemitem
272 class="username">root</systemitem> user:
273 </para>
[fcafd3d]274
[a7b7eceb]275<screen role="root"><userinput>su - postgres -c '/usr/bin/initdb -D /srv/pgsql/data'</userinput></screen>
[fcafd3d]276
[4ab91cd]277 </sect2>
278
279 <sect2 role="commands">
280 <title>Command Explanations</title>
281
[faf325d]282 <para>
[eee261a]283 <command>sed -i ...</command>: This sed changes the server socket location
[faf325d]284 from <filename class="directory">/tmp</filename> to
[0adae6f]285 <filename class="directory">/run/postgresql</filename>.
[faf325d]286 </para>
287
[c68a26c]288 <!-- Removed in 17.0
[4472e923]289 <para>
[c68a26c]290 <parameter>- -enable-thread-safety</parameter>: This switch makes the
[4472e923]291 client libraries thread-safe by allowing concurrent threads in
292 <filename class="libraryfile">libpq</filename> and ECPG programs to
293 safely control their private connection handles.
294 </para>
[c68a26c]295-->
[4ab91cd]296
[4472e923]297 <para>
298 <option>--with-openssl</option>: builds the package with support for
299 <application>OpenSSL</application> encrypted connections.
300 </para>
[a2957b7]301
[4472e923]302 <para>
303 <option>--with-perl</option>: builds the PL/Perl server-side language.
[76acb620]304 </para>
305
[4472e923]306 <para>
307 <option>--with-python</option>: builds the PL/Python server-side
[e3cde1fc]308 language.
[4472e923]309 </para>
[76acb620]310
[4472e923]311 <para>
312 <option>--with-tcl</option>: builds the PL/Tcl server-side language.
313 </para>
[76acb620]314
[4ab91cd]315 </sect2>
316
317 <sect2 role="configuration">
318 <title>Configuring PostgreSQL</title>
319
320 <sect3 id="postgresql-config">
321 <title>Config Files</title>
322
[4472e923]323 <para>
324 <filename>$PGDATA/pg_ident.con</filename>,
325 <filename>$PGDATA/pg_hba.conf</filename>, and
326 <filename>$PGDATA/postgresql.conf</filename>
327 </para>
[4ab91cd]328
329 <indexterm zone="postgresql postgresql-config">
330 <primary sortas="e-A.PGDATA-pg_ident.con">$PGDATA/pg_indent.con</primary>
331 </indexterm>
332
333 <indexterm zone="postgresql postgresql-config">
334 <primary sortas="e-A.PGDATA-pg_hba.conf">$PGDATA/pg_hba_conf</primary>
335 </indexterm>
336
337 <indexterm zone="postgresql postgresql-config">
338 <primary sortas="e-A.PGDATA-postgresql.conf">$PGDATA/postgresql.conf</primary>
339 </indexterm>
340
[4472e923]341 <para>
342 The <envar>PGDATA</envar> environment variable is used to
343 distinguish database clusters from one another by setting it to
344 the value of the directory which contains the cluster desired.
345 The three configuration files exist in every <filename
346 class="directory">PGDATA/</filename> directory. Details on the
347 format of the files and the options that can be set in each can
348 be found in <filename>
349 /usr/share/doc/postgresql-&postgresql-version;/html/index.html</filename>.
350 </para>
[4ab91cd]351
352 </sect3>
353
354 <sect3 id="postgresql-init">
[1258125]355 <title><phrase revision="sysv">Boot Script</phrase>
356 <phrase revision="systemd">Systemd Unit</phrase></title>
357
[4472e923]358 <para>
359 Install the
360 <phrase revision="sysv"><filename>/etc/rc.d/init.d/postgresql</filename>
361 init script</phrase>
362 <phrase revision="systemd"><filename>postgresql.service</filename>
363 unit</phrase> included in the
364 <xref linkend="bootscripts" revision="sysv"/>
365 <xref linkend="systemd-units" revision="systemd"/> package:
366 </para>
[4ab91cd]367
368 <indexterm zone="postgresql postgresql-init">
369 <primary sortas="f-postgresql">postgresql</primary>
370 </indexterm>
371
372<screen role="root"><userinput>make install-postgresql</userinput></screen>
373
374 </sect3>
375
[8753831e]376 <sect3>
377 <title>Starting the PostgreSQL Server and Creating a Sample Database</title>
378
379 <para>
380 The database server can be manually started with the following command
381 (as the <systemitem class="username">root</systemitem> user):
382 </para>
383
384<screen role="root"><userinput>su - postgres -c '/usr/bin/postgres -D /srv/pgsql/data > \
385 /srv/pgsql/data/logfile 2&gt;&amp;1 &amp;'</userinput></screen>
386 <note>
387 <para>
388 If you are scripting this part, you should wait for the server to
389 start before going on, by adding for example
390 <command>sleep 2</command> after the above command.
391 </para>
392 </note>
393
394 <para>
395 The instructions below show how to create a database, add a table to
396 it, insert some rows into the table and select them, to verify that the
397 installation is working properly. Still as user <systemitem
398 class="username">root</systemitem>, issue:
399 </para>
400
401<screen role="root"><userinput>su - postgres -c '/usr/bin/createdb test' &amp;&amp;
402echo "create table t1 ( name varchar(20), state_province varchar(20) );" \
403 | (su - postgres -c '/usr/bin/psql test ') &amp;&amp;
404echo "insert into t1 values ('Billy', 'NewYork');" \
405 | (su - postgres -c '/usr/bin/psql test ') &amp;&amp;
406echo "insert into t1 values ('Evanidus', 'Quebec');" \
407 | (su - postgres -c '/usr/bin/psql test ') &amp;&amp;
408echo "insert into t1 values ('Jesse', 'Ontario');" \
409 | (su - postgres -c '/usr/bin/psql test ') &amp;&amp;
410echo "select * from t1;" | (su - postgres -c '/usr/bin/psql test')</userinput></screen>
411
412 <para>
[4472e923]413 When you are done with testing, you can shut down the server, by
414 issuing as <systemitem class="username">root</systemitem>:
[8753831e]415 </para>
416
417<screen role="root"><userinput>su - postgres -c "/usr/bin/pg_ctl stop -D /srv/pgsql/data"</userinput></screen>
418
419 </sect3>
420
[4ab91cd]421 </sect2>
422
423 <sect2 role="content">
424 <title>Contents</title>
425
426 <segmentedlist>
427 <segtitle>Installed Programs</segtitle>
428 <segtitle>Installed Libraries</segtitle>
429 <segtitle>Installed Directories</segtitle>
430
431 <seglistitem>
[1a60731f]432 <seg>
[a82b5f44]433 clusterdb, createdb, createuser, dropdb, dropuser,
[0adae6f]434 ecpg, initdb, pg_amcheck, pg_archivecleanup, pg_basebackup,
435 pg_checksums,
[f1ae52ff]436 pg_config, pg_controldata, pg_ctl, pg_dump, pg_dumpall, pg_isready,
437 pg_receivewal, pg_recvlogical, pg_resetwal, pg_restore, pg_rewind,
[eee261a]438 pg_test_fsync, pg_test_timing, pg_upgrade, pg_verifybackup,
[ace0703]439 pg_waldump, pgbench, postgres, psql, reindexdb, vacuumdb,
[fa30d84]440 optionally, if Tcl support has been built, pltcl_delmod,
441 pltcl_listmod, pltcl_loadmod, and optionally (in contrib/) oid2name,
442 pg_standby, vacuumlo, and many others
443
[1a60731f]444 </seg>
445 <seg>
[8558044]446 libecpg.{so,a}, libecpg_compat.{so,a}, libpgcommon.a,
[f1ae52ff]447 libpgcommon_shlib.a, libpgfeutils.a, libpgport.a, libpgport_shlib.a,
[a82b5f44]448 libpgtypes.{so,a}, libpq.{so,a}, various charset modules and
[1a60731f]449 optionally programming language modules under /usr/lib/postgresql
450 </seg>
451 <seg>
452 /usr/include/{libpq,postgresql},
453 /usr/lib/postgresql,
[9ad19294]454 /usr/share/{doc/postgresql-&postgresql-version;,postgresql}, and
[1a60731f]455 /srv/pgsql
456 </seg>
[4ab91cd]457 </seglistitem>
458 </segmentedlist>
459
460 <variablelist>
461 <bridgehead renderas="sect3">Short Descriptions</bridgehead>
462 <?dbfo list-presentation="list"?>
463 <?dbhtml list-presentation="table"?>
464
465 <varlistentry id="clusterdb">
466 <term><command>clusterdb</command></term>
467 <listitem>
[4472e923]468 <para>
469 is a utility for reclustering tables in a
[4c24eb0a]470 <application>PostgreSQL</application> database
[4472e923]471 </para>
[4ab91cd]472 <indexterm zone="postgresql clusterdb">
473 <primary sortas="b-clusterdb">clusterdb</primary>
474 </indexterm>
475 </listitem>
476 </varlistentry>
477
478 <varlistentry id="createdb">
479 <term><command>createdb</command></term>
480 <listitem>
[4472e923]481 <para>
482 creates a new <application>PostgreSQL</application>
[4c24eb0a]483 database
[4472e923]484 </para>
[4ab91cd]485 <indexterm zone="postgresql createdb">
486 <primary sortas="b-createdb">createdb</primary>
487 </indexterm>
488 </listitem>
489 </varlistentry>
[8558044]490
[4ab91cd]491 <varlistentry id="createuser">
492 <term><command>createuser</command></term>
493 <listitem>
[4472e923]494 <para>
495 defines a new <application>PostgreSQL</application>
[4c24eb0a]496 user account
[4472e923]497 </para>
[4ab91cd]498 <indexterm zone="postgresql createuser">
499 <primary sortas="b-createuser">createuser</primary>
500 </indexterm>
501 </listitem>
502 </varlistentry>
503
504 <varlistentry id="dropdb">
505 <term><command>dropdb</command></term>
506 <listitem>
[4472e923]507 <para>
[4c24eb0a]508 removes a <application>PostgreSQL</application> database
[4472e923]509 </para>
[4ab91cd]510 <indexterm zone="postgresql dropdb">
511 <primary sortas="b-dropdb">dropdb</primary>
512 </indexterm>
513 </listitem>
514 </varlistentry>
515
516 <varlistentry id="dropuser">
517 <term><command>dropuser</command></term>
518 <listitem>
[4472e923]519 <para>
[4c24eb0a]520 removes a <application>PostgreSQL</application> user account
[4472e923]521 </para>
[4ab91cd]522 <indexterm zone="postgresql dropuser">
523 <primary sortas="b-dropuser">dropuser</primary>
524 </indexterm>
525 </listitem>
526 </varlistentry>
527
528 <varlistentry id="ecpg">
529 <term><command>ecpg</command></term>
530 <listitem>
[4472e923]531 <para>
[4c24eb0a]532 is the embedded SQL preprocessor
[4472e923]533 </para>
[4ab91cd]534 <indexterm zone="postgresql ecpg">
535 <primary sortas="b-ecpg">ecpg</primary>
536 </indexterm>
537 </listitem>
538 </varlistentry>
539
540 <varlistentry id="initdb">
541 <term><command>initdb</command></term>
542 <listitem>
[4472e923]543 <para>
[4c24eb0a]544 creates a new database cluster
[4472e923]545 </para>
[4ab91cd]546 <indexterm zone="postgresql initdb">
547 <primary sortas="b-initdb">initdb</primary>
548 </indexterm>
549 </listitem>
550 </varlistentry>
551
[782bf3d0]552 <varlistentry id="oid2name">
553 <term><command>oid2name</command></term>
554 <listitem>
[4472e923]555 <para>
556 resolves OIDs (Object IDs) and file nodes in a PostgreSQL data
[4c24eb0a]557 directory
[4472e923]558 </para>
[782bf3d0]559 <indexterm zone="postgresql oid2name">
560 <primary sortas="b-oid2name">oid2name</primary>
561 </indexterm>
562 </listitem>
563 </varlistentry>
564
[0adae6f]565 <varlistentry id="pg_amcheck">
566 <term><command>pg_amcheck</command></term>
567 <listitem>
568 <para>
569 checks for corruption in one or more PostgreSQL databases
570 </para>
571 <indexterm zone="postgresql pg_amcheck">
572 <primary sortas="b-pg_amcheck">pg_amcheck</primary>
573 </indexterm>
574 </listitem>
575 </varlistentry>
576
[782bf3d0]577 <varlistentry id="pg_archivecleanup">
578 <term><command>pg_archivecleanup</command></term>
579 <listitem>
[4472e923]580 <para>
[4c24eb0a]581 cleans up PostgreSQL WAL (write-ahead log) archive files
[4472e923]582 </para>
[782bf3d0]583 <indexterm zone="postgresql pg_archivecleanup">
584 <primary sortas="b-pg_archivecleanup">pg_archivecleanup</primary>
585 </indexterm>
586 </listitem>
587 </varlistentry>
588
[a2957b7]589 <varlistentry id="pg_basebackup">
590 <term><command>pg_basebackup</command></term>
[4ab91cd]591 <listitem>
[4472e923]592 <para>
593 takes base backups of a running
[4c24eb0a]594 <application>PostgreSQL</application> cluster
[4472e923]595 </para>
[a2957b7]596 <indexterm zone="postgresql pg_basebackup">
597 <primary sortas="b-pg_basebackup">pg_basebackup</primary>
[4ab91cd]598 </indexterm>
599 </listitem>
600 </varlistentry>
601
[f1ae52ff]602 <varlistentry id="pg_checksums">
603 <term><command>pg_checksums</command></term>
604 <listitem>
605 <para>
606 enables, disables, or checks data checksums in a
[4c24eb0a]607 <application>PostgreSQL</application> database cluster
[f1ae52ff]608 </para>
609 <indexterm zone="postgresql pg_checksums">
610 <primary sortas="b-pg_checksums">pg_checksums</primary>
611 </indexterm>
612 </listitem>
613 </varlistentry>
614
[4ab91cd]615 <varlistentry id="pg_config">
616 <term><command>pg_config</command></term>
617 <listitem>
[4472e923]618 <para>
619 retrieves <application>PostgreSQL</application> version
[4c24eb0a]620 information
[4472e923]621 </para>
[4ab91cd]622 <indexterm zone="postgresql pg_config">
623 <primary sortas="b-pg_config">pg_config</primary>
624 </indexterm>
625 </listitem>
626 </varlistentry>
627
628 <varlistentry id="pg_controldata">
629 <term><command>pg_controldata</command></term>
630 <listitem>
[4472e923]631 <para>
632 returns information initialized during <command>initdb</command>,
[4c24eb0a]633 such as the catalog version and server locale
[4472e923]634 </para>
[4ab91cd]635 <indexterm zone="postgresql pg_controldata">
636 <primary sortas="b-pg_controldata">pg_controldata</primary>
637 </indexterm>
638 </listitem>
639 </varlistentry>
640
641 <varlistentry id="pg_ctl">
642 <term><command>pg_ctl</command></term>
643 <listitem>
[4472e923]644 <para>
[4c24eb0a]645 controls stopping and starting the database server
[4472e923]646 </para>
[4ab91cd]647 <indexterm zone="postgresql pg_ctl">
648 <primary sortas="b-pg_ctl">pg_ctl</primary>
649 </indexterm>
650 </listitem>
651 </varlistentry>
652
653 <varlistentry id="pg_dump">
654 <term><command>pg_dump</command></term>
655 <listitem>
[4472e923]656 <para>
657 dumps database data and metadata into scripts which are used
[4c24eb0a]658 to recreate the database
[4472e923]659 </para>
[4ab91cd]660 <indexterm zone="postgresql pg_dump">
661 <primary sortas="b-pg_dump">pg_dump</primary>
662 </indexterm>
663 </listitem>
664 </varlistentry>
665
666 <varlistentry id="pg_dumpall">
667 <term><command>pg_dumpall</command></term>
668 <listitem>
[4472e923]669 <para>
670 recursively calls <command>pg_dump</command> for each
[4c24eb0a]671 database in a cluster
[4472e923]672 </para>
[4ab91cd]673 <indexterm zone="postgresql pg_dumpall">
674 <primary sortas="b-pg_dumpall">pg_dumpall</primary>
675 </indexterm>
676 </listitem>
677 </varlistentry>
678
[782bf3d0]679 <varlistentry id="pg_isready">
680 <term><command>pg_isready</command></term>
681 <listitem>
[4472e923]682 <para>
[4c24eb0a]683 checks the connection status of a PostgreSQL server
[4472e923]684 </para>
[782bf3d0]685 <indexterm zone="postgresql pg_isready">
686 <primary sortas="b-pg_isready">pg_isready</primary>
687 </indexterm>
688 </listitem>
689 </varlistentry>
690
[1aecb6f]691 <varlistentry id="pg_receivewal">
692 <term><command>pg_receivewal</command></term>
[298fee30]693 <listitem>
694 <para>
[4c24eb0a]695 is used to stream write-ahead logs from a PostgreSQL server
[298fee30]696 </para>
[1aecb6f]697 <indexterm zone="postgresql pg_receivewal">
698 <primary sortas="b-pg_receivewal">pg_receivewal</primary>
[298fee30]699 </indexterm>
700 </listitem>
701 </varlistentry>
702
[0f23f29]703 <varlistentry id="pg_recvlogical">
704 <term><command>pg_recvlogical</command></term>
705 <listitem>
[4472e923]706 <para>
[4c24eb0a]707 controls PostgreSQL logical decoding streams
[4472e923]708 </para>
[0f23f29]709 <indexterm zone="postgresql pg_recvlogical">
710 <primary sortas="b-pg_recvlogical">pg_recvlogical</primary>
711 </indexterm>
712 </listitem>
713 </varlistentry>
714
[1aecb6f]715 <varlistentry id="pg_resetwal">
716 <term><command>pg_resetwal</command></term>
[4ab91cd]717 <listitem>
[4472e923]718 <para>
719 resets the write-ahead log and other control information
[4c24eb0a]720 of a PostgreSQL database cluster
[4472e923]721 </para>
[1aecb6f]722 <indexterm zone="postgresql pg_resetwal">
723 <primary sortas="b-pg_resetwal">pg_resetwal</primary>
[4ab91cd]724 </indexterm>
725 </listitem>
726 </varlistentry>
727
728 <varlistentry id="pg_restore">
729 <term><command>pg_restore</command></term>
730 <listitem>
[4472e923]731 <para>
732 creates databases from dump files created by
[4c24eb0a]733 <command>pg_dump</command>
[4472e923]734 </para>
[4ab91cd]735 <indexterm zone="postgresql pg_restore">
736 <primary sortas="b-pg_restore">pg_restore</primary>
737 </indexterm>
738 </listitem>
739 </varlistentry>
740
[edccd1f8]741 <varlistentry id="pg_rewind">
742 <term><command>pg_rewind</command></term>
743 <listitem>
[4472e923]744 <para>
745 synchronizes a PostgreSQL data directory with another data
[4c24eb0a]746 directory that was forked from the first one
[4472e923]747 </para>
[edccd1f8]748 <indexterm zone="postgresql pg_rewind">
749 <primary sortas="b-pg_rewind">pg_rewind</primary>
750 </indexterm>
751 </listitem>
752 </varlistentry>
753
[782bf3d0]754 <varlistentry id="pg_standby">
755 <term><command>pg_standby</command></term>
756 <listitem>
[4472e923]757 <para>
[4c24eb0a]758 supports the creation of a PostgreSQL warm standby server
[4472e923]759 </para>
[782bf3d0]760 <indexterm zone="postgresql pg_standby">
761 <primary sortas="b-pg_standby">pg_standby</primary>
762 </indexterm>
763 </listitem>
764 </varlistentry>
765
766 <varlistentry id="pg_test_fsync">
767 <term><command>pg_test_fsync</command></term>
768 <listitem>
[4472e923]769 <para>
[4c24eb0a]770 determines the fastest wal_sync method for PostgreSQL
[4472e923]771 </para>
[782bf3d0]772 <indexterm zone="postgresql pg_test_fsync">
773 <primary sortas="b-pg_test_fsync">pg_test_fsync</primary>
774 </indexterm>
775 </listitem>
776 </varlistentry>
777
778 <varlistentry id="pg_test_timing">
779 <term><command>pg_test_timing</command></term>
780 <listitem>
[4472e923]781 <para>
[4c24eb0a]782 measures timing overhead
[4472e923]783 </para>
[782bf3d0]784 <indexterm zone="postgresql pg_test_timing">
785 <primary sortas="b-pg_test_timing">pg_test_timing</primary>
786 </indexterm>
787 </listitem>
788 </varlistentry>
789
790 <varlistentry id="pg_upgrade">
791 <term><command>pg_upgrade</command></term>
792 <listitem>
[4472e923]793 <para>
[4c24eb0a]794 upgrades a PostgreSQL server instance
[4472e923]795 </para>
[782bf3d0]796 <indexterm zone="postgresql pg_upgrade">
797 <primary sortas="b-pg_upgrade">pg_upgrade</primary>
798 </indexterm>
799 </listitem>
800 </varlistentry>
801
[a82b5f44]802 <varlistentry id="pg_verifybackup">
803 <term><command>pg_verifybackup</command></term>
804 <listitem>
805 <para>
[4c24eb0a]806 verifies the integrity of a base backup of a PostgreSQL cluster
[a82b5f44]807 </para>
808 <indexterm zone="postgresql pg_verifybackup">
809 <primary sortas="b-pg_upgrade">pg_verifybackup</primary>
810 </indexterm>
811 </listitem>
812 </varlistentry>
813
[1aecb6f]814 <varlistentry id="pg_waldump">
815 <term><command>pg_waldump</command></term>
[782bf3d0]816 <listitem>
[4472e923]817 <para>
818 displays a human-readable rendering of the write-ahead log of a
[4c24eb0a]819 PostgreSQL database cluster
[4472e923]820 </para>
[1aecb6f]821 <indexterm zone="postgresql pg_waldump">
822 <primary sortas="b-pg_waldump">pg_waldump</primary>
[782bf3d0]823 </indexterm>
824 </listitem>
825 </varlistentry>
826
827 <varlistentry id="pgbench">
828 <term><command>pgbench</command></term>
829 <listitem>
[4472e923]830 <para>
[4c24eb0a]831 runs a benchmark test on PostgreSQL
[4472e923]832 </para>
[782bf3d0]833 <indexterm zone="postgresql pgbench">
834 <primary sortas="b-pgbench">pgbench</primary>
835 </indexterm>
836 </listitem>
837 </varlistentry>
838
[4ab91cd]839 <varlistentry id="pltcl_delmod">
840 <term><command>pltcl_delmod</command></term>
841 <listitem>
[4472e923]842 <para>
843 is a support script used to delete a module from a
844 PL/<application>Tcl</application> table. The command
[4c24eb0a]845 requires the
[90fb8f6]846 <ulink url="https://flightaware.github.io/Pgtcl/">Pgtcl</ulink>
[4c24eb0a]847 package to be installed
[4472e923]848 </para>
[4ab91cd]849 <indexterm zone="postgresql pltcl_delmod">
850 <primary sortas="b-pltcl_delmod">pltcl_delmod</primary>
851 </indexterm>
852 </listitem>
853 </varlistentry>
854
855 <varlistentry id="pltcl_listmod">
856 <term><command>pltcl_listmod</command></term>
857 <listitem>
[4472e923]858 <para>
859 is a support script used to list the modules in a
860 PL/<application>Tcl</application> table. The command
[4c24eb0a]861 requires the
[90fb8f6]862 <ulink url="https://flightaware.github.io/Pgtcl/">Pgtcl</ulink>
[4c24eb0a]863 package to be installed
[4472e923]864 </para>
[4ab91cd]865 <indexterm zone="postgresql pltcl_listmod">
866 <primary sortas="b-pltcl_listmod">pltcl_listmod</primary>
867 </indexterm>
868 </listitem>
869 </varlistentry>
870
871 <varlistentry id="pltcl_loadmod">
872 <term><command>pltcl_loadmod</command></term>
873 <listitem>
[4472e923]874 <para>
875 is a support script used to load a module into a
876 PL/<application>Tcl</application> table. The command
[4c24eb0a]877 requires the
[90fb8f6]878 <ulink url="https://flightaware.github.io/Pgtcl/">Pgtcl</ulink>
[e3cde1fc]879 package to be installed
[4472e923]880 </para>
[4ab91cd]881 <indexterm zone="postgresql pltcl_loadmod">
882 <primary sortas="b-pltcl_loadmod">pltcl_loadmod</primary>
883 </indexterm>
884 </listitem>
885 </varlistentry>
886
887 <varlistentry id="postgres">
888 <term><command>postgres</command></term>
889 <listitem>
[4472e923]890 <para>
[4c24eb0a]891 is the PostgreSQL database server
[4472e923]892 </para>
[4ab91cd]893 <indexterm zone="postgresql postgres">
894 <primary sortas="b-postgres">postgres</primary>
895 </indexterm>
896 </listitem>
897 </varlistentry>
898
[ace0703]899<!-- Removed in 16.0
[4ab91cd]900 <varlistentry id="postmaster">
901 <term><command>postmaster</command></term>
902 <listitem>
[4472e923]903 <para>
904 (deprecated, a symlink to <command>postgres</command>) is a
[4c24eb0a]905 multi-user database daemon
[4472e923]906 </para>
[4ab91cd]907 <indexterm zone="postgresql postmaster">
908 <primary sortas="b-postmaster">postmaster</primary>
909 </indexterm>
910 </listitem>
911 </varlistentry>
[ace0703]912-->
[4ab91cd]913
914 <varlistentry id="psql">
915 <term><command>psql</command></term>
916 <listitem>
[4472e923]917 <para>
[4c24eb0a]918 is a console based database shell
[4472e923]919 </para>
[4ab91cd]920 <indexterm zone="postgresql psql">
921 <primary sortas="b-psql">psql</primary>
922 </indexterm>
923 </listitem>
924 </varlistentry>
925
[aaeca54]926 <varlistentry id="reindexdb">
927 <term><command>reindexdb</command></term>
928 <listitem>
[4472e923]929 <para>
[4c24eb0a]930 is a utility for rebuilding indexes in a database
[4472e923]931 </para>
[621a551]932 <indexterm zone="postgresql reindexdb">
933 <primary sortas="b-reindexdb">reindexdb</primary>
[aaeca54]934 </indexterm>
935 </listitem>
936 </varlistentry>
937
[4ab91cd]938 <varlistentry id="vacuumdb">
939 <term><command>vacuumdb</command></term>
940 <listitem>
[4472e923]941 <para>
[4c24eb0a]942 compacts databases and generates statistics for the query analyzer
[4472e923]943 </para>
[4ab91cd]944 <indexterm zone="postgresql vacuumdb">
945 <primary sortas="b-vacuumdb">vacuumdb</primary>
946 </indexterm>
[782bf3d0]947 </listitem>
948 </varlistentry>
949
950 <varlistentry id="vacuumlo">
951 <term><command>vacuumlo</command></term>
952 <listitem>
[4472e923]953 <para>
[4c24eb0a]954 removes orphaned large objects from a PostgreSQL database
[4472e923]955 </para>
[782bf3d0]956 <indexterm zone="postgresql vacuumlo">
957 <primary sortas="b-vacuumlo">vacuumlo</primary>
958 </indexterm>
[4ab91cd]959 </listitem>
960 </varlistentry>
961
[76acb620]962 <varlistentry id="libecpg">
[4c24eb0a]963 <term><filename class="libraryfile">libecpg.{so,a}</filename></term>
[76acb620]964 <listitem>
[4472e923]965 <para>
[4c24eb0a]966 contains functions to support embedded SQL in C programs
[4472e923]967 </para>
[76acb620]968 <indexterm zone="postgresql libecpg">
969 <primary sortas="c-libecpg">libecpg.{so,a}</primary>
970 </indexterm>
971 </listitem>
972 </varlistentry>
973
974 <varlistentry id="libecpg_compat">
[4c24eb0a]975 <term><filename class="libraryfile">libecpg_compat.{so,a}</filename></term>
[76acb620]976 <listitem>
[4472e923]977 <para>
[4c24eb0a]978 is the ecpg compatibility library
[4472e923]979 </para>
[76acb620]980 <indexterm zone="postgresql libecpg_compat">
981 <primary sortas="c-libecpg_compat">libecpg_compat.{so,a}</primary>
982 </indexterm>
983 </listitem>
984 </varlistentry>
985
986 <varlistentry id="libgport">
[4c24eb0a]987 <term><filename class="libraryfile">libgport.a</filename></term>
[76acb620]988 <listitem>
[4472e923]989 <para>
[4c24eb0a]990 is the port-specific subsystem of the Postgres backend
[4472e923]991 </para>
[76acb620]992 <indexterm zone="postgresql libgport">
993 <primary sortas="c-libgport">libgport.a</primary>
994 </indexterm>
995 </listitem>
996 </varlistentry>
997
998 <varlistentry id="libpgtypes">
[4c24eb0a]999 <term><filename class="libraryfile">libpgtypes.{so,a}</filename></term>
[76acb620]1000 <listitem>
[4472e923]1001 <para>
[4c24eb0a]1002 contains functions for dealing with Postgres data types
[4472e923]1003 </para>
[76acb620]1004 <indexterm zone="postgresql libpgtypes">
1005 <primary sortas="c-libpgtypes">libpgtypes.{so,a}</primary>
1006 </indexterm>
1007 </listitem>
1008 </varlistentry>
1009
1010 <varlistentry id="libpq">
[4c24eb0a]1011 <term><filename class="libraryfile">libpq.{so,a}</filename></term>
[76acb620]1012 <listitem>
[4472e923]1013 <para>
[4c24eb0a]1014 is the C programmer's API to Postgres
[4472e923]1015 </para>
[76acb620]1016 <indexterm zone="postgresql libpq">
1017 <primary sortas="c-libpq">libpq.{so,a}</primary>
1018 </indexterm>
1019 </listitem>
1020 </varlistentry>
1021
[4ab91cd]1022 </variablelist>
1023
1024 </sect2>
[458342f]1025
1026</sect1>
Note: See TracBrowser for help on using the repository browser.