You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- exec: "LOAD DATA LOCAL INFILE 'testdata/1pk5col-ints.csv' INTO TABLE test CHARACTER SET UTF8MB4 FIELDS TERMINATED BY ',' ESCAPED BY '' LINES TERMINATED BY '\n' IGNORE 1 LINES"
242
+
- exec: "COPY test FROM '1pk5col-ints.csv' WITH (FORMAT csv, HEADER)"
242
243
- query: "SELECT * FROM test"
243
244
result:
244
245
columns: ["pk","c1","c2","c3","c4","c5"]
245
246
rows:
246
247
- ["0","1","2","3","4","5"]
247
248
- ["1","1","2","3","4","5"]
248
-
- name: LOAD DATA LOCAL INFILE automatically ignores row with existing primary key
249
-
skip: "MySQL-specific LOAD DATA LOCAL INFILE behavior has no Postgres equivalent"
249
+
- name: COPY into a table with a conflicting primary key (no IGNORE equivalent)
250
+
skip: "Postgres COPY errors on a primary-key conflict and has no equivalent of MySQL's LOAD DATA ... IGNORE; the Postgres idiom is INSERT ... ON CONFLICT DO NOTHING"
- exec: "INSERT INTO test VALUES (0, 0, 0, 0, 0, 0)"
260
-
- exec: "SET local_infile = 1"
261
-
- exec: "LOAD DATA LOCAL INFILE 'testdata/1pk5col-ints.csv' INTO TABLE test CHARACTER SET UTF8MB4 FIELDS TERMINATED BY ',' ESCAPED BY '' LINES TERMINATED BY '\n' IGNORE 1 LINES"
264
+
- exec: "COPY test FROM '1pk5col-ints.csv' WITH (FORMAT csv, HEADER)"
262
265
- query: "SELECT * FROM test"
263
266
result:
264
267
columns: ["pk","c1","c2","c3","c4","c5"]
265
268
rows:
266
269
- ["0","0","0","0","0","0"]
267
270
- ["1","1","2","3","4","5"]
268
-
- name: LOAD DATA LOCAL INFILE can replace row with existing primary key
269
-
skip: "MySQL-specific LOAD DATA LOCAL INFILE behavior has no Postgres equivalent"
271
+
- name: COPY into a table with a conflicting primary key (no REPLACE equivalent)
272
+
skip: "Postgres COPY errors on a primary-key conflict and has no equivalent of MySQL's LOAD DATA ... REPLACE; the Postgres idiom is INSERT ... ON CONFLICT DO UPDATE"
- exec: "INSERT INTO test VALUES (0, 0, 0, 0, 0, 0)"
280
-
- exec: "SET local_infile = 1"
281
-
- exec: "LOAD DATA LOCAL INFILE 'testdata/1pk5col-ints.csv' REPLACE INTO TABLE test CHARACTER SET UTF8MB4 FIELDS TERMINATED BY ',' ESCAPED BY '' LINES TERMINATED BY '\n' IGNORE 1 LINES"
286
+
- exec: "COPY test FROM '1pk5col-ints.csv' WITH (FORMAT csv, HEADER)"
0 commit comments