diff --git a/src/parsers/command-csv.lisp b/src/parsers/command-csv.lisp index d52b85c..1e944d4 100644 --- a/src/parsers/command-csv.lisp +++ b/src/parsers/command-csv.lisp @@ -182,6 +182,7 @@ (defrule csv-raw-field-name (and (or #\_ (alpha-char-p character)) (* (or (alpha-char-p character) (digit-char-p character) + #\. #\_))) (:text t)) diff --git a/test/Makefile b/test/Makefile index 215b09f..36d5f8d 100644 --- a/test/Makefile +++ b/test/Makefile @@ -19,6 +19,7 @@ REGRESS= allcols.load \ dbf.load \ errors.load \ fixed.load \ + fields-with-periods.load \ ixf.load \ overflow.load \ partial.load \ diff --git a/test/fields-with-periods.load b/test/fields-with-periods.load new file mode 100644 index 0000000..4f8db06 --- /dev/null +++ b/test/fields-with-periods.load @@ -0,0 +1,25 @@ +LOAD FIXED + FROM inline + ( + "CHARS.LETTERS" from 0 for 3, + "CHARS.NUMBERS" from 3 for 3 + ) + INTO postgresql:///pgloader?fixed + ( + "CHARS.LETTERS", + "CHARS.NUMBERS" + ) + + WITH truncate + + BEFORE LOAD DO + $$ drop table if exists fixed; $$, + $$ create table fixed ( + "CHARS.LETTERS" char(3), + "CHARS.NUMBERS" char(3) + ); + $$; + +abc123 +def456 +ghi789 diff --git a/test/regress/expected/fields-with-periods.out b/test/regress/expected/fields-with-periods.out new file mode 100644 index 0000000..48bfe1b --- /dev/null +++ b/test/regress/expected/fields-with-periods.out @@ -0,0 +1,3 @@ +abc 123 +def 456 +ghi 789