2

I am trying to insert csv file in postgresql database

the code is

COPY meta.fk_payment_temp
     FROM 'C:\Users\YAM\Downloads\wfgyrnyjumou_p\transaction-2014-04-01-2014-04-30.csv' with csv header delimiter ',' ;

but there is some column value have comma

like "24 mar, 2014","abc, xyz" etc

how i can solve this in postgresql query ?

5
  • possible duplicate of Load PostgreSQL table from CSV with data with commas between brackets Commented Jun 7, 2015 at 19:06
  • What exactly requires "solving" here? You haven't explained any problem, shown any error messages, etc. Commented Jun 8, 2015 at 0:44
  • That should work fine. It isn't a duplicate of the cited question, but the 'with csv' should be sufficient. If it didn't work, you should show us what happened. Commented Jun 8, 2015 at 0:53
  • @CraigRinger Error is extra data after column Commented Jun 8, 2015 at 7:38
  • @Shubhambatra Well... it looks sane from the info provided. So please edit the question to add a complete few lines of the problem CSV input and the table structure as a CREATE TABLE statement. Make sure the error actually happens with the sample data. Commented Jun 8, 2015 at 10:40

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.