forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit7702337
committed
Do not treat \. as an EOF marker in CSV mode for COPY IN.
Since backslash is (typically) not special in CSV data, we shouldnot be treating \. as special either. The server historically didthis to keep CSV and TEXT modes more alike and to support V2 protocol;but V2 protocol is long dead, and the inconsistency with CSV standardsis annoying. Remove that behavior in CopyReadLineText, and make someminor consequent code simplifications.On the client side, we need to fix psql so that it does not checkfor \. except when reading data from STDIN (that is, the scriptsource). We must do that regardless of TEXT/CSV mode or there isno way to end the COPY short of script EOF. Also, be carefulnot to send the \. to the server in that case.This is a small compatibility break in that other applicationsbeside psql may need similar adjustment. Also, using an olderversion of psql with a v18 server may result in misbehaviorduring CSV-mode COPY IN.Daniel Vérité, reviewed by vignesh C, Robert Haas, and myselfDiscussion:https://postgr.es/m/ed659f37-a9dd-42a7-82b9-0da562cc4006@manitou-mail.org1 parenta19f83f commit7702337
File tree
9 files changed
+105
-92
lines changed- doc/src/sgml
- ref
- src
- backend/commands
- bin/psql
- test/regress
- expected
- sql
9 files changed
+105
-92
lines changedLines changed: 3 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
7381 | 7381 |
| |
7382 | 7382 |
| |
7383 | 7383 |
| |
7384 |
| - | |
7385 |
| - | |
| 7384 | + | |
| 7385 | + | |
| 7386 | + | |
7386 | 7387 |
| |
7387 | 7388 |
| |
7388 | 7389 |
| |
|
Lines changed: 3 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
7606 | 7606 |
| |
7607 | 7607 |
| |
7608 | 7608 |
| |
7609 |
| - | |
7610 |
| - | |
| 7609 | + | |
| 7610 | + | |
| 7611 | + | |
7611 | 7612 |
| |
7612 | 7613 |
| |
7613 | 7614 |
| |
|
Lines changed: 25 additions & 11 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
646 | 646 |
| |
647 | 647 |
| |
648 | 648 |
| |
649 |
| - | |
| 649 | + | |
650 | 650 |
| |
651 | 651 |
| |
652 |
| - | |
653 |
| - | |
| 652 | + | |
| 653 | + | |
| 654 | + | |
| 655 | + | |
| 656 | + | |
| 657 | + | |
| 658 | + | |
654 | 659 |
| |
655 | 660 |
| |
656 | 661 |
| |
| |||
811 | 816 |
| |
812 | 817 |
| |
813 | 818 |
| |
814 |
| - | |
815 |
| - | |
816 |
| - | |
817 |
| - | |
818 |
| - | |
819 |
| - | |
820 |
| - | |
821 |
| - | |
| 819 | + | |
| 820 | + | |
| 821 | + | |
| 822 | + | |
| 823 | + | |
| 824 | + | |
| 825 | + | |
822 | 826 |
| |
823 | 827 |
| |
| 828 | + | |
| 829 | + | |
| 830 | + | |
| 831 | + | |
| 832 | + | |
| 833 | + | |
| 834 | + | |
| 835 | + | |
| 836 | + | |
| 837 | + | |
824 | 838 |
| |
825 | 839 |
| |
826 | 840 |
| |
|
Lines changed: 2 additions & 5 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1135 | 1135 |
| |
1136 | 1136 |
| |
1137 | 1137 |
| |
1138 |
| - | |
| 1138 | + | |
| 1139 | + | |
1139 | 1140 |
| |
1140 | 1141 |
| |
1141 | 1142 |
| |
| |||
1179 | 1180 |
| |
1180 | 1181 |
| |
1181 | 1182 |
| |
1182 |
| - | |
1183 |
| - | |
1184 |
| - | |
1185 |
| - | |
1186 | 1183 |
| |
1187 | 1184 |
| |
1188 | 1185 |
| |
|
Lines changed: 19 additions & 61 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
136 | 136 |
| |
137 | 137 |
| |
138 | 138 |
| |
139 |
| - | |
140 |
| - | |
141 |
| - | |
142 |
| - | |
143 |
| - | |
144 |
| - | |
145 |
| - | |
146 |
| - | |
147 | 139 |
| |
148 | 140 |
| |
149 | 141 |
| |
| |||
1182 | 1174 |
| |
1183 | 1175 |
| |
1184 | 1176 |
| |
1185 |
| - | |
1186 | 1177 |
| |
1187 | 1178 |
| |
1188 | 1179 |
| |
| |||
1268 | 1259 |
| |
1269 | 1260 |
| |
1270 | 1261 |
| |
1271 |
| - | |
1272 |
| - | |
1273 |
| - | |
1274 |
| - | |
| 1262 | + | |
| 1263 | + | |
| 1264 | + | |
| 1265 | + | |
1275 | 1266 |
| |
1276 |
| - | |
| 1267 | + | |
1277 | 1268 |
| |
1278 | 1269 |
| |
1279 | 1270 |
| |
| |||
1377 | 1368 |
| |
1378 | 1369 |
| |
1379 | 1370 |
| |
1380 |
| - | |
1381 |
| - | |
| 1371 | + | |
| 1372 | + | |
1382 | 1373 |
| |
1383 |
| - | |
| 1374 | + | |
1384 | 1375 |
| |
1385 | 1376 |
| |
1386 | 1377 |
| |
| |||
1398 | 1389 |
| |
1399 | 1390 |
| |
1400 | 1391 |
| |
1401 |
| - | |
1402 |
| - | |
1403 |
| - | |
1404 |
| - | |
1405 |
| - | |
1406 |
| - | |
1407 | 1392 |
| |
1408 | 1393 |
| |
1409 | 1394 |
| |
| |||
1412 | 1397 |
| |
1413 | 1398 |
| |
1414 | 1399 |
| |
1415 |
| - | |
1416 |
| - | |
1417 |
| - | |
1418 |
| - | |
1419 |
| - | |
1420 |
| - | |
1421 |
| - | |
1422 |
| - | |
| 1400 | + | |
| 1401 | + | |
| 1402 | + | |
1423 | 1403 |
| |
1424 |
| - | |
1425 |
| - | |
1426 |
| - | |
1427 |
| - | |
1428 |
| - | |
1429 |
| - | |
1430 |
| - | |
1431 |
| - | |
| 1404 | + | |
| 1405 | + | |
| 1406 | + | |
1432 | 1407 |
| |
1433 | 1408 |
| |
1434 | 1409 |
| |
| |||
1437 | 1412 |
| |
1438 | 1413 |
| |
1439 | 1414 |
| |
1440 |
| - | |
1441 |
| - | |
1442 |
| - | |
1443 |
| - | |
1444 |
| - | |
1445 |
| - | |
1446 |
| - | |
1447 |
| - | |
| 1415 | + | |
| 1416 | + | |
| 1417 | + | |
1448 | 1418 |
| |
1449 | 1419 |
| |
1450 | 1420 |
| |
| |||
1467 | 1437 |
| |
1468 | 1438 |
| |
1469 | 1439 |
| |
1470 |
| - | |
| 1440 | + | |
1471 | 1441 |
| |
1472 | 1442 |
| |
1473 | 1443 |
| |
1474 | 1444 |
| |
1475 | 1445 |
| |
1476 | 1446 |
| |
1477 | 1447 |
| |
1478 |
| - | |
1479 |
| - | |
1480 |
| - | |
1481 |
| - | |
| 1448 | + | |
1482 | 1449 |
| |
1483 | 1450 |
| |
1484 | 1451 |
| |
1485 | 1452 |
| |
1486 |
| - | |
1487 |
| - | |
1488 |
| - | |
1489 |
| - | |
1490 |
| - | |
1491 |
| - | |
1492 |
| - | |
1493 |
| - | |
1494 |
| - | |
1495 | 1453 |
| |
1496 | 1454 |
| |
1497 | 1455 |
| |
|
Lines changed: 5 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1160 | 1160 |
| |
1161 | 1161 |
| |
1162 | 1162 |
| |
1163 |
| - | |
1164 |
| - | |
| 1163 | + | |
| 1164 | + | |
| 1165 | + | |
| 1166 | + | |
| 1167 | + | |
1165 | 1168 |
| |
1166 | 1169 |
| |
1167 | 1170 |
| |
|
Lines changed: 18 additions & 9 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
620 | 620 |
| |
621 | 621 |
| |
622 | 622 |
| |
623 |
| - | |
624 |
| - | |
| 623 | + | |
| 624 | + | |
| 625 | + | |
| 626 | + | |
| 627 | + | |
| 628 | + | |
| 629 | + | |
| 630 | + | |
| 631 | + | |
625 | 632 |
| |
626 |
| - | |
627 |
| - | |
628 |
| - | |
629 |
| - | |
630 |
| - | |
631 |
| - | |
632 |
| - | |
633 | 633 |
| |
634 | 634 |
| |
635 | 635 |
| |
636 | 636 |
| |
| 637 | + | |
| 638 | + | |
| 639 | + | |
| 640 | + | |
| 641 | + | |
| 642 | + | |
| 643 | + | |
| 644 | + | |
| 645 | + | |
637 | 646 |
| |
638 | 647 |
| |
639 | 648 |
| |
|
Lines changed: 18 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
32 | 32 |
| |
33 | 33 |
| |
34 | 34 |
| |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
35 | 53 |
| |
36 | 54 |
| |
37 | 55 |
| |
|
Lines changed: 12 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
38 | 38 |
| |
39 | 39 |
| |
40 | 40 |
| |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
41 | 53 |
| |
42 | 54 |
| |
43 | 55 |
| |
|
0 commit comments
Comments
(0)