Removing support for COPY FROM STDIN in protocol version 2

Поиск
Список
Период
Сортировка
От Heikki Linnakangas
Тема Removing support for COPY FROM STDIN in protocol version 2
Дата
Msg-id 9ec25819-0a8a-d51a-17dc-4150bb3cca3b@iki.fi
обсуждение исходный текст
Ответы Re: Removing support for COPY FROM STDIN in protocol version 2  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
Hi,

The server still supports the old protocol version 2. Protocol version 3 
was introduced in PostgreSQL 7.4, so there shouldn't be many clients 
around anymore that don't support it.

COPY FROM STDIN is particularly problematic with the old protocol, 
because the end-of-copy can only be detected by the \. marker. So the 
server has to read the input one byte at a time, and check for \. as it 
goes. At [1], I'm working on a patch to change the way the encoding 
conversion is performed in COPY FROM, so that we convert the data in 
larger chunks, before scanning the input for line boundaries. We can't 
do that safely in the old protocol.

I propose that we remove server support for COPY FROM STDIN with 
protocol version 2, per attached patch. Even if we could still support 
it, it would be a very rarely used and tested codepath, prone to bugs. 
Perhaps we could remove support for the old protocol altogether, but I'm 
not proposing that we go that far just yet.

[1] 
https://www.postgresql.org/message-id/e7861509-3960-538a-9025-b75a61188e01%40iki.fi

- Heikki

Вложения

В списке pgsql-hackers по дате отправления:

Предыдущее
От: Stephen Frost
Дата:
Сообщение: Re: Key management with tests
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Removing support for COPY FROM STDIN in protocol version 2