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