Thanks to visit codestin.com
Credit goes to doxygen.postgresql.org

PostgreSQL Source Code git master
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-2025, 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
70#define PqMsg_Progress 'P'
71
72
73/* Replication codes sent by the primary (wrapped in CopyData messages). */
74
75#define PqReplMsg_Keepalive 'k'
76#define PqReplMsg_PrimaryStatusUpdate 's'
77#define PqReplMsg_WALData 'w'
78
79
80/* Replication codes sent by the standby (wrapped in CopyData messages). */
81
82#define PqReplMsg_HotStandbyFeedback 'h'
83#define PqReplMsg_PrimaryStatusRequest 'p'
84#define PqReplMsg_StandbyStatusUpdate 'r'
85
86
87/* Codes used for backups via COPY OUT (wrapped in CopyData messages). */
88
89#define PqBackupMsg_Manifest 'm'
90#define PqBackupMsg_NewArchive 'n'
91#define PqBackupMsg_ProgressReport 'p'
92
93
94/* These are the authentication request codes sent by the backend. */
95
96#define AUTH_REQ_OK 0 /* User is authenticated */
97#define AUTH_REQ_KRB4 1 /* Kerberos V4. Not supported any more. */
98#define AUTH_REQ_KRB5 2 /* Kerberos V5. Not supported any more. */
99#define AUTH_REQ_PASSWORD 3 /* Password */
100#define AUTH_REQ_CRYPT 4 /* crypt password. Not supported any more. */
101#define AUTH_REQ_MD5 5 /* md5 password */
102/* 6 is available. It was used for SCM creds, not supported any more. */
103#define AUTH_REQ_GSS 7 /* GSSAPI without wrap() */
104#define AUTH_REQ_GSS_CONT 8 /* Continue GSS exchanges */
105#define AUTH_REQ_SSPI 9 /* SSPI negotiate without wrap() */
106#define AUTH_REQ_SASL 10 /* Begin SASL authentication */
107#define AUTH_REQ_SASL_CONT 11 /* Continue SASL authentication */
108#define AUTH_REQ_SASL_FIN 12 /* Final SASL message */
109#define AUTH_REQ_MAX AUTH_REQ_SASL_FIN /* maximum AUTH_REQ_* value */
110
111#endif /* PROTOCOL_H */