Allow for loading CSV files not using any field quoting.

This commit is contained in:
Dimitri Fontaine 2013-10-08 22:16:52 +02:00
parent bab53d1cd0
commit 65035b1bc6
2 changed files with 5 additions and 2 deletions

View File

@ -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))

View File

@ -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';