| 1 |
<!-- doc/src/sgml/postgres.sgml --> |
| 2 |
|
| 3 |
<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" |
| 4 |
"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" |
| 5 |
[ |
| 6 |
|
| 7 |
<!ENTITY % version SYSTEM "version.sgml"> |
| 8 |
%version; |
| 9 |
<!ENTITY % filelist SYSTEM "filelist.sgml"> |
| 10 |
%filelist; |
| 11 |
|
| 12 |
<!ENTITY commit_baseurl "https://postgr.es/c/"> |
| 13 |
<!ENTITY reference SYSTEM "reference.sgml"> |
| 14 |
|
| 15 |
<!-- |
| 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. |
| 19 |
--> |
| 20 |
<!ENTITY zwsp "​"> |
| 21 |
|
| 22 |
]> |
| 23 |
|
| 24 |
<book id="postgres"> |
| 25 |
<title>PostgreSQL &version; Documentation</title> |
| 26 |
|
| 27 |
<bookinfo> |
| 28 |
<corpauthor>The PostgreSQL Global Development Group</corpauthor> |
| 29 |
<productname>PostgreSQL</productname> |
| 30 |
<productnumber>&version;</productnumber> |
| 31 |
&legal; |
| 32 |
</bookinfo> |
| 33 |
|
| 34 |
&intro; |
| 35 |
|
| 36 |
<part id="tutorial"> |
| 37 |
<title>Tutorial</title> |
| 38 |
|
| 39 |
<partintro> |
| 40 |
<para> |
| 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. |
| 49 |
</para> |
| 50 |
|
| 51 |
<para> |
| 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"/>. |
| 58 |
</para> |
| 59 |
</partintro> |
| 60 |
|
| 61 |
&start; |
| 62 |
&query; |
| 63 |
&advanced; |
| 64 |
|
| 65 |
</part> |
| 66 |
|
| 67 |
<part id="sql"> |
| 68 |
<title>The SQL Language</title> |
| 69 |
|
| 70 |
<partintro> |
| 71 |
<para> |
| 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. |
| 79 |
</para> |
| 80 |
|
| 81 |
<para> |
| 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"/>. |
| 90 |
</para> |
| 91 |
|
| 92 |
<para> |
| 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. |
| 101 |
</para> |
| 102 |
</partintro> |
| 103 |
|
| 104 |
&syntax; |
| 105 |
&ddl; |
| 106 |
&dml; |
| 107 |
&queries; |
| 108 |
&datatype; |
| 109 |
&func; |
| 110 |
&typeconv; |
| 111 |
&indices; |
| 112 |
&textsearch; |
| 113 |
&mvcc; |
| 114 |
&perform; |
| 115 |
∥ |
| 116 |
|
| 117 |
</part> |
| 118 |
|
| 119 |
<part id="admin"> |
| 120 |
<title>Server Administration</title> |
| 121 |
|
| 122 |
<partintro> |
| 123 |
<para> |
| 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 |
| 130 |
with these topics. |
| 131 |
</para> |
| 132 |
|
| 133 |
<para> |
| 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"/>. |
| 140 |
</para> |
| 141 |
|
| 142 |
<para> |
| 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. |
| 151 |
</para> |
| 152 |
</partintro> |
| 153 |
|
| 154 |
&installbin; |
| 155 |
&installation; |
| 156 |
&runtime; |
| 157 |
&config; |
| 158 |
&client-auth; |
| 159 |
&user-manag; |
| 160 |
&manage-ag; |
| 161 |
&charset; |
| 162 |
&maintenance; |
| 163 |
&backup; |
| 164 |
&high-availability; |
| 165 |
&monitoring; |
| 166 |
&wal; |
| 167 |
&logical-replication; |
| 168 |
&jit; |
| 169 |
®ress; |
| 170 |
|
| 171 |
</part> |
| 172 |
|
| 173 |
<part id="client-interfaces"> |
| 174 |
<title>Client Interfaces</title> |
| 175 |
|
| 176 |
<partintro> |
| 177 |
<para> |
| 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. |
| 187 |
</para> |
| 188 |
</partintro> |
| 189 |
|
| 190 |
&libpq; |
| 191 |
&lobj; |
| 192 |
&ecpg; |
| 193 |
&infoschema; |
| 194 |
|
| 195 |
</part> |
| 196 |
|
| 197 |
<part id="server-programming"> |
| 198 |
<title>Server Programming</title> |
| 199 |
|
| 200 |
<partintro> |
| 201 |
<para> |
| 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. |
| 213 |
</para> |
| 214 |
</partintro> |
| 215 |
|
| 216 |
&extend; |
| 217 |
&trigger; |
| 218 |
&event-trigger; |
| 219 |
&rules; |
| 220 |
|
| 221 |
&xplang; |
| 222 |
&plsql; |
| 223 |
&pltcl; |
| 224 |
&plperl; |
| 225 |
&plpython; |
| 226 |
|
| 227 |
&spi; |
| 228 |
&bgworker; |
| 229 |
&logicaldecoding; |
| 230 |
&replication-origins; |
| 231 |
&archive-modules; |
| 232 |
&oauth-validators; |
| 233 |
|
| 234 |
</part> |
| 235 |
|
| 236 |
&reference; |
| 237 |
|
| 238 |
<part id="internals"> |
| 239 |
<title>Internals</title> |
| 240 |
|
| 241 |
<partintro> |
| 242 |
<para> |
| 243 |
This part contains assorted information that might be of use to |
| 244 |
<productname>PostgreSQL</productname> developers. |
| 245 |
</para> |
| 246 |
</partintro> |
| 247 |
|
| 248 |
&arch-dev; |
| 249 |
&catalogs; |
| 250 |
&system-views; |
| 251 |
&protocol; |
| 252 |
&sources; |
| 253 |
&nls; |
| 254 |
&plhandler; |
| 255 |
&fdwhandler; |
| 256 |
&tablesample-method; |
| 257 |
&custom-scan; |
| 258 |
&geqo; |
| 259 |
&tableam; |
| 260 |
&indexam; |
| 261 |
&wal-for-extensions; |
| 262 |
&indextypes; |
| 263 |
&storage; |
| 264 |
&transaction; |
| 265 |
&bki; |
| 266 |
&planstats; |
| 267 |
&backup-manifest; |
| 268 |
|
| 269 |
</part> |
| 270 |
|
| 271 |
<part id="appendixes"> |
| 272 |
<title>Appendixes</title> |
| 273 |
|
| 274 |
&errcodes; |
| 275 |
&datetime; |
| 276 |
&keywords; |
| 277 |
&features; |
| 278 |
&release; |
| 279 |
&contrib; |
| 280 |
&external-projects; |
| 281 |
&sourcerepo; |
| 282 |
&docguide; |
| 283 |
&limits; |
| 284 |
&acronyms; |
| 285 |
&glossary; |
| 286 |
&color; |
| 287 |
&obsolete; |
| 288 |
|
| 289 |
</part> |
| 290 |
|
| 291 |
&biblio; |
| 292 |
<index id="bookindex"></index> |
| 293 |
|
| 294 |
</book> |