• Tom Lane's avatar
    Make sure we wait for protocol-level EOF when ending binary COPY IN. · f906e078
    Tom Lane authored
    The previous coding just terminated the COPY immediately after seeing
    the EOF marker (-1 where a row field count is expected).  The expected
    CopyDone or CopyFail message just got thrown away later, since we weren't
    in COPY mode anymore.  This behavior complicated matters for the JDBC
    driver, and arguably was the wrong thing in any case since a CopyFail
    message after the marker wouldn't be honored.
    
    Note that there is a behavioral change here: extra data after the EOF
    marker was silently ignored before, but now it will cause an error.
    Hence not back-patching, although this is arguably a bug.
    
    Per report and patch by Kris Jurka.
    f906e078
copy.c 97.1 KB