- Notifications
You must be signed in to change notification settings - Fork5k
Commitc532d15
committed
Split copy.c into four files.
Copy.c has grown really large. Split it into more manageable parts:- copy.c now contains only a few functions that are common to COPY FROM and COPY TO.- copyto.c contains code for COPY TO.- copyfrom.c contains code for initializing COPY FROM, and inserting the tuples to the correct table.- copyfromparse.c contains code for reading from the client/file/program, and parsing the input text/CSV/binary format into tuples.All of these parts are fairly complicated, and fairly independent of eachother. There is a patch being discussed to implement parallel COPY FROM,which will add a lot of new code to the COPY FROM path, and another patchwhich would allow INSERTs to use the same multi-insert machinery as COPYFROM, both of which will require refactoring that code. With those twopatches, there's going to be a lot of code churn in copy.c anyway, so nowseems like a good time to do this refactoring.The CopyStateData struct is also split. All the formatting options, likeFORMAT, QUOTE, ESCAPE, are put in a new CopyFormatOption struct, whichis used by both COPY FROM and TO. Other state data are kept in separateCopyFromStateData and CopyToStateData structs.Reviewed-by: Soumyadeep Chakraborty, Erik Rijkers, Vignesh C, Andres FreundDiscussion:https://www.postgresql.org/message-id/8e15b560-f387-7acc-ac90-763986617bfb%40iki.fi1 parent1795897 commitc532d15
File tree
9 files changed
+4841
-4529
lines changed- contrib/file_fdw
- src
- backend
- commands
- replication/logical
- include/commands
9 files changed
+4841
-4529
lines changedLines changed: 6 additions & 4 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
105 | 105 |
| |
106 | 106 |
| |
107 | 107 |
| |
108 |
| - | |
| 108 | + | |
109 | 109 |
| |
110 | 110 |
| |
111 | 111 |
| |
| |||
655 | 655 |
| |
656 | 656 |
| |
657 | 657 |
| |
658 |
| - | |
| 658 | + | |
659 | 659 |
| |
660 | 660 |
| |
661 | 661 |
| |
| |||
677 | 677 |
| |
678 | 678 |
| |
679 | 679 |
| |
| 680 | + | |
680 | 681 |
| |
681 | 682 |
| |
682 | 683 |
| |
| |||
752 | 753 |
| |
753 | 754 |
| |
754 | 755 |
| |
| 756 | + | |
755 | 757 |
| |
756 | 758 |
| |
757 | 759 |
| |
| |||
1107 | 1109 |
| |
1108 | 1110 |
| |
1109 | 1111 |
| |
1110 |
| - | |
| 1112 | + | |
1111 | 1113 |
| |
1112 | 1114 |
| |
1113 | 1115 |
| |
| |||
1125 | 1127 |
| |
1126 | 1128 |
| |
1127 | 1129 |
| |
1128 |
| - | |
| 1130 | + | |
1129 | 1131 |
| |
1130 | 1132 |
| |
1131 | 1133 |
| |
|
Lines changed: 3 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
24 | 24 |
| |
25 | 25 |
| |
26 | 26 |
| |
| 27 | + | |
| 28 | + | |
| 29 | + | |
27 | 30 |
| |
28 | 31 |
| |
29 | 32 |
| |
|
0 commit comments
Comments
(0)