123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358 |
- send
- Query {"query": "DROP TABLE IF EXISTS t"}
- ----
- until ignore=NoticeResponse
- ReadyForQuery
- ----
- CommandComplete {"tag":"DROP TABLE"}
- ReadyForQuery {"status":"I"}
- send
- Query {"query": "CREATE TABLE t (i INT8, t TEXT)"}
- ----
- until
- ReadyForQuery
- ----
- CommandComplete {"tag":"CREATE TABLE"}
- ReadyForQuery {"status":"I"}
- # COPY with both empty string and \N for NULL.
- # Note that after receiving the terminating char, no other data should be
- # accepted.
- send
- Query {"query": "COPY t FROM STDIN"}
- CopyData "1\tblah\n"
- CopyData "2\t\n"
- CopyData "3\t\\N\n"
- CopyData "\\.\n"
- CopyDone
- Query {"query": "SELECT * FROM t ORDER BY i"}
- ----
- until
- ReadyForQuery
- ReadyForQuery
- ----
- CopyIn {"format":"text","column_formats":["text","text"]}
- CommandComplete {"tag":"COPY 3"}
- ReadyForQuery {"status":"I"}
- RowDescription {"fields":[{"name":"i"},{"name":"t"}]}
- DataRow {"fields":["1","blah"]}
- DataRow {"fields":["2",""]}
- DataRow {"fields":["3","NULL"]}
- CommandComplete {"tag":"SELECT 3"}
- ReadyForQuery {"status":"I"}
- # Wrong number of columns.
- send
- Query {"query": "COPY t FROM STDIN"}
- CopyData "1\n"
- CopyData "\\.\n"
- CopyDone
- ----
- until err_field_typs=C
- ErrorResponse
- ReadyForQuery
- ----
- CopyIn {"format":"text","column_formats":["text","text"]}
- ErrorResponse {"fields":[{"typ":"C","value":"22P04"}]}
- ReadyForQuery {"status":"I"}
- # Verify that only one COPY can run at once.
- send
- Query {"query": "COPY t FROM STDIN"}
- Query {"query": "COPY t FROM STDIN"}
- ----
- until err_field_typs=C
- ErrorResponse
- ReadyForQuery
- ----
- CopyIn {"format":"text","column_formats":["text","text"]}
- ErrorResponse {"fields":[{"typ":"C","value":"08P01"}]}
- ReadyForQuery {"status":"I"}
- # Verify that after a COPY has started another statement cannot run.
- send
- Query {"query": "COPY t FROM STDIN"}
- Query {"query": "SELECT 2"}
- ----
- until err_field_typs=C
- ErrorResponse
- ReadyForQuery
- ----
- CopyIn {"format":"text","column_formats":["text","text"]}
- ErrorResponse {"fields":[{"typ":"C","value":"08P01"}]}
- ReadyForQuery {"status":"I"}
- send
- Query {"query": "DROP TABLE t"}
- Query {"query": "CREATE TABLE t (i INT8, t TEXT)"}
- Query {"query": "COPY t FROM STDIN"}
- CopyData "1\tblah\n"
- CopyData "\\.\n"
- CopyDone
- Query {"query": "SELECT * FROM t ORDER BY i"}
- ----
- until
- ReadyForQuery
- ReadyForQuery
- ReadyForQuery
- ReadyForQuery
- ----
- CommandComplete {"tag":"DROP TABLE"}
- ReadyForQuery {"status":"I"}
- CommandComplete {"tag":"CREATE TABLE"}
- ReadyForQuery {"status":"I"}
- CopyIn {"format":"text","column_formats":["text","text"]}
- CommandComplete {"tag":"COPY 1"}
- ReadyForQuery {"status":"I"}
- RowDescription {"fields":[{"name":"i"},{"name":"t"}]}
- DataRow {"fields":["1","blah"]}
- CommandComplete {"tag":"SELECT 1"}
- ReadyForQuery {"status":"I"}
- send
- Query {"query": "DROP TABLE t"}
- Query {"query": "CREATE TABLE t (i INT8, t TEXT)"}
- Query {"query": "COPY t FROM STDIN WITH (DELIMITER ',')"}
- CopyData "1,blah\n"
- CopyData "2,\\N\n"
- CopyData "\\.\n"
- CopyDone
- Query {"query": "SELECT * FROM t ORDER BY i"}
- ----
- until
- ReadyForQuery
- ReadyForQuery
- ReadyForQuery
- ReadyForQuery
- ----
- CommandComplete {"tag":"DROP TABLE"}
- ReadyForQuery {"status":"I"}
- CommandComplete {"tag":"CREATE TABLE"}
- ReadyForQuery {"status":"I"}
- CopyIn {"format":"text","column_formats":["text","text"]}
- CommandComplete {"tag":"COPY 2"}
- ReadyForQuery {"status":"I"}
- RowDescription {"fields":[{"name":"i"},{"name":"t"}]}
- DataRow {"fields":["1","blah"]}
- DataRow {"fields":["2","NULL"]}
- CommandComplete {"tag":"SELECT 2"}
- ReadyForQuery {"status":"I"}
- send
- Query {"query": "DROP TABLE t"}
- Query {"query": "CREATE TABLE t (i INT8, t TEXT)"}
- Query {"query": "COPY t FROM STDIN WITH (NULL 'NS')"}
- CopyData "1\tblah\n"
- CopyData "2\t\\N\n"
- CopyData "3\tNS\n"
- CopyData "\\.\n"
- CopyDone
- Query {"query": "SELECT * FROM t ORDER BY i"}
- ----
- until
- ReadyForQuery
- ReadyForQuery
- ReadyForQuery
- ReadyForQuery
- ----
- CommandComplete {"tag":"DROP TABLE"}
- ReadyForQuery {"status":"I"}
- CommandComplete {"tag":"CREATE TABLE"}
- ReadyForQuery {"status":"I"}
- CopyIn {"format":"text","column_formats":["text","text"]}
- CommandComplete {"tag":"COPY 3"}
- ReadyForQuery {"status":"I"}
- RowDescription {"fields":[{"name":"i"},{"name":"t"}]}
- DataRow {"fields":["1","blah"]}
- DataRow {"fields":["2","N"]}
- DataRow {"fields":["3","NULL"]}
- CommandComplete {"tag":"SELECT 3"}
- ReadyForQuery {"status":"I"}
- send
- Query {"query": "COPY t FROM STDIN"}
- CopyData "1\n"
- CopyData "\\.\n"
- CopyDone
- ----
- until err_field_typs=C
- ErrorResponse
- ReadyForQuery
- ----
- CopyIn {"format":"text","column_formats":["text","text"]}
- ErrorResponse {"fields":[{"typ":"C","value":"22P04"}]}
- ReadyForQuery {"status":"I"}
- send
- Query {"query": "DROP TABLE t"}
- Query {"query": "CREATE TABLE t (i INT8, t TEXT)"}
- Query {"query": "COPY t FROM STDIN WITH (DELIMITER ',')"}
- CopyData "1,blah\n"
- CopyData "2,\n"
- CopyData "\\.\n"
- CopyDone
- Query {"query": "SELECT * FROM t ORDER BY i"}
- ----
- until
- ReadyForQuery
- ReadyForQuery
- ReadyForQuery
- ReadyForQuery
- ----
- CommandComplete {"tag":"DROP TABLE"}
- ReadyForQuery {"status":"I"}
- CommandComplete {"tag":"CREATE TABLE"}
- ReadyForQuery {"status":"I"}
- CopyIn {"format":"text","column_formats":["text","text"]}
- CommandComplete {"tag":"COPY 2"}
- ReadyForQuery {"status":"I"}
- RowDescription {"fields":[{"name":"i"},{"name":"t"}]}
- DataRow {"fields":["1","blah"]}
- DataRow {"fields":["2",""]}
- CommandComplete {"tag":"SELECT 2"}
- ReadyForQuery {"status":"I"}
- send
- Query {"query": "DROP TABLE t"}
- Query {"query": "CREATE TABLE t (i INT8, t TEXT)"}
- Query {"query": "COPY t FROM STDIN WITH (NULL 'NS', DELIMITER '|')"}
- CopyData "1|blah\n"
- CopyData "2|NS\n"
- CopyData "3|\n"
- CopyData "\\.\n"
- CopyDone
- Query {"query": "SELECT * FROM t ORDER BY i"}
- ----
- until
- ReadyForQuery
- ReadyForQuery
- ReadyForQuery
- ReadyForQuery
- ----
- CommandComplete {"tag":"DROP TABLE"}
- ReadyForQuery {"status":"I"}
- CommandComplete {"tag":"CREATE TABLE"}
- ReadyForQuery {"status":"I"}
- CopyIn {"format":"text","column_formats":["text","text"]}
- CommandComplete {"tag":"COPY 3"}
- ReadyForQuery {"status":"I"}
- RowDescription {"fields":[{"name":"i"},{"name":"t"}]}
- DataRow {"fields":["1","blah"]}
- DataRow {"fields":["2","NULL"]}
- DataRow {"fields":["3",""]}
- CommandComplete {"tag":"SELECT 3"}
- ReadyForQuery {"status":"I"}
- send
- Query {"query": "COPY t FROM STDIN WITH (DELIMITER ',')"}
- CopyData "1\n"
- CopyData "\\.\n"
- CopyDone
- ----
- until err_field_typs=C
- ErrorResponse
- ReadyForQuery
- ----
- CopyIn {"format":"text","column_formats":["text","text"]}
- ErrorResponse {"fields":[{"typ":"C","value":"22P04"}]}
- ReadyForQuery {"status":"I"}
- # check Sync message is ignored
- send
- Query {"query": "COPY t FROM STDIN"}
- Sync
- CopyData "4\t\\N\n"
- Sync
- Sync
- Sync
- CopyData "5\t\\N\n"
- CopyDone
- Query {"query": "SELECT * FROM t ORDER BY i"}
- ----
- until
- ReadyForQuery
- ReadyForQuery
- ----
- CopyIn {"format":"text","column_formats":["text","text"]}
- CommandComplete {"tag":"COPY 2"}
- ReadyForQuery {"status":"I"}
- RowDescription {"fields":[{"name":"i"},{"name":"t"}]}
- DataRow {"fields":["1","blah"]}
- DataRow {"fields":["2","NULL"]}
- DataRow {"fields":["3",""]}
- DataRow {"fields":["4","NULL"]}
- DataRow {"fields":["5","NULL"]}
- CommandComplete {"tag":"SELECT 5"}
- ReadyForQuery {"status":"I"}
- # ignore junk data after end of copy marker
- send
- Query {"query": "COPY t FROM STDIN"}
- CopyData "\\.\n"
- CopyData "invalid data\n"
- CopyDone
- Query {"query": "SELECT * FROM t ORDER BY i"}
- ----
- until
- ReadyForQuery
- ReadyForQuery
- ----
- CopyIn {"format":"text","column_formats":["text","text"]}
- CommandComplete {"tag":"COPY 0"}
- ReadyForQuery {"status":"I"}
- RowDescription {"fields":[{"name":"i"},{"name":"t"}]}
- DataRow {"fields":["1","blah"]}
- DataRow {"fields":["2","NULL"]}
- DataRow {"fields":["3",""]}
- DataRow {"fields":["4","NULL"]}
- DataRow {"fields":["5","NULL"]}
- CommandComplete {"tag":"SELECT 5"}
- ReadyForQuery {"status":"I"}
- send
- Query {"query": "COPY t FROM STDIN WITH (DELIMITER '||')"}
- ----
- until
- ErrorResponse
- ReadyForQuery
- ----
- ErrorResponse {"fields":[{"typ":"S","value":"ERROR"},{"typ":"C","value":"XX000"},{"typ":"M","value":"COPY delimiter must be a single one-byte character"}]}
- ReadyForQuery {"status":"I"}
- send
- Query {"query": "COPY t FROM STDIN WITH (QUOTE '||')"}
- Query {"query": "COPY t FROM STDIN WITH (ESCAPE '||')"}
- Query {"query": "COPY t FROM STDIN WITH (HEADER true)"}
- ----
- until
- ErrorResponse
- ReadyForQuery
- ErrorResponse
- ReadyForQuery
- ErrorResponse
- ReadyForQuery
- ----
- ErrorResponse {"fields":[{"typ":"S","value":"ERROR"},{"typ":"C","value":"XX000"},{"typ":"M","value":"COPY quote available only in CSV mode"}]}
- ReadyForQuery {"status":"I"}
- ErrorResponse {"fields":[{"typ":"S","value":"ERROR"},{"typ":"C","value":"XX000"},{"typ":"M","value":"COPY escape available only in CSV mode"}]}
- ReadyForQuery {"status":"I"}
- ErrorResponse {"fields":[{"typ":"S","value":"ERROR"},{"typ":"C","value":"XX000"},{"typ":"M","value":"COPY HEADER available only in CSV mode"}]}
- ReadyForQuery {"status":"I"}
|