diff options
author | Robert Haas <rhaas@postgresql.org> | 2013-04-29 06:29:32 -0400 |
---|---|---|
committer | Robert Haas <rhaas@postgresql.org> | 2013-04-29 06:29:32 -0400 |
commit | 91fa8532f4053468acc08534a6aac516ccde47b7 (patch) | |
tree | dee028ed0f9f985691ca80fc00ce5d978b21ee56 /doc/src | |
parent | 43e7a668499b8a69a62cc539a0fbe6983384339c (diff) | |
download | postgresql-91fa8532f4053468acc08534a6aac516ccde47b7.tar.gz postgresql-91fa8532f4053468acc08534a6aac516ccde47b7.zip |
Attempt to fix error recovery in COPY BOTH mode.
Previously, libpq and the backend had opposite ideas about whether
it was necessary for the client to send a CopyDone message after
receiving an ErrorResponse, making it impossible to cleanly exit
COPY BOTH mode. Fix libpq so that works correctly, adopting the
backend's notion that an ErrorResponse kills the copy in both
directions.
Adjust receivelog.c to avoid a degradation in the quality of the
resulting error messages. libpqwalreceiver.c is already doing
the right thing, so no adjustment needed there.
Add an explicit statement to the documentation explaining how
this part of the protocol is supposed to work, in the hopes of
avoiding future confusion in this area.
Since the consequences of all this confusion are very limited,
especially in the back-branches where no client ever attempts
to exit COPY BOTH mode without closing the connection entirely,
no back-patch.
Diffstat (limited to 'doc/src')
-rw-r--r-- | doc/src/sgml/protocol.sgml | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/doc/src/sgml/protocol.sgml b/doc/src/sgml/protocol.sgml index d32626677d1..1e2604b8326 100644 --- a/doc/src/sgml/protocol.sgml +++ b/doc/src/sgml/protocol.sgml @@ -1031,8 +1031,13 @@ goes into copy-in mode, and the server may not send any more CopyData messages. After both sides have sent a CopyDone message, the copy mode is terminated, and the backend reverts to the command-processing mode. - See <xref linkend="protocol-replication"> for more information on the - subprotocol transmitted over copy-both mode. + In the event of a backend-detected error during copy-both mode, + the backend will issue an ErrorResponse message, discard frontend messages + until a Sync message is received, and then issue ReadyForQuery and return + to normal processing. The frontend should treat receipt of ErrorResponse + as terminating the copy in both directions; no CopyDone should be sent + in this case. See <xref linkend="protocol-replication"> for more + information on the subprotocol transmitted over copy-both mode. </para> <para> |