mirror of
https://github.com/postgres/postgres.git
synced 2025-12-12 02:37:31 +03:00
Another round of protocol changes. Backend-to-frontend messages now all
have length words. COPY OUT reimplemented per new protocol: it doesn't need \. anymore, thank goodness. COPY BINARY to/from frontend works, at least as far as the backend is concerned --- libpq's PQgetline API is not up to snuff, and will have to be replaced with something that is null-safe. libpq uses message length words for performance improvement (no cycles wasted rescanning long messages), but not yet for error recovery.
This commit is contained in:
@@ -995,7 +995,6 @@ copy test("........pg.dropped.1........") to stdout;
|
||||
ERROR: Relation "test" has no column "........pg.dropped.1........"
|
||||
copy test from stdin;
|
||||
ERROR: copy: line 1, Extra data after last expected column
|
||||
lost synchronization with server, resetting connection
|
||||
SET autocommit TO 'on';
|
||||
select * from test;
|
||||
b | c
|
||||
|
||||
@@ -35,17 +35,13 @@ ERROR: Attribute "d" specified more than once
|
||||
-- missing data: should fail
|
||||
COPY x from stdin;
|
||||
ERROR: copy: line 1, pg_atoi: zero-length string
|
||||
lost synchronization with server, resetting connection
|
||||
COPY x from stdin;
|
||||
ERROR: copy: line 1, Missing data for column "e"
|
||||
lost synchronization with server, resetting connection
|
||||
COPY x from stdin;
|
||||
ERROR: copy: line 1, Missing data for column "e"
|
||||
lost synchronization with server, resetting connection
|
||||
-- extra data: should fail
|
||||
COPY x from stdin;
|
||||
ERROR: copy: line 1, Extra data after last expected column
|
||||
lost synchronization with server, resetting connection
|
||||
SET autocommit TO 'on';
|
||||
-- various COPY options: delimiters, oids, NULL string
|
||||
COPY x (b, c, d, e) from stdin with oids delimiter ',' null 'x';
|
||||
|
||||
@@ -40,7 +40,6 @@ INSERT INTO basictest values ('88', 'haha', 'short', '123.1212'); -- Truncate
|
||||
-- Test copy
|
||||
COPY basictest (testvarchar) FROM stdin; -- fail
|
||||
ERROR: copy: line 1, value too long for type character varying(5)
|
||||
lost synchronization with server, resetting connection
|
||||
SET autocommit TO 'on';
|
||||
COPY basictest (testvarchar) FROM stdin;
|
||||
select * from basictest;
|
||||
@@ -128,12 +127,10 @@ INSERT INTO nulltest values ('a', 'b', 'c', NULL, 'd'); -- Good
|
||||
-- Test copy
|
||||
COPY nulltest FROM stdin; --fail
|
||||
ERROR: copy: line 1, Domain dcheck does not allow NULL values
|
||||
lost synchronization with server, resetting connection
|
||||
SET autocommit TO 'on';
|
||||
-- Last row is bad
|
||||
COPY nulltest FROM stdin;
|
||||
ERROR: copy: line 3, CopyFrom: rejected due to CHECK constraint "nulltest_col5" on "nulltest"
|
||||
lost synchronization with server, resetting connection
|
||||
select * from nulltest;
|
||||
col1 | col2 | col3 | col4 | col5
|
||||
------+------+------+------+------
|
||||
|
||||
Reference in New Issue
Block a user