Wiki / Protocol Messages / Frontend messages
StartupMessage
StartupMessage is a frontend protocol message. Length of message contents in bytes, including self.
Reading PostgreSQL 18.6.
Description
StartupMessage is a frontend protocol message. Length of message contents in bytes, including self.
- Direction
- Frontend → backend
- First wire field
- Int32
- Field entries
- 8
- Documented flow contexts
- Canceling Requests in Progress; SSL Session Encryption; GSSAPI Session Encryption
Usage
StartupMessage (F)Framing and repetition
The complete definition below retains repetition, counts and conditional fields. A numbered table row is a documented field definition, not a fixed byte offset. Integer encodings and flow rules follow the same-version protocol chapter.
Wire fields in documented order
| Position | Format | Meaning |
|---|---|---|
| 1 | Int32 | Length of message contents in bytes, including self. |
| 2 | Int32(196610) | The protocol version number. The most significant 16 bits are the major version number (3 for the protocol described here). The least significant 16 bits are the minor version number (2 for the protocol described here). |
| 3 | String | The parameter name. Currently recognized names are: user The database user name to connect as. Required; there is no default. database The database to connect to. Defaults to the user name. options Command-line arguments for the backend. (This is deprecated in favor of setting individual run-time parameters.) Spaces within this string are considered to separate arguments, unless escaped with a backslash ( \ ); write \\ to represent a literal backslash. replication Used to connect in streaming replication mode, where a small set of replication commands can be issued instead of SQL statements. Value can be true , false , or database , and the default is false . See Section 54.4 for details. In addition to the above, other parameters may be listed. Parameter names beginning with _pq_. are reserved for use as protocol extensions, while others are treated as run-time parameters to be set at backend start time. Such settings will be applied during backend start (after parsing the command-line arguments if any) and will act as session defaults. |
| 4 | user | The database user name to connect as. Required; there is no default. |
| 5 | database | The database to connect to. Defaults to the user name. |
| 6 | options | Command-line arguments for the backend. (This is deprecated in favor of setting individual run-time parameters.) Spaces within this string are considered to separate arguments, unless escaped with a backslash ( \ ); write \\ to represent a literal backslash. |
| 7 | replication | Used to connect in streaming replication mode, where a small set of replication commands can be issued instead of SQL statements. Value can be true , false , or database , and the default is false . See Section 54.4 for details. |
| 8 | String | The parameter value. |
Manual definition
-
- Int32
-
Length of message contents in bytes, including self.
- Int32(196610)
-
The protocol version number. The most significant 16 bits are the major version number (3 for the protocol described here). The least significant 16 bits are the minor version number (2 for the protocol described here).
The protocol version number is followed by one or more pairs of parameter name and value strings. A zero byte is required as a terminator after the last name/value pair. Parameters can appear in any order.
useris required, others are optional. Each parameter is specified as:- String
-
The parameter name. Currently recognized names are:
user-
The database user name to connect as. Required; there is no default.
database-
The database to connect to. Defaults to the user name.
options-
Command-line arguments for the backend. (This is deprecated in favor of setting individual run-time parameters.) Spaces within this string are considered to separate arguments, unless escaped with a backslash (
\); write\\to represent a literal backslash. replication-
Used to connect in streaming replication mode, where a small set of replication commands can be issued instead of SQL statements. Value can be
true,false, ordatabase, and the default isfalse. See Section 54.4 for details.
In addition to the above, other parameters may be listed. Parameter names beginning with
_pq_.are reserved for use as protocol extensions, while others are treated as run-time parameters to be set at backend start time. Such settings will be applied during backend start (after parsing the command-line arguments if any) and will act as session defaults. - String
-
The parameter value.
Related entries
Documentation and source
Source build
- Version
- 18.6
- Build
- https://ftp.postgresql.org/pub/source/v18.6/postgresql-18.6.tar.bz2
- Source fingerprint
555610c24d53e4316da5b7d3fc25c279d96856d5e0e23ee308c328c5fa881d9f
Compare versions
PostgreSQL 17 → 18: changed.
--- PostgreSQL 17
+++ PostgreSQL 18
@@ -6,11 +6,11 @@
"format": "Int32"
},
{
- "description": "The protocol version number. The most significant 16 bits are the major version number (3 for the protocol described here). The least significant 16 bits are the minor version number (0 for the protocol described here).",
- "format": "Int32(196608)"
+ "description": "The protocol version number. The most significant 16 bits are the major version number (3 for the protocol described here). The least significant 16 bits are the minor version number (2 for the protocol described here).",
+ "format": "Int32(196610)"
},
{
- "description": "The parameter name. Currently recognized names are: user The database user name to connect as. Required; there is no default. database The database to connect to. Defaults to the user name. options Command-line arguments for the backend. (This is deprecated in favor of setting individual run-time parameters.) Spaces within this string are considered to separate arguments, unless escaped with a backslash ( \\ ); write \\\\ to represent a literal backslash. replication Used to connect in streaming replication mode, where a small set of replication commands can be issued instead of SQL statements. Value can be true , false , or database , and the default is false . See Section 53.4 for details. In addition to the above, other parameters may be listed. Parameter names beginning with _pq_. are reserved for use as protocol extensions, while others are treated as run-time parameters to be set at backend start time. Such settings will be applied during backend start (after parsing the command-line arguments if any) and will act as session defaults.",
+ "description": "The parameter name. Currently recognized names are: user The database user name to connect as. Required; there is no default. database The database to connect to. Defaults to the user name. options Command-line arguments for the backend. (This is deprecated in favor of setting individual run-time parameters.) Spaces within this string are considered to separate arguments, unless escaped with a backslash ( \\ ); write \\\\ to represent a literal backslash. replication Used to connect in streaming replication mode, where a small set of replication commands can be issued instead of SQL statements. Value can be true , false , or database , and the default is false . See Section 54.4 for details. In addition to the above, other parameters may be listed. Parameter names beginning with _pq_. are reserved for use as protocol extensions, while others are treated as run-time parameters to be set at backend start time. Such settings will be applied during backend start (after parsing the command-line arguments if any) and will act as session defaults.",
"format": "String"
},
{
@@ -26,7 +26,7 @@
"format": "options"
},
{
- "description": "Used to connect in streaming replication mode, where a small set of replication commands can be issued instead of SQL statements. Value can be true , false , or database , and the default is false . See Section 53.4 for details.",
+ "description": "Used to connect in streaming replication mode, where a small set of replication commands can be issued instead of SQL statements. Value can be true , false , or database , and the default is false . See Section 54.4 for details.",
"format": "replication"
},
{
Compares recorded interfaces and attributes. Source fingerprints and build metadata are excluded; an absent sample is not proof of the introduction or removal release.
Related entries
Export JSON · Back to Protocol Messages · Recorded in PostgreSQL 10 through 20; the first sample is not necessarily its introduction.