I have data in excel sheet named with district.csv needs to import only few columns from excel to postgres table named with hc_court_master
copy hc_court_master (district_cd, category,category1,shrt_nm,court_name)
from 'D:\district.csv'
with (format csv)
I was getting the error
ERROR: extra data after last expected column
SQL state: 22P04
Context: COPY hc_court_master, line 1: "court_code,court_name,short_c_name,category,dist_no,dist_name,category1"