1 <!-- doc/src/sgml/postgres.sgml -->
3 <!DOCTYPE book PUBLIC
"-//OASIS//DTD DocBook XML V4.5//EN"
4 "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd"
7 <!ENTITY % version SYSTEM
"version.sgml">
9 <!ENTITY % filelist SYSTEM
"filelist.sgml">
12 <!ENTITY commit_baseurl
"https://postgr.es/c/">
13 <!ENTITY reference SYSTEM
"reference.sgml">
16 Zero-width space. Use this to allow line breaks at desirable places in
17 table cells, examples, etc. without causing an unwanted space when the
18 break is not needed in a wider output rendering.
20 <!ENTITY zwsp
"​">
25 <title>PostgreSQL
&version; Documentation
</title>
28 <corpauthor>The PostgreSQL Global Development Group
</corpauthor>
29 <productname>PostgreSQL
</productname>
30 <productnumber>&version;</productnumber>
37 <title>Tutorial
</title>
41 Welcome to the
<productname>PostgreSQL
</productname> Tutorial. The
42 tutorial is intended to give an introduction
43 to
<productname>PostgreSQL
</productname>, relational database
44 concepts, and the SQL language. We assume some general knowledge about
45 how to use computers and no particular Unix or programming experience is
46 required. This tutorial is intended to provide hands-on experience with
47 important aspects of the
<productname>PostgreSQL
</productname> system.
48 It makes no attempt to be a comprehensive treatment of the topics it covers.
52 After you have successfully completed this tutorial you will want to
53 read the
<xref linkend=
"sql"/> section to gain a better understanding
54 of the SQL language, or
<xref linkend=
"client-interfaces"/> for
55 information about developing applications with
56 <productname>PostgreSQL
</productname>. Those who provision and
57 manage their own PostgreSQL installation should also read
<xref linkend=
"admin"/>.
68 <title>The SQL Language
</title>
72 This part describes the use of the
<acronym>SQL
</acronym> language
73 in
<productname>PostgreSQL
</productname>. We start with
74 describing the general syntax of
<acronym>SQL
</acronym>, then
75 how to create tables, how to populate the database, and how to
76 query it. The middle part lists the available data types and
77 functions for use in
<acronym>SQL
</acronym> commands. Lastly,
78 we address several aspects of importance for tuning a database.
82 The information is arranged so that a novice user can
83 follow it from start to end and gain a full understanding of the topics
84 without having to refer forward too many times. The chapters are
85 intended to be self-contained, so that advanced users can read the
86 chapters individually as they choose. The information is presented
87 in narrative form with topical units. Readers looking for a complete
88 description of a particular command are encouraged to review
89 the
<xref linkend=
"reference"/>.
93 Readers should know how to connect to a
94 <productname>PostgreSQL
</productname> database and issue
95 <acronym>SQL
</acronym> commands. Readers that are unfamiliar with
96 these issues are encouraged to read
<xref linkend=
"tutorial"/>
97 first.
<acronym>SQL
</acronym> commands are typically entered
98 using the
<productname>PostgreSQL
</productname> interactive terminal
99 <application>psql
</application>, but other programs that have
100 similar functionality can be used as well.
120 <title>Server Administration
</title>
124 This part covers topics that are of interest to a
125 <productname>PostgreSQL
</productname> administrator. This includes
126 installation, configuration of the server, management of users
127 and databases, and maintenance tasks. Anyone running
128 <productname>PostgreSQL
</productname> server, even for
129 personal use, but especially in production, should be familiar
134 The information attempts to be in the order in which
135 a new user should read it. The chapters are self-contained and
136 can be read individually as desired. The information is presented
137 in a narrative form in topical units. Readers looking for a complete
138 description of a command are encouraged to review the
139 <xref linkend=
"reference"/>.
143 The first few chapters are written so they can be understood
144 without prerequisite knowledge, so new users who need to set
145 up their own server can begin their exploration. The rest of this
146 part is about tuning and management; that material
147 assumes that the reader is familiar with the general use of
148 the
<productname>PostgreSQL
</productname> database system. Readers are
149 encouraged review the
<xref linkend=
"tutorial"/> and
<xref
150 linkend=
"sql"/> parts for additional information.
167 &logical-replication;
173 <part id=
"client-interfaces">
174 <title>Client Interfaces
</title>
178 This part describes the client programming interfaces distributed
179 with
<productname>PostgreSQL
</productname>. Each of these chapters can be
180 read independently. There are many external programming
181 interfaces for client programs that are distributed separately. They
182 contain their own documentation (
<xref linkend=
"external-projects"/>
183 lists some of the more popular ones). Readers of this part should be
184 familiar with using
<acronym>SQL
</acronym> to manipulate
185 and query the database (see
<xref linkend=
"sql"/>) and of course
186 with the programming language of their choice.
197 <part id=
"server-programming">
198 <title>Server Programming
</title>
202 This part is about extending the server functionality with
203 user-defined functions, data types, triggers, etc. These are
204 advanced topics which should be approached only after all
205 the other user documentation about
<productname>PostgreSQL
</productname> has
206 been understood. Later chapters in this part describe the server-side
207 programming languages available in the
208 <productname>PostgreSQL
</productname> distribution as well as
209 general issues concerning server-side programming. It
210 is essential to read at least the earlier sections of
<xref
211 linkend=
"extend"/> (covering functions) before diving into the
212 material about server-side programming.
230 &replication-origins;
237 <part id=
"internals">
238 <title>Internals
</title>
242 This part contains assorted information that might be of use to
243 <productname>PostgreSQL
</productname> developers.
270 <part id=
"appendixes">
271 <title>Appendixes
</title>
291 <index id=
"bookindex"></index>