I am trying to import few large files to PostgreSQL database, the files have data in the following format, values separated by delimiter |. But the problem arises when you import using copy statement giving an error
ERROR: extra data after last expected column
After some testing I found that last character in the line is the cause of the problem, every line ends with delimiter. I found a workaround i.e. raplacing every character prior to line feed character. I am looking for COPY statement which works fine ignoring last character
8712678|MC|AMC355911||||355911|||AZ|AZ|2002|484|0|0|||C|CLOSED|CLOSED|239|DECLARED NULL & VOID|2002-01-31 00:00:00|2006-07-28 12:11:55|384101|LODE CLAIM|||2005-10-19 00:00:00|STELLAR METALS SM #2|01 05-10-1872;017STAT0091;30USC26,28,34|AMC355910|200103806|2001-09-07 00:00:00||||38||Y||||2011-07-19 12:55:52|