mirror of
https://github.com/dimitri/pgloader.git
synced 2026-05-04 18:36:12 +02:00
Accept periods in CSV field names
Periods are allowed in PG column names as well.
This commit is contained in:
parent
bf62e06ff6
commit
dc04b40836
@ -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))
|
||||
|
||||
|
||||
@ -19,6 +19,7 @@ REGRESS= allcols.load \
|
||||
dbf.load \
|
||||
errors.load \
|
||||
fixed.load \
|
||||
fields-with-periods.load \
|
||||
ixf.load \
|
||||
overflow.load \
|
||||
partial.load \
|
||||
|
||||
25
test/fields-with-periods.load
Normal file
25
test/fields-with-periods.load
Normal 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
|
||||
3
test/regress/expected/fields-with-periods.out
Normal file
3
test/regress/expected/fields-with-periods.out
Normal file
@ -0,0 +1,3 @@
|
||||
abc 123
|
||||
def 456
|
||||
ghi 789
|
||||
Loading…
x
Reference in New Issue
Block a user