]> git.ipfire.org Git - thirdparty/postgresql.git/commitdiff
Use PqMsg_* macros in fe-protocol3.c.
authorNathan Bossart <nathan@postgresql.org>
Mon, 25 Aug 2025 16:08:26 +0000 (11:08 -0500)
committerNathan Bossart <nathan@postgresql.org>
Mon, 25 Aug 2025 16:08:26 +0000 (11:08 -0500)
Oversight in commit f4b54e1ed9.

Reviewed-by: Jacob Champion <jacob.champion@enterprisedb.com>
Reviewed-by: Fabrízio de Royes Mello <fabriziomello@gmail.com>
Discussion: https://postgr.es/m/aKx5vEbbP03JNgtp%40nathan

src/include/libpq/protocol.h
src/interfaces/libpq/fe-protocol3.c

index c64e628628d4be5ce10e2e52d3bf04c40f14b134..7bf90053bcb6d90cd39f63404ff47e93ef7179b8 100644 (file)
@@ -66,6 +66,7 @@
 
 
 /* These are the codes sent by parallel workers to leader processes. */
+
 #define PqMsg_Progress              'P'
 
 
index 43ad672abce9512b8b3e436c91488514fffb4ef9..da7a8db68c80cd5618297fc00aca30dfffe33971 100644 (file)
@@ -2262,7 +2262,7 @@ pqFunctionCall3(PGconn *conn, Oid fnid,
                 */
                switch (id)
                {
-                       case 'V':                       /* function result */
+                       case PqMsg_FunctionCallResponse:
                                if (pqGetInt(actual_result_len, 4, conn))
                                        continue;
                                if (*actual_result_len != -1)
@@ -2283,22 +2283,22 @@ pqFunctionCall3(PGconn *conn, Oid fnid,
                                /* correctly finished function result message */
                                status = PGRES_COMMAND_OK;
                                break;
-                       case 'E':                       /* error return */
+                       case PqMsg_ErrorResponse:
                                if (pqGetErrorNotice3(conn, true))
                                        continue;
                                status = PGRES_FATAL_ERROR;
                                break;
-                       case 'A':                       /* notify message */
+                       case PqMsg_NotificationResponse:
                                /* handle notify and go back to processing return values */
                                if (getNotify(conn))
                                        continue;
                                break;
-                       case 'N':                       /* notice */
+                       case PqMsg_NoticeResponse:
                                /* handle notice and go back to processing return values */
                                if (pqGetErrorNotice3(conn, false))
                                        continue;
                                break;
-                       case 'Z':                       /* backend is ready for new query */
+                       case PqMsg_ReadyForQuery:
                                if (getReadyForQuery(conn))
                                        continue;
 
@@ -2330,7 +2330,7 @@ pqFunctionCall3(PGconn *conn, Oid fnid,
                                }
                                /* and we're out */
                                return pqPrepareAsyncResult(conn);
-                       case 'S':                       /* parameter status */
+                       case PqMsg_ParameterStatus:
                                if (getParameterStatus(conn))
                                        continue;
                                break;