Commit 32ed549
committed
Simplify CSV header parsing - remove cleaning/validation, quote all identifiers
- Remove all header cleaning (no lowercase, no trim, no normalization)
- Remove validation against SQL identifier regex
- Quote all column identifiers in COPY command for exact case-sensitive matching
- Properly escape double quotes in column names (" -> "")
- Use csv-parse with minimal config: bom, to_line=1, skip_empty_lines
- Let PostgreSQL handle any invalid column names or mismatches
This preserves CSV headers exactly as-is and passes them to PostgreSQL with quoted identifiers, ensuring case-sensitive matching between CSV headers and table columns.
Co-Authored-By: Dan Lynch <pyramation@gmail.com>1 parent ec13f90 commit 32ed549
1 file changed
Lines changed: 9 additions & 24 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
14 | | - | |
15 | | - | |
16 | 14 | | |
17 | 15 | | |
18 | 16 | | |
| |||
36 | 34 | | |
37 | 35 | | |
38 | 36 | | |
39 | | - | |
40 | 37 | | |
41 | | - | |
42 | 38 | | |
43 | 39 | | |
44 | 40 | | |
| |||
51 | 47 | | |
52 | 48 | | |
53 | 49 | | |
54 | | - | |
55 | | - | |
56 | | - | |
57 | | - | |
58 | | - | |
59 | | - | |
60 | | - | |
61 | | - | |
62 | | - | |
63 | | - | |
64 | | - | |
65 | | - | |
66 | | - | |
67 | | - | |
68 | | - | |
69 | | - | |
70 | | - | |
71 | | - | |
72 | | - | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
73 | 54 | | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
74 | 58 | | |
75 | 59 | | |
76 | 60 | | |
| |||
85 | 69 | | |
86 | 70 | | |
87 | 71 | | |
88 | | - | |
| 72 | + | |
| 73 | + | |
89 | 74 | | |
90 | 75 | | |
91 | 76 | | |
| |||
0 commit comments