LOAD COPY does not support date format
Hello Demitri, May you please help me to fix the below issue..
- Problem Statement:: I am using LOAD COPY to load the data into my DB. Since one of my DB column is a timestamp i need to specify the date format to store while loading. However i get the below mentioned error. Using LOAD CSV works fine, however for better performance i want to use LOAD COPY.
- My pgl file is as below .
Please provide the following information:
-
[ "3.6.2"] pgloader --version
<fill pgloader version here> -
[ ] did you test a fresh compile from the source tree?
Compiling pgloader from sources is documented in the README, it's easy to do, and if patches are to be made to fix your bug, you're going to have to build from sources to get the fix anyway…
-
[ ] did you search for other similar issues?
-
[ ] how can I reproduce the bug?
Incude a self-contained pgloader command file.
If you're loading from a database, consider attaching a database dump to your issue. For MySQL, use
mysqldump. For SQLite, just send over your source file, that's easy. Maybe be the one with your production data, of course, the one with just the sample of data that allows me to reproduce your bug.When using a proprietary database system as a source, consider creating a sample database on some Cloud service or somewhere you can then give me access to, and see my email address on my GitHub profile to send me the credentials. Still open a public issue for tracking and as documentation for other users.
--
-- EDIT THIS FILE TO MATCH YOUR BUG REPORT
--
LOAD COPY
FROM 'test.csv.inprogress' (id,servicetype,starttime[date format 'YYYYMMDDHHMISS.MS'],organization)
INTO postgresql://<<DBHOSTHAME>>/testdb?core_test.test_copy
(recordid,servicetype,starttime,organization)
WITH
delimiter ','
SET
client_encoding to 'utf8',
work_mem to '64MB',
standard_conforming_strings to 'on'
;
- [ ] pgloader output you obtain
PASTE HERE THE OUTPUT OF THE PGLOADER COMMAND
FROM 'test.csv.inprogress' (id,servicetype,starttime[date format 'YYYYMMDDHH'],organization)
^ (Line 2, Column 165, Position 176)
In context COPY-SOURCE-FIELD-LIST:
While parsing COPY-SOURCE-FIELD-LIST. Problem:
The production
#\[
does not satisfy the predicate ALPHA-CHAR-P.
Expected:
the character Tab
or the character Newline
or the character Return
or the character Space
or the character $ (DOLLAR_SIGN)
or the character ) (RIGHT_PARENTHESIS)
or the character , (COMMA)
or the string "--"
or the character . (FULL_STOP)
or the string "/*"
or the character _ (LOW_LINE)
or any character satisfying DIGIT-CHAR-P
or any character satisfying ALPHA-CHAR-P
- [ (123,voice,20211115182853.449,abcCorp)] data that is being loaded, if relevant
- [ ]
PASTE HERE THE DATA THAT HAS BEEN LOADED
- [ ] How the data is different from what you expected, if relevant