mirror of
https://github.com/postgres/postgres.git
synced 2025-11-10 17:42:29 +03:00
Introduce macros for protocol characters.
This commit introduces descriptively-named macros for the identifiers used in wire protocol messages. These new macros are placed in a new header file so that they can be easily used by third-party code. Author: Dave Cramer Reviewed-by: Alvaro Herrera, Tatsuo Ishii, Peter Smith, Robert Haas, Tom Lane, Peter Eisentraut, Michael Paquier Discussion: https://postgr.es/m/CADK3HHKbBmK-PKf1bPNFoMC%2BoBt%2BpD9PH8h5nvmBQskEHm-Ehw%40mail.gmail.com
This commit is contained in:
@@ -3465,7 +3465,10 @@ send_message_to_frontend(ErrorData *edata)
|
||||
char tbuf[12];
|
||||
|
||||
/* 'N' (Notice) is for nonfatal conditions, 'E' is for errors */
|
||||
pq_beginmessage(&msgbuf, (edata->elevel < ERROR) ? 'N' : 'E');
|
||||
if (edata->elevel < ERROR)
|
||||
pq_beginmessage(&msgbuf, PqMsg_NoticeResponse);
|
||||
else
|
||||
pq_beginmessage(&msgbuf, PqMsg_ErrorResponse);
|
||||
|
||||
sev = error_severity(edata->elevel);
|
||||
pq_sendbyte(&msgbuf, PG_DIAG_SEVERITY);
|
||||
|
||||
Reference in New Issue
Block a user