Re: Using defines for protocol characters - Mailing list pgsql-hackers

From Peter Smith
Subject Re: Using defines for protocol characters
Date
Msg-id CAHut+PsT6FULioMuNc9un6cyXRqpXrB5MDfoo8CF3r6HhyOKOQ@mail.gmail.com
Whole thread Raw
In response to Re: Using defines for protocol characters  (Dave Cramer <davecramer@gmail.com>)
List pgsql-hackers
+#ifndef _PROTOCOL_H
+#define _PROTOCOL_H
+
+#define PQMSG_REQ_BIND              'B'
+#define PQMSG_REQ_CLOSE             'C'
+#define PQMSG_REQ_DESCRIBE          'D'
+#define PQMSG_REQ_EXECUTE           'E'
+#define PQMSG_REQ_FUNCTION_CALL     'F'
+#define PQMSG_REQ_FLUSH_DATA        'H'
+#define PQMSG_REQ_BACKEND_KEY_DATA  'K'
+#define PQMSG_REQ_PARSE             'P'
+#define PQMSG_REQ_AUTHENTICATION    'R'
+#define PQMSG_REQ_SYNC_DATA         'S'
+#define PQMSG_REQ_SIMPLE_QUERY      'Q'
+#define PQMSG_REQ_TERMINATE         'X'
+#define PQMSG_REQ_COPY_FAIL         'f'
+#define PQMSG_REQ_COPY_DONE         'c'
+#define PQMSG_REQ_COPY_DATA         'd'
+#define PQMSG_REQ_COPY_PROGRESS     'p'
+#define PQMSG_REQ_PREPARED          'S'
+#define PQMSG_REQ_PORTAL            'P'
+
+
+/*
+Responses
+*/
+#define PQMSG_RESP_PARSE_COMPLETE   '1'
+#define PQMSG_RESP_BIND_COMPLETE    '2'
+#define PQMSG_RESP_CLOSE_COMPLETE   '3'
+#define PQMSG_RESP_NOTIFY           'A'
+#define PQMSG_RESP_COMMAND_COMPLETE 'C'
+#define PQMSG_RESP_DATA_ROW         'D'
+#define PQMSG_RESP_ERROR            'E'
+#define PQMSG_RESP_COPY_IN          'G'
+#define PQMSG_RESP_COPY_OUT         'H'
+#define PQMSG_RESP_EMPTY_QUERY      'I'
+#define PQMSG_RESP_NOTICE           'N'
+#define PQMSG_RESP_PARALLEL_PROGRESS 'P'
+#define PQMSG_RESP_FUNCTION_CALL    'V'
+#define PQMSG_RESP_PARAMETER_STATUS 'S'
+#define PQMSG_RESP_ROW_DESCRIPTION  'T'
+#define PQMSG_RESP_COPY_BOTH        'W'
+#define PQMSG_RESP_READY_FOR_QUERY  'Z'
+#define PQMSG_RESP_NO_DATA          'n'
+#define PQMSG_RESP_PASSWORD         'p'
+#define PQMSG_RESP_PORTAL_SUSPENDED 's'
+#define PQMSG_RESP_PARAMETER_DESCRIPTION 't'
+#define PQMSG_RESP_NEGOTIATE_PROTOCOL    'v'
+#endif

Was ordering-by-value intended here? If yes, then FYI both of those
groups of #defines are very nearly, but not quite, in that order.

------
Kind Regards,
Peter Smith.
Fujitsu Australia



pgsql-hackers by date:

Previous
From: Nathan Bossart
Date:
Subject: Re: Faster "SET search_path"
Next
From: Tatsuo Ishii
Date:
Subject: Re: Using defines for protocol characters