Accept periods in CSV field names

Periods are allowed in PG column names as well.
This commit is contained in:
Mark Lee 2015-05-14 10:50:08 -07:00
parent bf62e06ff6
commit dc04b40836
4 changed files with 30 additions and 0 deletions

View File

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

View File

@ -19,6 +19,7 @@ REGRESS= allcols.load \
dbf.load \
errors.load \
fixed.load \
fields-with-periods.load \
ixf.load \
overflow.load \
partial.load \

View File

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

View File

@ -0,0 +1,3 @@
abc 123
def 456
ghi 789