3.1 Start-Up
To begin a session, a client creates a connection to the server and sends a startup
message. The server launches a new process that is associated with the
session. If launching a new process causes some errors, the server sends the
se_ErrorResponse message, if not, it sends the se_SendSessionParameters
message to the client. Then client sends the session parameters in the
se_SessionParameters message. This message includes the particular protocol
version to be used, the name of the user and of the database the user
wants to connect to. The server then uses this information to determine
whether the connection is acceptable. If not, it sends the error message
(se_ErrorResponse). If the connection is acceptable the server then sends an
authentication request message, to which the client must reply with an
appropriate authentication response message. In principle the authentication
request/response cycle could require multiple iterations, but the present
authentication method uses exactly one request (se_SendAuthParameters) and
response (se_AuthenticationParameters). The authentication cycle ends with
the server either rejecting the connection attempt (se_AuthenticationFailed),
or sending se_AuthenticationOk.
The possible instructions from the client in this phase are:
- se_Start-Up. Does not contain the body.
- se_SessionParameters. The body contains the protocol version, user
name and db name.
- se_AuthenticationParameters. The body contains password.
The possible instructions from the server in this phase are:
- se_SendSessionParameters. Does not contain the body.
- se_SendAuthParameters. Does not contain the body.
- se_AuthenticationOK. Does not contain the body.
- se_AuthenticationFailed. Body contains info.
- se_ErrorResponse. Body contains info.
|