]> begriffs open source - ai-pg/blob - full-docs/txt/protocol.txt
Convert HTML docs to more streamlined TXT
[ai-pg] / full-docs / txt / protocol.txt
1
2 Chapter 54. Frontend/Backend Protocol
3
4    Table of Contents
5
6    54.1. Overview
7
8         54.1.1. Messaging Overview
9         54.1.2. Extended Query Overview
10         54.1.3. Formats and Format Codes
11         54.1.4. Protocol Versions
12
13    54.2. Message Flow
14
15         54.2.1. Start-up
16         54.2.2. Simple Query
17         54.2.3. Extended Query
18         54.2.4. Pipelining
19         54.2.5. Function Call
20         54.2.6. COPY Operations
21         54.2.7. Asynchronous Operations
22         54.2.8. Canceling Requests in Progress
23         54.2.9. Termination
24         54.2.10. SSL Session Encryption
25         54.2.11. GSSAPI Session Encryption
26
27    54.3. SASL Authentication
28
29         54.3.1. SCRAM-SHA-256 Authentication
30         54.3.2. OAUTHBEARER Authentication
31
32    54.4. Streaming Replication Protocol
33    54.5. Logical Streaming Replication Protocol
34
35         54.5.1. Logical Streaming Replication Parameters
36         54.5.2. Logical Replication Protocol Messages
37         54.5.3. Logical Replication Protocol Message Flow
38
39    54.6. Message Data Types
40    54.7. Message Formats
41    54.8. Error and Notice Message Fields
42    54.9. Logical Replication Message Formats
43    54.10. Summary of Changes since Protocol 2.0
44
45    PostgreSQL uses a message-based protocol for communication between
46    frontends and backends (clients and servers). The protocol is supported
47    over TCP/IP and also over Unix-domain sockets. Port number 5432 has
48    been registered with IANA as the customary TCP port number for servers
49    supporting this protocol, but in practice any non-privileged port
50    number can be used.
51
52    This document describes version 3.2 of the protocol, introduced in
53    PostgreSQL version 18. The server and the libpq client library are
54    backwards compatible with protocol version 3.0, implemented in
55    PostgreSQL 7.4 and later.
56
57    In order to serve multiple clients efficiently, the server launches a
58    new “backend” process for each client. In the current implementation, a
59    new child process is created immediately after an incoming connection
60    is detected. This is transparent to the protocol, however. For purposes
61    of the protocol, the terms “backend” and “server” are interchangeable;
62    likewise “frontend” and “client” are interchangeable.