example of edbldr =
smaple .csv file:
city.csv
nashik,MH,2000
pune,MH,3000
bhopal,MP,2000
sample of .ctl file:
city.ctl
LOAD DATA
INFILE 'city.csv'
BADFILE 'city.bad'
insert
INTO TABLE city_1
FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"'
TRAILING NULLCOLS
(name,state,public)
insert data into city_1 table(database test)
[enterprisedb@localhost ~]$ edbldr -d test control=city.ctl bad=city.bad log=city.log
EDB*Loader: Copyright (c) 2007-2017, EnterpriseDB Corporation.
Enter the user name : enterprisedb
Enter the password :
Successfully processed (3) records
[enterprisedb@localhost ~]$ edb-psql -d test -U enterprisedb
psql.bin (10.1.5)
Type "help" for help.
test=# select * from city_1;
name | state | public
--------+-------+--------
nashik | MH | 2000
pune | MH | 3000
bhopal | MP | 2000
(3 rows)
test=# exit