2 Chapter 54. Frontend/Backend Protocol
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
17 54.2.3. Extended Query
20 54.2.6. COPY Operations
21 54.2.7. Asynchronous Operations
22 54.2.8. Canceling Requests in Progress
24 54.2.10. SSL Session Encryption
25 54.2.11. GSSAPI Session Encryption
27 54.3. SASL Authentication
29 54.3.1. SCRAM-SHA-256 Authentication
30 54.3.2. OAUTHBEARER Authentication
32 54.4. Streaming Replication Protocol
33 54.5. Logical Streaming Replication Protocol
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
39 54.6. Message Data Types
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
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
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.
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.