mirror of
https://github.com/dimitri/pgloader.git
synced 2026-05-04 18:36:12 +02:00
Allow for loading CSV files not using any field quoting.
This commit is contained in:
parent
bab53d1cd0
commit
65035b1bc6
@ -905,6 +905,9 @@ Here's a quick description of the format we're parsing here:
|
||||
(declare (ignore f e o b))
|
||||
(cons :quote sep))))
|
||||
|
||||
(defrule option-fields-not-enclosed (and kw-fields kw-not kw-enclosed)
|
||||
(:constant (cons :quote nil)))
|
||||
|
||||
(defrule quote-quote "double-quote" (:constant "\"\""))
|
||||
(defrule backslash-quote "backslash-quote" (:constant "\\\""))
|
||||
(defrule escaped-quote-name (or quote-quote backslash-quote))
|
||||
@ -931,6 +934,7 @@ Here's a quick description of the format we're parsing here:
|
||||
|
||||
(defrule csv-option (or option-truncate
|
||||
option-skip-header
|
||||
option-fields-not-enclosed
|
||||
option-fields-enclosed-by
|
||||
option-fields-escaped-by
|
||||
option-fields-terminated-by))
|
||||
|
||||
@ -3,6 +3,5 @@ LOAD CSV
|
||||
INTO postgresql://dim@localhost:54393/yagoa?communaute_profil
|
||||
|
||||
WITH truncate,
|
||||
fields optionally enclosed by '"',
|
||||
fields escaped by double-quote,
|
||||
fields not enclosed,
|
||||
fields terminated by '\t';
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user