1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-30 11:03:19 +03:00

Fix an ancient oversight in libpq's handling of V3-protocol COPY OUT mode:

we need to be able to swallow NOTICE messages, and potentially also
ParameterStatus messages (although the latter would be a bit weird),
without exiting COPY OUT state.  Fix it, and adjust the protocol documentation
to emphasize the need for this.  Per off-list report from Alexander Galler.
This commit is contained in:
Tom Lane
2008-01-14 18:46:25 +00:00
parent 691189c9d6
commit dcd462a9c0
2 changed files with 104 additions and 48 deletions

View File

@ -1,4 +1,4 @@
<!-- $PostgreSQL: pgsql/doc/src/sgml/protocol.sgml,v 1.66 2006/09/06 20:40:47 tgl Exp $ -->
<!-- $PostgreSQL: pgsql/doc/src/sgml/protocol.sgml,v 1.66.2.1 2008/01/14 18:46:25 tgl Exp $ -->
<chapter id="protocol">
<title>Frontend/Backend Protocol</title>
@ -993,9 +993,16 @@
<para>
In the event of a backend-detected error during copy-out mode,
the backend will issue an ErrorResponse message and revert to normal
processing. The frontend should treat receipt of ErrorResponse (or
indeed any message type other than CopyData or CopyDone) as terminating
the copy-out mode.
processing. The frontend should treat receipt of ErrorResponse as
terminating the copy-out mode.
</para>
<para>
It is possible for NoticeResponse messages to be interspersed between
CopyData messages; frontends must handle this case, and should be
prepared for other asynchronous message types as well (see <xref
linkend="protocol-async">). Otherwise, any message type other than
CopyData or CopyDone may be treated as terminating copy-out mode.
</para>
<para>