PostgreSQL Source Code git master
All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
protocol.h
Go to the documentation of this file.
1/*-------------------------------------------------------------------------
2 *
3 * protocol.h
4 * Definitions of the request/response codes for the wire protocol.
5 *
6 *
7 * Portions Copyright (c) 1996-2024, PostgreSQL Global Development Group
8 * Portions Copyright (c) 1994, Regents of the University of California
9 *
10 * src/include/libpq/protocol.h
11 *
12 *-------------------------------------------------------------------------
13 */
14#ifndef PROTOCOL_H
15#define PROTOCOL_H
16
17/* These are the request codes sent by the frontend. */
18
19#define PqMsg_Bind 'B'
20#define PqMsg_Close 'C'
21#define PqMsg_Describe 'D'
22#define PqMsg_Execute 'E'
23#define PqMsg_FunctionCall 'F'
24#define PqMsg_Flush 'H'
25#define PqMsg_Parse 'P'
26#define PqMsg_Query 'Q'
27#define PqMsg_Sync 'S'
28#define PqMsg_Terminate 'X'
29#define PqMsg_CopyFail 'f'
30#define PqMsg_GSSResponse 'p'
31#define PqMsg_PasswordMessage 'p'
32#define PqMsg_SASLInitialResponse 'p'
33#define PqMsg_SASLResponse 'p'
34
35
36/* These are the response codes sent by the backend. */
37
38#define PqMsg_ParseComplete '1'
39#define PqMsg_BindComplete '2'
40#define PqMsg_CloseComplete '3'
41#define PqMsg_NotificationResponse 'A'
42#define PqMsg_CommandComplete 'C'
43#define PqMsg_DataRow 'D'
44#define PqMsg_ErrorResponse 'E'
45#define PqMsg_CopyInResponse 'G'
46#define PqMsg_CopyOutResponse 'H'
47#define PqMsg_EmptyQueryResponse 'I'
48#define PqMsg_BackendKeyData 'K'
49#define PqMsg_NoticeResponse 'N'
50#define PqMsg_AuthenticationRequest 'R'
51#define PqMsg_ParameterStatus 'S'
52#define PqMsg_RowDescription 'T'
53#define PqMsg_FunctionCallResponse 'V'
54#define PqMsg_CopyBothResponse 'W'
55#define PqMsg_ReadyForQuery 'Z'
56#define PqMsg_NoData 'n'
57#define PqMsg_PortalSuspended 's'
58#define PqMsg_ParameterDescription 't'
59#define PqMsg_NegotiateProtocolVersion 'v'
60
61
62/* These are the codes sent by both the frontend and backend. */
63
64#define PqMsg_CopyDone 'c'
65#define PqMsg_CopyData 'd'
66
67
68/* These are the codes sent by parallel workers to leader processes. */
69#define PqMsg_Progress 'P'
70
71
72/* These are the authentication request codes sent by the backend. */
73
74#define AUTH_REQ_OK 0 /* User is authenticated */
75#define AUTH_REQ_KRB4 1 /* Kerberos V4. Not supported any more. */
76#define AUTH_REQ_KRB5 2 /* Kerberos V5. Not supported any more. */
77#define AUTH_REQ_PASSWORD 3 /* Password */
78#define AUTH_REQ_CRYPT 4 /* crypt password. Not supported any more. */
79#define AUTH_REQ_MD5 5 /* md5 password */
80/* 6 is available. It was used for SCM creds, not supported any more. */
81#define AUTH_REQ_GSS 7 /* GSSAPI without wrap() */
82#define AUTH_REQ_GSS_CONT 8 /* Continue GSS exchanges */
83#define AUTH_REQ_SSPI 9 /* SSPI negotiate without wrap() */
84#define AUTH_REQ_SASL 10 /* Begin SASL authentication */
85#define AUTH_REQ_SASL_CONT 11 /* Continue SASL authentication */
86#define AUTH_REQ_SASL_FIN 12 /* Final SASL message */
87#define AUTH_REQ_MAX AUTH_REQ_SASL_FIN /* maximum AUTH_REQ_* value */
88
89#endif /* PROTOCOL_H */