Remove server and libpq support for old FE/BE protocol version 2.
authorHeikki Linnakangas <heikki.linnakangas@iki.fi>
Thu, 4 Mar 2021 08:45:55 +0000 (10:45 +0200)
committerHeikki Linnakangas <heikki.linnakangas@iki.fi>
Thu, 4 Mar 2021 08:45:55 +0000 (10:45 +0200)
commit3174d69fb96a66173224e60ec7053b988d5ed4d9
tree2dbeb5e94ccfde05b8d40a15b88e1107220fb9b1
parent0a687c8f103d217ff1ca8c34a644b380d89bb0ad
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
33 files changed:
doc/src/sgml/libpq.sgml
src/backend/access/common/printtup.c
src/backend/commands/async.c
src/backend/commands/copyfrom.c
src/backend/commands/copyfromparse.c
src/backend/commands/copyto.c
src/backend/libpq/auth.c
src/backend/libpq/pqcomm.c
src/backend/libpq/pqmq.c
src/backend/postmaster/postmaster.c
src/backend/tcop/dest.c
src/backend/tcop/fastpath.c
src/backend/tcop/postgres.c
src/backend/utils/error/elog.c
src/backend/utils/misc/guc.c
src/bin/psql/common.c
src/bin/psql/copy.c
src/include/commands/copyfrom_internal.h
src/include/libpq/libpq.h
src/include/libpq/pqcomm.h
src/include/tcop/fastpath.h
src/include/utils/elog.h
src/interfaces/libpq/Makefile
src/interfaces/libpq/fe-auth.c
src/interfaces/libpq/fe-connect.c
src/interfaces/libpq/fe-exec.c
src/interfaces/libpq/fe-lobj.c
src/interfaces/libpq/fe-misc.c
src/interfaces/libpq/fe-protocol2.c [deleted file]
src/interfaces/libpq/fe-protocol3.c
src/interfaces/libpq/libpq-fe.h
src/interfaces/libpq/libpq-int.h
src/interfaces/libpq/nls.mk