copy-from-fail.pt 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. send
  2. Query {"query": "DROP TABLE IF EXISTS t"}
  3. ----
  4. until ignore=NoticeResponse
  5. ReadyForQuery
  6. ----
  7. CommandComplete {"tag":"DROP TABLE"}
  8. ReadyForQuery {"status":"I"}
  9. send
  10. Query {"query": "CREATE TABLE t (i INT8, t TEXT)"}
  11. ----
  12. until
  13. ReadyForQuery
  14. ----
  15. CommandComplete {"tag":"CREATE TABLE"}
  16. ReadyForQuery {"status":"I"}
  17. # send CopyFail and check the remaining messages are ignored until Sync is sent
  18. send
  19. Query {"query": "COPY t FROM STDIN"}
  20. CopyData "1\tblah\n"
  21. CopyFail "frontend failure"
  22. CopyData "2\t\n"
  23. CopyData "\\.\n"
  24. CopyDone
  25. Sync
  26. Query {"query": "SELECT * FROM t ORDER BY i"}
  27. ----
  28. until ignore=RowDescription
  29. ReadyForQuery
  30. ReadyForQuery
  31. ----
  32. CopyIn {"format":"text","column_formats":["text","text"]}
  33. ErrorResponse {"fields":[{"typ":"S","value":"ERROR"},{"typ":"C","value":"57014"},{"typ":"M","value":"COPY from stdin failed: frontend failure"}]}
  34. ReadyForQuery {"status":"I"}
  35. ReadyForQuery {"status":"I"}
  36. send
  37. Query {"query": "DROP TABLE IF EXISTS t"}
  38. ----
  39. until ignore=NoticeResponse
  40. ReadyForQuery
  41. ----
  42. RowDescription {"fields":[{"name":"i"},{"name":"t"}]}
  43. CommandComplete {"tag":"SELECT 0"}
  44. ReadyForQuery {"status":"I"}