mirror of
https://github.com/postgres/postgres.git
synced 2025-11-21 00:42:43 +03:00
Remove server and libpq support for old FE/BE protocol version 2.
Protocol version 3 was introduced in PostgreSQL 7.4. There shouldn't be many clients or servers left out there without version 3 support. But as a courtesy, I kept just enough of the old protocol support that we can still send the "unsupported protocol version" error in v2 format, so that old clients can display the message properly. Likewise, libpq still understands v2 ErrorResponse messages when establishing a connection. The impetus to do this now is that I'm working on a patch to COPY FROM, to always prefetch some data. We cannot do that safely with the old protocol, because it requires parsing the input one byte at a time to detect the end-of-copy marker. Reviewed-by: Tom Lane, Alvaro Herrera, John Naylor Discussion: https://www.postgresql.org/message-id/9ec25819-0a8a-d51a-17dc-4150bb3cca3b%40iki.fi
This commit is contained in:
@@ -33,8 +33,6 @@ static int mq_flush_if_writable(void);
|
||||
static bool mq_is_send_pending(void);
|
||||
static int mq_putmessage(char msgtype, const char *s, size_t len);
|
||||
static void mq_putmessage_noblock(char msgtype, const char *s, size_t len);
|
||||
static void mq_startcopyout(void);
|
||||
static void mq_endcopyout(bool errorAbort);
|
||||
|
||||
static const PQcommMethods PqCommMqMethods = {
|
||||
mq_comm_reset,
|
||||
@@ -42,9 +40,7 @@ static const PQcommMethods PqCommMqMethods = {
|
||||
mq_flush_if_writable,
|
||||
mq_is_send_pending,
|
||||
mq_putmessage,
|
||||
mq_putmessage_noblock,
|
||||
mq_startcopyout,
|
||||
mq_endcopyout
|
||||
mq_putmessage_noblock
|
||||
};
|
||||
|
||||
/*
|
||||
@@ -195,18 +191,6 @@ mq_putmessage_noblock(char msgtype, const char *s, size_t len)
|
||||
elog(ERROR, "not currently supported");
|
||||
}
|
||||
|
||||
static void
|
||||
mq_startcopyout(void)
|
||||
{
|
||||
/* Nothing to do. */
|
||||
}
|
||||
|
||||
static void
|
||||
mq_endcopyout(bool errorAbort)
|
||||
{
|
||||
/* Nothing to do. */
|
||||
}
|
||||
|
||||
/*
|
||||
* Parse an ErrorResponse or NoticeResponse payload and populate an ErrorData
|
||||
* structure with the results.
|
||||
|
||||
Reference in New Issue
Block a user