↑↓ 选择↵ 打开⌫ 切换范围完整搜索

PG.CENTER 连接 PostgreSQL 文档、百科与生态知识。由 Pigsty 维护。

Wiki / 协议消息

StartupMessage

StartupMessage is a frontend protocol message. Length of message contents in bytes, including self.

当前阅读 PG 18·选择有来源记录的版本

此版本暂无所选语言的定义,以下显示原始英文内容。

Direction
Frontend → backend
First wire field
Int32
Field entries
8
Documented flow contexts
Canceling Requests in Progress; SSL Session Encryption; GSSAPI Session Encryption
direction
F
manual path
/docs/18/protocol-message-formats.html
signature
StartupMessage (F)

版本定义 PG 18

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. user is 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, 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.

String

The parameter value.

Wire fields in documented order

PositionFormatMeaning
1Int32Length of message contents in bytes, including self.
2Int32(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).
3StringThe 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.
4userThe database user name to connect as. Required; there is no default.
5databaseThe database to connect to. Defaults to the user name.
6optionsCommand-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.
7replicationUsed 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.
8StringThe parameter value.

比较版本

完整来源事实

fields

map[description:Length of message contents in bytes, including self. format:Int32], map[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)], map[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], map[description:The database user name to connect as. Required; there is no default. format:user], map[description:The database to connect to. Defaults to the user name. format:database], map[description: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. format:options], map[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], map[description:The parameter value. format:String]

来源引用

完整定义与证据 JSON

定义来源

center · PostgreSQL 18 · 555610c24d53e4316da5b7d3fc25c279d96856d5e0e23ee308c328c5fa881d9f

正文语言: en · 555610c24d53e4316da5b7d3fc25c279d96856d5e0e23ee308c328c5fa881d9f