Revision 4927
Added by Aaron Marcuse-Kubitza about 12 years ago
bin/csv2db | ||
---|---|---|
80 | 80 |
def load_(): |
81 | 81 |
# Create COPY FROM statement |
82 | 82 |
if use_copy_from[0]: |
83 |
copy_from = ('COPY '+table.to_str(db)+' (' |
|
84 |
+(', '.join(map(esc_name, col_names))) |
|
85 |
+') FROM STDIN DELIMITER '+db.esc_value(dialect.delimiter) |
|
86 |
+' NULL '+db.esc_value('')) |
|
83 |
copy_from = ('COPY '+table.to_str(db)+' FROM STDIN DELIMITER ' |
|
84 |
+db.esc_value(dialect.delimiter)+' NULL '+db.esc_value('')) |
|
87 | 85 |
assert not csvs.is_tsv(dialect) |
88 | 86 |
copy_from += ' CSV' |
89 | 87 |
if dialect.quoting != csv.QUOTE_NONE: |
Also available in: Unified diff
csv2db: COPY FROM mode: Removed no longer needed explicit column list, now that the initial table has the exact width of the CSV (the row_num is added later)