aboutsummaryrefslogtreecommitdiff
path: root/src/backend/tcop/postgres.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/backend/tcop/postgres.c')
-rw-r--r--src/backend/tcop/postgres.c71
1 files changed, 2 insertions, 69 deletions
diff --git a/src/backend/tcop/postgres.c b/src/backend/tcop/postgres.c
index bb5ccb4578b..8a0332dde9d 100644
--- a/src/backend/tcop/postgres.c
+++ b/src/backend/tcop/postgres.c
@@ -370,57 +370,10 @@ SocketBackend(StringInfo inBuf)
{
case 'Q': /* simple query */
doing_extended_query_message = false;
- if (PG_PROTOCOL_MAJOR(FrontendProtocol) < 3)
- {
- /* old style without length word; convert */
- if (pq_getstring(inBuf))
- {
- if (IsTransactionState())
- ereport(COMMERROR,
- (errcode(ERRCODE_CONNECTION_FAILURE),
- errmsg("unexpected EOF on client connection with an open transaction")));
- else
- {
- /*
- * Can't send DEBUG log messages to client at this
- * point. Since we're disconnecting right away, we
- * don't need to restore whereToSendOutput.
- */
- whereToSendOutput = DestNone;
- ereport(DEBUG1,
- (errcode(ERRCODE_CONNECTION_DOES_NOT_EXIST),
- errmsg_internal("unexpected EOF on client connection")));
- }
- return EOF;
- }
- }
break;
case 'F': /* fastpath function call */
doing_extended_query_message = false;
- if (PG_PROTOCOL_MAJOR(FrontendProtocol) < 3)
- {
- if (GetOldFunctionMessage(inBuf))
- {
- if (IsTransactionState())
- ereport(COMMERROR,
- (errcode(ERRCODE_CONNECTION_FAILURE),
- errmsg("unexpected EOF on client connection with an open transaction")));
- else
- {
- /*
- * Can't send DEBUG log messages to client at this
- * point. Since we're disconnecting right away, we
- * don't need to restore whereToSendOutput.
- */
- whereToSendOutput = DestNone;
- ereport(DEBUG1,
- (errcode(ERRCODE_CONNECTION_DOES_NOT_EXIST),
- errmsg_internal("unexpected EOF on client connection")));
- }
- return EOF;
- }
- }
break;
case 'X': /* terminate */
@@ -435,11 +388,6 @@ SocketBackend(StringInfo inBuf)
case 'H': /* flush */
case 'P': /* parse */
doing_extended_query_message = true;
- /* these are only legal in protocol 3 */
- if (PG_PROTOCOL_MAJOR(FrontendProtocol) < 3)
- ereport(FATAL,
- (errcode(ERRCODE_PROTOCOL_VIOLATION),
- errmsg("invalid frontend message type %d", qtype)));
break;
case 'S': /* sync */
@@ -447,22 +395,12 @@ SocketBackend(StringInfo inBuf)
ignore_till_sync = false;
/* mark not-extended, so that a new error doesn't begin skip */
doing_extended_query_message = false;
- /* only legal in protocol 3 */
- if (PG_PROTOCOL_MAJOR(FrontendProtocol) < 3)
- ereport(FATAL,
- (errcode(ERRCODE_PROTOCOL_VIOLATION),
- errmsg("invalid frontend message type %d", qtype)));
break;
case 'd': /* copy data */
case 'c': /* copy done */
case 'f': /* copy fail */
doing_extended_query_message = false;
- /* these are only legal in protocol 3 */
- if (PG_PROTOCOL_MAJOR(FrontendProtocol) < 3)
- ereport(FATAL,
- (errcode(ERRCODE_PROTOCOL_VIOLATION),
- errmsg("invalid frontend message type %d", qtype)));
break;
default:
@@ -483,13 +421,8 @@ SocketBackend(StringInfo inBuf)
* after the type code; we can read the message contents independently of
* the type.
*/
- if (PG_PROTOCOL_MAJOR(FrontendProtocol) >= 3)
- {
- if (pq_getmessage(inBuf, 0))
- return EOF; /* suitable message already logged */
- }
- else
- pq_endmsgread();
+ if (pq_getmessage(inBuf, 0))
+ return EOF; /* suitable message already logged */
RESUME_CANCEL_INTERRUPTS();
return qtype;